[PATCH 3/5] wined3d: Use a core-compatible GL format for ATI2N.
Matteo Bruni
mbruni at codeweavers.com
Mon Jul 6 15:20:12 CDT 2015
---
The ARB_texture_compression_rgtc spec was initially written before
ARB_texture_rg but recently updated to refer to GL_RED and GL_RG. It
doesn't otherwise mention those new base formats but I'm nevertheless
using ARB_TEXTURE_COMPRESSION_RGTC to flag the availability of RGTC with
the RED and RG base formats and the EXT version for the luminance base
format.
---
dlls/wined3d/directx.c | 10 ++++++++++
dlls/wined3d/utils.c | 7 ++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index e392e50..059332d 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -3465,11 +3465,21 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
TRACE(" IMPLIED: ARB_vertex_array_bgra support (by EXT_vertex_array_bgra).\n");
gl_info->supported[ARB_VERTEX_ARRAY_BGRA] = TRUE;
}
+ if (!gl_info->supported[EXT_TEXTURE_COMPRESSION_RGTC] && gl_info->supported[ARB_TEXTURE_COMPRESSION_RGTC])
+ {
+ TRACE(" IMPLIED: EXT_texture_compression_rgtc support (by ARB_texture_compression_rgtc).\n");
+ gl_info->supported[EXT_TEXTURE_COMPRESSION_RGTC] = TRUE;
+ }
if (!gl_info->supported[ARB_TEXTURE_COMPRESSION_RGTC] && gl_info->supported[EXT_TEXTURE_COMPRESSION_RGTC])
{
TRACE(" IMPLIED: ARB_texture_compression_rgtc support (by EXT_texture_compression_rgtc).\n");
gl_info->supported[ARB_TEXTURE_COMPRESSION_RGTC] = TRUE;
}
+ if (gl_info->supported[ARB_TEXTURE_COMPRESSION_RGTC] && !gl_info->supported[ARB_TEXTURE_RG])
+ {
+ TRACE("ARB_texture_rg not supported, disabling ARB_texture_compression_rgtc.\n");
+ gl_info->supported[ARB_TEXTURE_COMPRESSION_RGTC] = FALSE;
+ }
if (gl_info->supported[NV_TEXTURE_SHADER2])
{
if (gl_info->supported[NV_REGISTER_COMBINERS])
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 6c003c7..48f6671 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -1269,6 +1269,11 @@ static const struct wined3d_format_texture_info format_texture_info[] =
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0,
WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING
| WINED3DFMT_FLAG_COMPRESSED,
+ EXT_TEXTURE_COMPRESSION_RGTC, NULL},
+ {WINED3DFMT_ATI2N, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_RG_RGTC2, 0,
+ GL_RG, GL_UNSIGNED_BYTE, 0,
+ WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING
+ | WINED3DFMT_FLAG_COMPRESSED,
ARB_TEXTURE_COMPRESSION_RGTC, NULL},
{WINED3DFMT_INTZ, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, 0,
@@ -2381,7 +2386,7 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_
1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_Z, 0, CHANNEL_SOURCE_W);
}
- if (gl_info->supported[ARB_TEXTURE_COMPRESSION_RGTC])
+ if (gl_info->supported[ARB_TEXTURE_COMPRESSION_RGTC] || gl_info->supported[EXT_TEXTURE_COMPRESSION_RGTC])
{
idx = getFmtIdx(WINED3DFMT_ATI1N);
gl_info->formats[idx].color_fixup = create_color_fixup_desc(
--
2.3.6
More information about the wine-patches
mailing list