wined3d: Enable blue = 1.0 fixup for D3DFMT_V8U8.
The dx7 sdk demos need this.
This commit is contained in:
parent
0bf32b12f5
commit
33482a732e
|
@ -601,14 +601,13 @@ static void gen_color_correction(SHADER_BUFFER *buffer, const char *reg, const c
|
||||||
case WINED3DFMT_V8U8:
|
case WINED3DFMT_V8U8:
|
||||||
case WINED3DFMT_V16U16:
|
case WINED3DFMT_V16U16:
|
||||||
if(GL_SUPPORT(NV_TEXTURE_SHADER) && fmt == WINED3DFMT_V8U8) {
|
if(GL_SUPPORT(NV_TEXTURE_SHADER) && fmt == WINED3DFMT_V8U8) {
|
||||||
if(0) {
|
/* The 3rd channel returns 1.0 in d3d, but 0.0 in gl. Fix this while we're at it :-)
|
||||||
/* The 3rd channel returns 1.0 in d3d, but 0.0 in gl. Fix this while we're at it :-)
|
* The dx7 sdk BumpEarth demo needs it because it uses BUMPENVMAPLUMINANCE with V8U8.
|
||||||
* disabled until an application that needs it is found because it causes unneeded
|
* With the luminance(b) value = 1.0, BUMPENVMAPLUMINANCE == BUMPENVMAP, but if b is
|
||||||
* shader recompilation in some game
|
* 0.0(without this fixup), the rendering breaks.
|
||||||
*/
|
*/
|
||||||
if(strlen(writemask) >= 4) {
|
if(strlen(writemask) >= 4) {
|
||||||
shader_addline(buffer, "MOV %s.%c, %s;\n", reg, writemask[3], one);
|
shader_addline(buffer, "MOV %s.%c, %s;\n", reg, writemask[3], one);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Correct the sign, but leave the blue as it is - it was loaded correctly already
|
/* Correct the sign, but leave the blue as it is - it was loaded correctly already
|
||||||
|
|
|
@ -365,28 +365,17 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info)
|
||||||
|
|
||||||
/* V8U8 is supported natively by GL_ATI_envmap_bumpmap and GL_NV_texture_shader.
|
/* V8U8 is supported natively by GL_ATI_envmap_bumpmap and GL_NV_texture_shader.
|
||||||
* V16U16 is only supported by GL_NV_texture_shader. The formats need fixup if
|
* V16U16 is only supported by GL_NV_texture_shader. The formats need fixup if
|
||||||
* their extensions are not available.
|
* their extensions are not available. GL_ATI_envmap_bumpmap is not used because
|
||||||
|
* the only driver that implements it(fglrx) has a buggy implementation.
|
||||||
*
|
*
|
||||||
* In theory, V8U8 and V16U16 need a fixup of the undefined blue channel. OpenGL
|
* V8U8 and V16U16 need a fixup of the undefined blue channel. OpenGL
|
||||||
* returns 0.0 when sampling from it, DirectX 1.0. This is disabled until we find
|
* returns 0.0 when sampling from it, DirectX 1.0. So we always have in-shader
|
||||||
* an application that needs this because it causes performance problems due to
|
* conversion for this format.
|
||||||
* shader recompiling in some games.
|
|
||||||
*/
|
*/
|
||||||
if(!GL_SUPPORT(NV_TEXTURE_SHADER2)) {
|
dst = getFmtIdx(WINED3DFMT_V8U8);
|
||||||
/* signed -> unsigned fixup */
|
gl_info->gl_formats[dst].conversion_group = WINED3DFMT_V8U8;
|
||||||
dst = getFmtIdx(WINED3DFMT_V8U8);
|
dst = getFmtIdx(WINED3DFMT_V16U16);
|
||||||
gl_info->gl_formats[dst].conversion_group = WINED3DFMT_V8U8;
|
gl_info->gl_formats[dst].conversion_group = WINED3DFMT_V8U8;
|
||||||
dst = getFmtIdx(WINED3DFMT_V16U16);
|
|
||||||
gl_info->gl_formats[dst].conversion_group = WINED3DFMT_V8U8;
|
|
||||||
} else {
|
|
||||||
/* Blue = 1.0 fixup, disabled for now */
|
|
||||||
if(0) {
|
|
||||||
dst = getFmtIdx(WINED3DFMT_V8U8);
|
|
||||||
gl_info->gl_formats[dst].conversion_group = WINED3DFMT_V8U8;
|
|
||||||
dst = getFmtIdx(WINED3DFMT_V16U16);
|
|
||||||
gl_info->gl_formats[dst].conversion_group = WINED3DFMT_V8U8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!GL_SUPPORT(NV_TEXTURE_SHADER)) {
|
if(!GL_SUPPORT(NV_TEXTURE_SHADER)) {
|
||||||
/* If GL_NV_texture_shader is not supported, those formats are converted, incompatibly
|
/* If GL_NV_texture_shader is not supported, those formats are converted, incompatibly
|
||||||
|
|
Loading…
Reference in New Issue