Fix problem in mapping vertex program outputs (found with "spring" game engine)
If the vertex program writes to an output that's not consumed by the fragment program, map the vp output to an unused slot.
This commit is contained in:
@@ -226,9 +226,11 @@ find_translated_vp(struct st_context *st,
|
|||||||
GLint fpInAttrib = vp_out_to_fp_in(outAttr);
|
GLint fpInAttrib = vp_out_to_fp_in(outAttr);
|
||||||
if (fpInAttrib >= 0) {
|
if (fpInAttrib >= 0) {
|
||||||
GLuint fpInSlot = stfp->input_to_slot[fpInAttrib];
|
GLuint fpInSlot = stfp->input_to_slot[fpInAttrib];
|
||||||
GLuint vpOutSlot = stfp->fs->state.input_map[fpInSlot];
|
if (fpInSlot != ~0) {
|
||||||
xvp->output_to_slot[outAttr] = vpOutSlot;
|
GLuint vpOutSlot = stfp->fs->state.input_map[fpInSlot];
|
||||||
numVpOuts++;
|
xvp->output_to_slot[outAttr] = vpOutSlot;
|
||||||
|
numVpOuts++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (outAttr == VERT_RESULT_PSIZ ||
|
else if (outAttr == VERT_RESULT_PSIZ ||
|
||||||
outAttr == VERT_RESULT_BFC0 ||
|
outAttr == VERT_RESULT_BFC0 ||
|
||||||
@@ -247,7 +249,7 @@ find_translated_vp(struct st_context *st,
|
|||||||
* We could use this info to do dead code elimination in the
|
* We could use this info to do dead code elimination in the
|
||||||
* vertex program.
|
* vertex program.
|
||||||
*/
|
*/
|
||||||
dummySlot = stfp->num_input_slots;
|
dummySlot = numVpOuts;
|
||||||
|
|
||||||
/* Map vert program outputs that aren't used to the dummy slot */
|
/* Map vert program outputs that aren't used to the dummy slot */
|
||||||
for (outAttr = 0; outAttr < VERT_RESULT_MAX; outAttr++) {
|
for (outAttr = 0; outAttr < VERT_RESULT_MAX; outAttr++) {
|
||||||
|
Reference in New Issue
Block a user