i965: Enable ARB_texture_stencil8 and OES_texture_stencil8 on Gen8+.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 3 Mar 2016 09:58:13 +0000 (01:58 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 27 Apr 2016 04:32:35 +0000 (21:32 -0700)
Stencil texturing is required by ES 3.1.  Apparently we never actually
turned it on.  Do that now.  Also turn on the desktop extension.

Fixes nine dEQP-GLES31.functional tests:

stencil_texturing.format.stencil_index8_2d
texture.border_clamp.formats.stencil_index8.nearest_size_pot
texture.border_clamp.formats.stencil_index8.nearest_size_npot
texture.border_clamp.formats.stencil_index8.gather_size_pot
texture.border_clamp.formats.stencil_index8.gather_size_npot
texture.border_clamp.unused_channels.stencil_index8
state_query.internal_format.renderbuffer.stencil_index8_samples
state_query.internal_format.texture_2d_multisample.stencil_index8_samples
state_query.internal_format.texture_2d_multisample_array.stencil_index8_samples

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c
src/mesa/drivers/dri/i965/brw_surface_formats.c
src/mesa/drivers/dri/i965/intel_extensions.c

index 3cad1658d63f172164d0395d5d04d54320c6df8b..e311760646f69555156e3a7e3bca3aaa518a619d 100644 (file)
@@ -436,12 +436,6 @@ brw_meta_stencil_blit(struct brw_context *brw,
    GLenum target = 0;
 
    _mesa_meta_fb_tex_blit_begin(ctx, &blit);
-   /* XXX: Pretend to support stencil textures so _mesa_base_tex_format()
-    * returns a valid format.  When we properly support the extension, we
-    * should remove this.
-    */
-   assert(ctx->Extensions.ARB_texture_stencil8 == false);
-   ctx->Extensions.ARB_texture_stencil8 = true;
 
    drawFb = ctx->Driver.NewFramebuffer(ctx, 0xDEADBEEF);
    if (drawFb == NULL) {
@@ -484,7 +478,6 @@ brw_meta_stencil_blit(struct brw_context *brw,
    _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
 
 error:
-   ctx->Extensions.ARB_texture_stencil8 = false;
    _mesa_meta_fb_tex_blit_end(ctx, target, &blit);
    _mesa_meta_end(ctx);
 
index c65f0d35235d0fa58f4978a62a97ed362502c041..16667b9824ee7c8b86f11877f5372221d070f5d3 100644 (file)
@@ -704,6 +704,7 @@ brw_init_surface_formats(struct brw_context *brw)
    ctx->TextureFormatSupported[MESA_FORMAT_Z24_UNORM_X8_UINT] = true;
    ctx->TextureFormatSupported[MESA_FORMAT_Z_FLOAT32] = true;
    ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_S8X24_UINT] = true;
+   ctx->TextureFormatSupported[MESA_FORMAT_S_UINT8] = true;
 
    /* Benchmarking shows that Z16 is slower than Z24, so there's no reason to
     * use it unless you're under memory (not memory bandwidth) pressure.
index 907f24f244d873728ad8a95d084819f3b9601ef6..820d57322867f4794be88048795ecca8cb92c928 100644 (file)
@@ -368,6 +368,7 @@ intelInitExtensions(struct gl_context *ctx)
 
    if (brw->gen >= 8) {
       ctx->Extensions.ARB_stencil_texturing = true;
+      ctx->Extensions.ARB_texture_stencil8 = true;
    }
 
    if (brw->gen >= 9) {