[PATCH 1/5] wined3d: Add core context P8 blit support to the GLSL blitter.

Henri Verbeet hverbeet at codeweavers.com
Mon Apr 30 13:14:59 CDT 2018


We use GL_R8 for WINED3DFMT_P8_UINT in core contexts, since GL_ALPHA8 is not
available.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/glsl_shader.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 64a2604ab7d..a9af9acd31f 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -12318,8 +12318,9 @@ static void glsl_blitter_generate_p8_shader(struct wined3d_string_buffer *buffer
     shader_addline(buffer, "uniform sampler1D sampler_palette;\n");
     shader_addline(buffer, "\nvoid main()\n{\n");
     /* The alpha-component contains the palette index. */
-    shader_addline(buffer, "    float index = texture%s(sampler, out_texcoord.%s).w;\n",
-            needs_legacy_glsl_syntax(gl_info) ? tex_type : "", swizzle);
+    shader_addline(buffer, "    float index = texture%s(sampler, out_texcoord.%s).%c;\n",
+            needs_legacy_glsl_syntax(gl_info) ? tex_type : "", swizzle,
+            gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? 'w' : 'x');
     /* Scale the index by 255/256 and add a bias of 0.5 in order to sample in
      * the middle. */
     shader_addline(buffer, "    index = (index * 255.0 + 0.5) / 256.0;\n");
-- 
2.11.0




More information about the wine-devel mailing list