[Mesa-dev] [PATCH 1/4] i965: Actually add support for GL_ANY_SAMPLES_PASSED from GL_ARB_oq2.

Ian Romanick idr at freedesktop.org
Fri Oct 19 12:30:18 PDT 2012


On 10/19/2012 11:53 AM, Eric Anholt wrote:

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

We'll have to revisit this when we add 
GL_ANY_SAMPLES_PASSED_CONSERVATIVE for GLES3.  See cc97bef on my gles3 
branch.

> ---
>   src/mesa/drivers/dri/i965/brw_queryobj.c |    9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c
> index 1aa4974..11f8fcd 100644
> --- a/src/mesa/drivers/dri/i965/brw_queryobj.c
> +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c
> @@ -194,6 +194,13 @@ brw_queryobj_get_results(struct gl_context *ctx,
>         }
>         break;
>
> +   case GL_ANY_SAMPLES_PASSED:
> +      /* Set true if any Map and count the pixels from the current query BO */
> +      for (i = query->first_index; i <= query->last_index; i++) {
> +	 query->Base.Result |= results[i * 2 + 1] != results[i * 2];
> +      }
> +      break;
> +
>      case GL_PRIMITIVES_GENERATED:
>      case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
>         /* We don't actually query the hardware for this value, so query->bo
> @@ -250,6 +257,7 @@ brw_begin_query(struct gl_context *ctx, struct gl_query_object *q)
>         write_timestamp(intel, query->bo, 0);
>         break;
>
> +   case GL_ANY_SAMPLES_PASSED:
>      case GL_SAMPLES_PASSED_ARB:
>         /* Reset our driver's tracking of query state. */
>         drm_intel_bo_unreference(query->bo);
> @@ -304,6 +312,7 @@ brw_end_query(struct gl_context *ctx, struct gl_query_object *q)
>         write_timestamp(intel, query->bo, 1);
>         break;
>
> +   case GL_ANY_SAMPLES_PASSED:
>      case GL_SAMPLES_PASSED_ARB:
>         if (query->bo) {
>   	 brw_emit_query_end(brw);
>


More information about the mesa-dev mailing list