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.
This commit is contained in:
Jason Green 2006-06-19 17:53:13 -04:00 committed by Alexandre Julliard
parent ce24c2a8a7
commit 99c855e6ae
1 changed files with 2 additions and 2 deletions

View File

@ -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]);