Commit 8f3accc7 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Care for the inverted y coords in dsy.

parent 9694cb2d
......@@ -389,6 +389,8 @@ HRESULT shader_get_registers_used(
} else {
reg_maps->bumpmat = regnum;
}
} else if(WINED3DSIO_DSY == curOpcode->opcode) {
reg_maps->usesdsy = 1;
}
/* This will loop over all the registers and try to
......
......@@ -559,7 +559,7 @@ void shader_generate_glsl_declarations(
ps_impl->srgb_enabled = 0;
ps_impl->srgb_mode_hardcoded = 1;
}
if(reg_maps->vpos) {
if(reg_maps->vpos || reg_maps->usesdsy) {
if(This->baseShader.limits.constant_float + extra_constants_needed + 1 < GL_LIMITS(pshader_constantsF)) {
shader_addline(buffer, "uniform vec4 ycorrection;\n");
((IWineD3DPixelShaderImpl *) This)->vpos_uniform = 1;
......@@ -1392,7 +1392,7 @@ void shader_glsl_map2gl(SHADER_OPCODE_ARG* arg) {
case WINED3DSIO_EXP: instruction = "exp2"; break;
case WINED3DSIO_SGN: instruction = "sign"; break;
case WINED3DSIO_DSX: instruction = "dFdx"; break;
case WINED3DSIO_DSY: instruction = "dFdy"; break;
case WINED3DSIO_DSY: instruction = "ycorrection.y * dFdy"; break;
default: instruction = "";
FIXME("Opcode %s not yet handled in GLSL\n", curOpcode->name);
break;
......
......@@ -599,6 +599,12 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_CompileShader(IWineD3DPixelShader
goto recompile;
}
}
if(This->baseShader.reg_maps.usesdsy && !This->vpos_uniform) {
if(This->render_offscreen ? 0 : 1 != deviceImpl->render_offscreen ? 0 : 1) {
WARN("Recompiling shader because dsy is used, hard compiled and render_offscreen changed\n");
goto recompile;
}
}
return WINED3D_OK;
......
......@@ -1653,7 +1653,7 @@ typedef struct shader_reg_maps {
* Use 0 as default (bit 31 is always 1 on a valid token) */
DWORD samplers[max(MAX_FRAGMENT_SAMPLERS, MAX_VERTEX_SAMPLERS)];
char bumpmat, luminanceparams;
char usesnrm, vpos;
char usesnrm, vpos, usesdsy;
/* Whether or not loops are used in this shader, and nesting depth */
unsigned loop_depth;
......
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