Commit 8068fc3b authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

wined3d: Clamp texcoord output between 0 and 1.

parent e9de563e
......@@ -640,7 +640,7 @@ void pshader_hw_texcoord(SHADER_OPCODE_ARG* arg) {
pshader_get_write_mask(dst, tmp);
if (hex_version != D3DPS_VERSION(1,4)) {
DWORD reg = dst & D3DSP_REGNUM_MASK;
shader_addline(buffer, "MOV T%lu%s, fragment.texcoord[%lu];\n", reg, tmp, reg);
shader_addline(buffer, "MOV_SAT T%lu%s, fragment.texcoord[%lu];\n", reg, tmp, reg);
} else {
DWORD reg1 = dst & D3DSP_REGNUM_MASK;
DWORD reg2 = src[0] & D3DSP_REGNUM_MASK;
......
......@@ -1245,7 +1245,7 @@ void pshader_glsl_texcoord(SHADER_OPCODE_ARG* arg) {
if (hex_version != D3DPS_VERSION(1,4)) {
DWORD reg = arg->dst & D3DSP_REGNUM_MASK;
shader_addline(buffer, "%s = gl_TexCoord[%lu];\n", tmpReg, reg);
shader_addline(buffer, "%s = clamp(gl_TexCoord[%lu], 0.0, 1.0);\n", tmpReg, reg);
} else {
DWORD reg2 = arg->src[0] & D3DSP_REGNUM_MASK;
shader_addline(buffer, "%s = gl_TexCoord[%lu]%s;\n", tmpStr, reg2, tmpMask);
......
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