Commit 683e5bfc authored by Jason Green's avatar Jason Green Committed by Alexandre Julliard

wined3d: Move PARAM C[] program.env[] into baseshader and out of vertex shaders.

parent 6e7d06ad
......@@ -523,6 +523,11 @@ void generate_arb_declarations(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer)
if (This->baseShader.textures_used & (1 << i))
shader_addline(buffer, "MOV T%lu, fragment.texcoord[%lu];\n", i, i);
}
/* Need to PARAM the environment parameters (constants) so we can use relative addressing */
shader_addline(buffer, "PARAM C[%d] = { program.env[0..%d] };\n",
This->baseShader.limits.constant_float,
This->baseShader.limits.constant_float - 1);
}
/** Generate the variable & register declarations for the GLSL
......
......@@ -764,7 +764,7 @@ inline static void get_register_name(const DWORD param, char* regstr, char const
if (constants[reg])
sprintf(regstr, "C%lu", reg);
else
sprintf(regstr, "program.env[%lu]", reg);
sprintf(regstr, "C[%lu]", reg);
break;
case D3DSPR_TEXTURE: /* case D3DSPR_ADDR: */
sprintf(regstr,"T%lu", reg);
......
......@@ -1073,10 +1073,6 @@ inline static VOID IWineD3DVertexShaderImpl_GenerateShader(
This->baseShader.limits.constant_float =
min(95, This->baseShader.limits.constant_float);
shader_addline(&buffer, "PARAM C[%d] = { program.env[0..%d] };\n",
This->baseShader.limits.constant_float,
This->baseShader.limits.constant_float - 1);
/** Call the base shader generation routine to generate most
of the vertex shader string for us */
generate_base_shader( (IWineD3DBaseShader*) This, &buffer, pFunction);
......
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