[Mesa-dev] [PATCH v2 3/8] gallium/st: Add PIPE_CAP_CONDITIONAL_RENDER_INVERTED
Ilia Mirkin
imirkin at alum.mit.edu
Sun Aug 17 14:21:44 PDT 2014
On Sun, Aug 17, 2014 at 5:15 PM, Tobias Klausmann
<tobias.johannes.klausmann at mni.thm.de> wrote:
> with this we determine if the driver wants to enable
> GL_ARB_conditional_render_inverted
>
> Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de>
> ---
> src/gallium/docs/source/screen.rst | 2 ++
> src/gallium/include/pipe/p_defines.h | 1 +
This change should include adding this PIPE_CAP to the "disabled" list
in all the gallium drivers.
> src/mesa/state_tracker/st_cb_condrender.c | 20 +++++++++++++++++++-
> src/mesa/state_tracker/st_extensions.c | 1 +
These should be their own change with a "mesa/st" or "st/mesa" prefix.
> 4 files changed, 23 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
> index 2694923..eee254e 100644
> --- a/src/gallium/docs/source/screen.rst
> +++ b/src/gallium/docs/source/screen.rst
> @@ -223,6 +223,8 @@ The integer capabilities:
> * ``PIPE_CAP_VIDEO_MEMORY``: The amount of video memory in megabytes.
> * ``PIPE_CAP_UMA``: If the device has a unified memory architecture or on-card
> memory and GART.
> +* ``PIPE_CAP_CONDITIONAL_RENDER_INVERTED``: Whether the driver supports inverted
> + condition for conditional rendering.
>
>
> .. _pipe_capf:
> diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
> index 1a31350..04e4798 100644
> --- a/src/gallium/include/pipe/p_defines.h
> +++ b/src/gallium/include/pipe/p_defines.h
> @@ -568,6 +568,7 @@ enum pipe_cap {
> PIPE_CAP_ACCELERATED = 105,
> PIPE_CAP_VIDEO_MEMORY = 106,
> PIPE_CAP_UMA = 107,
> + PIPE_CAP_CONDITIONAL_RENDER_INVERTED = 108,
> };
>
> #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
> diff --git a/src/mesa/state_tracker/st_cb_condrender.c b/src/mesa/state_tracker/st_cb_condrender.c
> index 8776985..2f70f08 100644
> --- a/src/mesa/state_tracker/st_cb_condrender.c
> +++ b/src/mesa/state_tracker/st_cb_condrender.c
> @@ -55,6 +55,8 @@ st_BeginConditionalRender(struct gl_context *ctx, struct gl_query_object *q,
> struct st_query_object *stq = st_query_object(q);
> struct st_context *st = st_context(ctx);
> uint m;
> + /* Don't invert the rendering by default */
invert the condition, not the rendering, right? Also I'd just call it
'inverted'.
> + boolean invertedCond = FALSE;
>
> st_flush_bitmap_cache(st);
>
> @@ -71,12 +73,28 @@ st_BeginConditionalRender(struct gl_context *ctx, struct gl_query_object *q,
> case GL_QUERY_BY_REGION_NO_WAIT:
> m = PIPE_RENDER_COND_BY_REGION_NO_WAIT;
> break;
> + case GL_QUERY_WAIT_INVERTED:
> + m = PIPE_RENDER_COND_WAIT;
> + invertedCond = TRUE;
> + break;
> + case GL_QUERY_NO_WAIT_INVERTED:
> + m = PIPE_RENDER_COND_NO_WAIT;
> + invertedCond = TRUE;
> + break;
> + case GL_QUERY_BY_REGION_WAIT_INVERTED:
> + m = PIPE_RENDER_COND_BY_REGION_WAIT;
> + invertedCond = TRUE;
> + break;
> + case GL_QUERY_BY_REGION_NO_WAIT_INVERTED:
> + m = PIPE_RENDER_COND_BY_REGION_NO_WAIT;
> + invertedCond = TRUE;
> + break;
> default:
> assert(0 && "bad mode in st_BeginConditionalRender");
> m = PIPE_RENDER_COND_WAIT;
> }
>
> - cso_set_render_condition(st->cso_context, stq->pq, FALSE, m);
> + cso_set_render_condition(st->cso_context, stq->pq, invertedCond, m);
> }
>
>
> diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
> index 24e886c..4110eb5 100644
> --- a/src/mesa/state_tracker/st_extensions.c
> +++ b/src/mesa/state_tracker/st_extensions.c
> @@ -460,6 +460,7 @@ void st_init_extensions(struct pipe_screen *screen,
> { o(ARB_sample_shading), PIPE_CAP_SAMPLE_SHADING },
> { o(ARB_draw_indirect), PIPE_CAP_DRAW_INDIRECT },
> { o(ARB_derivative_control), PIPE_CAP_TGSI_FS_FINE_DERIVATIVE },
> + { o(ARB_conditional_render_inverted), PIPE_CAP_CONDITIONAL_RENDER_INVERTED },
> };
>
> /* Required: render target and sampler support */
> --
> 1.8.4.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list