|
|
|
@@ -438,32 +438,42 @@ static void r300TranslateVertexShader(struct r300_vertex_program *vp, |
|
|
|
assert(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS)); |
|
|
|
|
|
|
|
/* Assign outputs */ |
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS)) |
|
|
|
vp->outputs[VERT_RESULT_HPOS] = cur_reg++; |
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS)) { |
|
|
|
vp->outputs[VERT_RESULT_HPOS] = cur_reg; |
|
|
|
cur_reg = 1; |
|
|
|
} |
|
|
|
|
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_PSIZ)) |
|
|
|
vp->outputs[VERT_RESULT_PSIZ] = cur_reg++; |
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_COL0)) { |
|
|
|
vp->outputs[VERT_RESULT_COL0] = 1; |
|
|
|
cur_reg = 2; |
|
|
|
} |
|
|
|
|
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_COL0)) |
|
|
|
vp->outputs[VERT_RESULT_COL0] = cur_reg++; |
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_COL1)) { |
|
|
|
vp->outputs[VERT_RESULT_COL1] = 2; |
|
|
|
cur_reg = 3; |
|
|
|
} |
|
|
|
|
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_COL1)) |
|
|
|
vp->outputs[VERT_RESULT_COL1] = cur_reg++; |
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_BFC0)) { |
|
|
|
vp->outputs[VERT_RESULT_BFC0] = 3; |
|
|
|
cur_reg = 5; |
|
|
|
} |
|
|
|
|
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_BFC1)) { |
|
|
|
vp->outputs[VERT_RESULT_BFC1] = 4; |
|
|
|
cur_reg = 5; |
|
|
|
} |
|
|
|
#if 0 /* Not supported yet */ |
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_BFC0)) |
|
|
|
vp->outputs[VERT_RESULT_BFC0] = cur_reg++; |
|
|
|
|
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_BFC1)) |
|
|
|
vp->outputs[VERT_RESULT_BFC1] = cur_reg++; |
|
|
|
|
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_FOGC)) |
|
|
|
vp->outputs[VERT_RESULT_FOGC] = cur_reg++; |
|
|
|
#endif |
|
|
|
|
|
|
|
if (vp->key.OutputsWritten & (1 << VERT_RESULT_PSIZ)) |
|
|
|
vp->outputs[VERT_RESULT_PSIZ] = cur_reg++; |
|
|
|
|
|
|
|
for (i = VERT_RESULT_TEX0; i <= VERT_RESULT_TEX7; i++) |
|
|
|
if (vp->key.OutputsWritten & (1 << i)) |
|
|
|
if (vp->key.OutputsWritten & (1 << i)) { |
|
|
|
vp->outputs[i] = cur_reg++; |
|
|
|
} |
|
|
|
|
|
|
|
vp->translated = GL_TRUE; |
|
|
|
vp->native = GL_TRUE; |
|
|
|
@@ -1255,8 +1265,6 @@ void r300SelectVertexShader(r300ContextPtr r300) |
|
|
|
vpc = (struct r300_vertex_program_cont *)ctx->VertexProgram._Current; |
|
|
|
InputsRead = ctx->FragmentProgram._Current->Base.InputsRead; |
|
|
|
|
|
|
|
wanted_key.OutputsWritten |= 1 << VERT_RESULT_HPOS; |
|
|
|
|
|
|
|
wpos_idx = -1; |
|
|
|
if (InputsRead & FRAG_BIT_WPOS) { |
|
|
|
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) |
|
|
|
@@ -1271,20 +1279,8 @@ void r300SelectVertexShader(r300ContextPtr r300) |
|
|
|
InputsRead |= (FRAG_BIT_TEX0 << i); |
|
|
|
wpos_idx = i; |
|
|
|
} |
|
|
|
|
|
|
|
if (InputsRead & FRAG_BIT_COL0) |
|
|
|
wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL0; |
|
|
|
|
|
|
|
if ((InputsRead & FRAG_BIT_COL1) /*|| |
|
|
|
(InputsRead & FRAG_BIT_FOGC) */ ) |
|
|
|
wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL1; |
|
|
|
|
|
|
|
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) |
|
|
|
if (InputsRead & (FRAG_BIT_TEX0 << i)) |
|
|
|
wanted_key.OutputsWritten |= |
|
|
|
1 << (VERT_RESULT_TEX0 + i); |
|
|
|
|
|
|
|
wanted_key.InputsRead = vpc->mesa_program.Base.InputsRead; |
|
|
|
wanted_key.OutputsWritten = vpc->mesa_program.Base.OutputsWritten; |
|
|
|
if (vpc->mesa_program.IsPositionInvariant) { |
|
|
|
/* we wan't position don't we ? */ |
|
|
|
wanted_key.InputsRead |= (1 << VERT_ATTRIB_POS); |