aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i965/brw_surface_formats.c15
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c4
2 files changed, 5 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c
index 7b17e111252..b176a21c226 100644
--- a/src/mesa/drivers/dri/i965/brw_surface_formats.c
+++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c
@@ -94,14 +94,14 @@ brw_isl_format_for_mesa_format(mesa_format mesa_format)
[MESA_FORMAT_L_SRGB8] = ISL_FORMAT_L8_UNORM_SRGB,
[MESA_FORMAT_L8A8_SRGB] = ISL_FORMAT_L8A8_UNORM_SRGB,
[MESA_FORMAT_A8L8_SRGB] = 0,
- [MESA_FORMAT_SRGB_DXT1] = ISL_FORMAT_DXT1_RGB_SRGB,
+ [MESA_FORMAT_SRGB_DXT1] = ISL_FORMAT_BC1_UNORM_SRGB,
[MESA_FORMAT_SRGBA_DXT1] = ISL_FORMAT_BC1_UNORM_SRGB,
[MESA_FORMAT_SRGBA_DXT3] = ISL_FORMAT_BC2_UNORM_SRGB,
[MESA_FORMAT_SRGBA_DXT5] = ISL_FORMAT_BC3_UNORM_SRGB,
[MESA_FORMAT_RGB_FXT1] = ISL_FORMAT_FXT1,
[MESA_FORMAT_RGBA_FXT1] = ISL_FORMAT_FXT1,
- [MESA_FORMAT_RGB_DXT1] = ISL_FORMAT_DXT1_RGB,
+ [MESA_FORMAT_RGB_DXT1] = ISL_FORMAT_BC1_UNORM,
[MESA_FORMAT_RGBA_DXT1] = ISL_FORMAT_BC1_UNORM,
[MESA_FORMAT_RGBA_DXT3] = ISL_FORMAT_BC2_UNORM,
[MESA_FORMAT_RGBA_DXT5] = ISL_FORMAT_BC3_UNORM,
@@ -541,17 +541,6 @@ translate_tex_format(struct brw_context *brw,
*/
return ISL_FORMAT_R32G32B32A32_FLOAT;
- case MESA_FORMAT_SRGB_DXT1:
- if (brw->gen == 4 && !brw->is_g4x) {
- /* Work around missing SRGB DXT1 support on original gen4 by just
- * skipping SRGB decode. It's not worth not supporting sRGB in
- * general to prevent this.
- */
- WARN_ONCE(true, "Demoting sRGB DXT1 texture to non-sRGB\n");
- mesa_format = MESA_FORMAT_RGB_DXT1;
- }
- return brw_isl_format_for_mesa_format(mesa_format);
-
case MESA_FORMAT_RGBA_ASTC_4x4:
case MESA_FORMAT_RGBA_ASTC_5x4:
case MESA_FORMAT_RGBA_ASTC_5x5:
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index ba98cd42a5e..a0fed6096d2 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -389,7 +389,9 @@ brw_get_texture_swizzle(const struct gl_context *ctx,
case GL_RED:
case GL_RG:
case GL_RGB:
- if (_mesa_get_format_bits(img->TexFormat, GL_ALPHA_BITS) > 0)
+ if (_mesa_get_format_bits(img->TexFormat, GL_ALPHA_BITS) > 0 ||
+ img->TexFormat == MESA_FORMAT_RGB_DXT1 ||
+ img->TexFormat == MESA_FORMAT_SRGB_DXT1)
swizzles[3] = SWIZZLE_ONE;
break;
}