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

This commit is contained in:
Jason Green 2006-05-18 13:42:37 -04:00 committed by Alexandre Julliard
parent 6e7d06ad34
commit 683e5bfc55
3 changed files with 6 additions and 5 deletions

View File

@ -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

View File

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

View File

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