i965: Enable the GL_ARB_texture_compression_bptc extension
authorNeil Roberts <neil@linux.intel.com>
Thu, 17 Jul 2014 13:38:20 +0000 (14:38 +0100)
committerNeil Roberts <neil@linux.intel.com>
Tue, 12 Aug 2014 17:23:50 +0000 (18:23 +0100)
Enables the BPTC extension on Gen>=7 and adds the necessary format mappings to
get the right surface type value.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_surface_formats.c
src/mesa/drivers/dri/i965/intel_extensions.c

index 41f4221d3e697b8f346cbc8ffb1f7b48a21f72a0..974f2dfe4e170b04878156b8362bacf509044193 100644 (file)
@@ -487,6 +487,11 @@ brw_format_for_mesa_format(mesa_format mesa_format)
       [MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1] = BRW_SURFACEFORMAT_ETC2_RGB8_PTA,
       [MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1] = BRW_SURFACEFORMAT_ETC2_SRGB8_PTA,
 
+      [MESA_FORMAT_BPTC_RGBA_UNORM] = BRW_SURFACEFORMAT_BC7_UNORM,
+      [MESA_FORMAT_BPTC_SRGB_ALPHA_UNORM] = BRW_SURFACEFORMAT_BC7_UNORM_SRGB,
+      [MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT] = BRW_SURFACEFORMAT_BC6H_SF16,
+      [MESA_FORMAT_BPTC_RGB_UNSIGNED_FLOAT] = BRW_SURFACEFORMAT_BC6H_UF16,
+
       [MESA_FORMAT_A_SNORM8] = 0,
       [MESA_FORMAT_L_SNORM8] = 0,
       [MESA_FORMAT_L8A8_SNORM] = 0,
index 31cf75103e7df4d773a443655a46fc921a790fe4..e134cd9e4b01f6290a433a903dd872e6266b3d23 100644 (file)
@@ -303,6 +303,8 @@ intelInitExtensions(struct gl_context *ctx)
          ctx->Extensions.ARB_viewport_array = true;
          ctx->Extensions.AMD_vertex_shader_viewport_index = true;
       }
+
+      ctx->Extensions.ARB_texture_compression_bptc = true;
    }
 
    if (brw->gen >= 8) {