Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu> --- src/gallium/drivers/nouveau/nv50/nv50_tex.c | 12 ++++++++++++ src/gallium/drivers/nouveau/nvc0/nvc0_tex.c | 12 ++++++++++++ 2 files changed, 24 insertions(+)
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_tex.c b/src/gallium/drivers/nouveau/nv50/nv50_tex.c index 5cfce3a..acb28fd 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_tex.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_tex.c @@ -103,6 +103,18 @@ nv50_create_texture_view(struct pipe_context *pipe, tex_int = util_format_is_pure_integer(view->pipe.format); + if (templ->stencil_sampling) { + /* flip between C0 and C1 for r */ + tic[0] ^= 1 << NV50_TIC_0_MAPR__SHIFT; + /* clear out g/b/a */ + tic[0] &= ~(NV50_TIC_0_MAPG__MASK | + NV50_TIC_0_MAPB__MASK | + NV50_TIC_0_MAPA__MASK); + /* set a to 1 */ + tic[0] |= NV50_TIC_MAP_ONE_INT << NV50_TIC_0_MAPA__SHIFT; + tex_int = 1; + } + swz[0] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_r, tex_int); swz[1] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_g, tex_int); swz[2] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_b, tex_int); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c index 1b11bd0..ef0047f 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c @@ -106,6 +106,18 @@ nvc0_create_texture_view(struct pipe_context *pipe, tex_int = util_format_is_pure_integer(view->pipe.format); + if (templ->stencil_sampling) { + /* flip between C0 and C1 for r */ + tic[0] ^= 1 << NV50_TIC_0_MAPR__SHIFT; + /* clear out g/b/a */ + tic[0] &= ~(NV50_TIC_0_MAPG__MASK | + NV50_TIC_0_MAPB__MASK | + NV50_TIC_0_MAPA__MASK); + /* set a to 1 */ + tic[0] |= NV50_TIC_MAP_ONE_INT << NV50_TIC_0_MAPA__SHIFT; + tex_int = 1; + } + swz[0] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_r, tex_int); swz[1] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_g, tex_int); swz[2] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_b, tex_int); -- 1.8.3.2 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev