Commit 71f24b8d authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent b9163e22
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment