Henri Verbeet : wined3d: Add core context P8 blit support to the GLSL blitter.

Alexandre Julliard julliard at winehq.org
Mon Apr 30 15:12:48 CDT 2018


Module: wine
Branch: master
Commit: 71f24b8dbd831b21d89718d0bfa5596313c13941
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=71f24b8dbd831b21d89718d0bfa5596313c13941

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Apr 30 23:02:59 2018 +0430

wined3d: Add core context P8 blit support to the GLSL blitter.

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>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 64a2604..a9af9ac 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");




More information about the wine-cvs mailing list