st/mesa: implement GL_ATI_fragment_shader
v2: fix arithmetic for special opcodes, fix fog state, cleanup v3: simplify handling of special opcodes, fix rebinding with different textargets or fog equation, lots of formatting fixes v4: adapt to the compile early, fix later architecture, formatting fixes Signed-off-by: Miklós Máté <mtmkls@gmail.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
@@ -64,6 +64,21 @@ void st_upload_constants( struct st_context *st,
|
||||
shader_type == PIPE_SHADER_TESS_EVAL ||
|
||||
shader_type == PIPE_SHADER_COMPUTE);
|
||||
|
||||
/* update the ATI constants before rendering */
|
||||
struct ati_fragment_shader *ati_fs = st->fp->ati_fs;
|
||||
if (shader_type == PIPE_SHADER_FRAGMENT && ati_fs) {
|
||||
unsigned c;
|
||||
|
||||
for (c = 0; c < MAX_NUM_FRAGMENT_CONSTANTS_ATI; c++) {
|
||||
if (ati_fs->LocalConstDef & (1 << c))
|
||||
memcpy(params->ParameterValues[c],
|
||||
ati_fs->Constants[c], sizeof(GLfloat) * 4);
|
||||
else
|
||||
memcpy(params->ParameterValues[c],
|
||||
st->ctx->ATIFragmentShader.GlobalConstants[c], sizeof(GLfloat) * 4);
|
||||
}
|
||||
}
|
||||
|
||||
/* update constants */
|
||||
if (params && params->NumParameters) {
|
||||
struct pipe_constant_buffer cb;
|
||||
|
Reference in New Issue
Block a user