Commit 99c855e6 authored by Jason Green's avatar Jason Green Committed by Alexandre Julliard

wined3d: Fix DEF instructions in GLSL for non-Nvidia platforms.

- NVidia allows "const vec4 = {1.0, 2.0, 3.0, 4.0};", even though that's not part of the spec. - It should be "const vec4 = vecr4(1.0, 2.0, 3.0, 4.0);" - This patch fixes this for D3DSIO_DEF and D3DSIO_DEFI.
parent ce24c2a8
......@@ -1061,7 +1061,7 @@ void shader_glsl_def(SHADER_OPCODE_ARG* arg) {
const char* prefix = pshader? "PC":"VC";
shader_addline(arg->buffer,
"const vec4 %s%lu = { %f, %f, %f, %f };\n", prefix, reg,
"const vec4 %s%lu = vec4(%f, %f, %f, %f);\n", prefix, reg,
*((const float *)(arg->src + 0)),
*((const float *)(arg->src + 1)),
*((const float *)(arg->src + 2)),
......@@ -1077,7 +1077,7 @@ void shader_glsl_defi(SHADER_OPCODE_ARG* arg) {
DWORD reg = arg->dst & D3DSP_REGNUM_MASK;
shader_addline(arg->buffer,
"const ivec4 I%lu = { %ld, %ld, %ld, %ld };\n", reg,
"const ivec4 I%lu = ivec4(%ld, %ld, %ld, %ld);\n", reg,
(long)arg->src[0], (long)arg->src[1],
(long)arg->src[2], (long)arg->src[3]);
......
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