[Mesa-dev] [PATCH v3 4/6] nvc0: Handle ARB_conditional_render_inverted and enable it
Ilia Mirkin
imirkin at alum.mit.edu
Mon Aug 18 09:48:38 PDT 2014
On Sun, Aug 17, 2014 at 7:38 PM, Tobias Klausmann
<tobias.johannes.klausmann at mni.thm.de> wrote:
> Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de>
> ---
> src/gallium/drivers/nouveau/nvc0/nvc0_query.c | 5 ++---
> src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 3 +--
> src/gallium/drivers/nouveau/nvc0/nvc0_surface.c | 4 +++-
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
> index 50cef1e..71d48f2 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
> @@ -542,7 +542,6 @@ nvc0_render_condition(struct pipe_context *pipe,
> struct nouveau_pushbuf *push = nvc0->base.pushbuf;
> struct nvc0_query *q;
> uint32_t cond;
> - boolean negated = FALSE;
> boolean wait =
> mode != PIPE_RENDER_COND_NO_WAIT &&
> mode != PIPE_RENDER_COND_BY_REGION_NO_WAIT;
> @@ -561,13 +560,13 @@ nvc0_render_condition(struct pipe_context *pipe,
> /* NOTE: comparison of 2 queries only works if both have completed */
> switch (q->type) {
> case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
> - cond = negated ? NVC0_3D_COND_MODE_EQUAL :
> + cond = condition ? NVC0_3D_COND_MODE_EQUAL :
> NVC0_3D_COND_MODE_NOT_EQUAL;
> wait = TRUE;
> break;
> case PIPE_QUERY_OCCLUSION_COUNTER:
> case PIPE_QUERY_OCCLUSION_PREDICATE:
> - if (likely(!negated)) {
> + if (likely(!condition)) {
> if (unlikely(q->nesting))
> cond = wait ? NVC0_3D_COND_MODE_NOT_EQUAL :
> NVC0_3D_COND_MODE_ALWAYS;
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> index 7c2f11a..84025ef 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> @@ -167,13 +167,12 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
> case PIPE_CAP_TEXTURE_GATHER_OFFSETS:
> case PIPE_CAP_TEXTURE_GATHER_SM5:
> case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
> + case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
> return 1;
> case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
> return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
> case PIPE_CAP_COMPUTE:
> return (class_3d == NVE4_3D_CLASS) ? 1 : 0;
> - case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
> - return 0;
>
> /* unsupported caps */
> case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
> index a29f0cc..622193b 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
> @@ -1210,6 +1210,8 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
> int64_t du_dx, dv_dy;
> int i;
> uint32_t mode;
> + uint32_t cond = nvc0->cond_cond ? NVC0_2D_COND_MODE_EQUAL :
> + NVC0_2D_COND_MODE_NOT_EQUAL;
> uint32_t mask = nv50_blit_eng2d_get_mask(info);
> boolean b;
>
> @@ -1236,7 +1238,7 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
> }
>
> if (nvc0->cond_query && info->render_condition_enable)
> - IMMED_NVC0(push, NVC0_2D(COND_MODE), NVC0_2D_COND_MODE_RES_NON_ZERO);
> + IMMED_NVC0(push, NVC0_2D(COND_MODE), cond);
This used to always get set to NVC0_2D_COND_MODE_RES_NON_ZERO. Now it
will never be set to that. I think you need to copy the cond selection
logic from nvc0_query a little more faithfully...
>
> if (mask != 0xffffffff) {
> IMMED_NVC0(push, NVC0_2D(ROP), 0xca); /* DPSDxax */
> --
> 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