diff options
author | Aapo Tahkola <[email protected]> | 2005-12-06 22:26:21 +0000 |
---|---|---|
committer | Aapo Tahkola <[email protected]> | 2005-12-06 22:26:21 +0000 |
commit | abccd5b729209086e77b2b2f53fb2cdfdcf75a8e (patch) | |
tree | 300e5e215badd327fefe218506f0faa9665307bf /src | |
parent | 9309ba78d176f58ef9c15b3ce11311b8ca69f164 (diff) |
Make missing interpolator inputs fatal
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_state.c | 43 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_vertexprog.c | 1 |
2 files changed, 38 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index f4d588af526..0987735b505 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1152,10 +1152,9 @@ void r300_setup_rs_unit(GLcontext *ctx) if (OutputsWritten & (hw_tcl_on ? (1 << (VERT_RESULT_TEX0+i)) : (_TNL_BIT_TEX0<<i))) { vp_reg++; } else { - /* Unsure of how to handle this situation, for now print errors and - * the program will just recieve bogus data - */ + /* Passing invalid data here can lock the GPU. */ fprintf(stderr, "fragprog wants coords for tex%d, vp doesn't provide them!\n", i); + exit(-1); } InputsRead &= ~(FRAG_BIT_TEX0<<i); fp_reg++; @@ -1163,8 +1162,10 @@ void r300_setup_rs_unit(GLcontext *ctx) } if (InputsRead & FRAG_BIT_COL0) { - if (!(OutputsWritten & (hw_tcl_on ? (1<<VERT_RESULT_COL0) : _TNL_BIT_COLOR0))) + if (!(OutputsWritten & (hw_tcl_on ? (1<<VERT_RESULT_COL0) : _TNL_BIT_COLOR0))) { fprintf(stderr, "fragprog wants col0, vp doesn't provide it\n"); + exit(-1); + } r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0 | R300_RS_ROUTE_0_COLOR @@ -1174,8 +1175,10 @@ void r300_setup_rs_unit(GLcontext *ctx) } if (InputsRead & FRAG_BIT_COL1) { - if (!(OutputsWritten & (hw_tcl_on ? (1<<VERT_RESULT_COL1) : _TNL_BIT_COLOR1))) + if (!(OutputsWritten & (hw_tcl_on ? (1<<VERT_RESULT_COL1) : _TNL_BIT_COLOR1))) { fprintf(stderr, "fragprog wants col1, vp doesn't provide it\n"); + exit(-1); + } r300->hw.rr.cmd[R300_RR_ROUTE_1] |= R300_RS_ROUTE_1_UNKNOWN11 | R300_RS_ROUTE_1_COLOR1 @@ -1576,6 +1579,36 @@ void r300UpdateShaderStates(r300ContextPtr rmesa) #ifdef CB_DPATH r300UpdateTextureState(ctx); #endif + +#if 0 +#define B_FLAG(x) ((x)?1:0) + + if(hw_tcl_on){ + int i; + GLuint InputsRead; + GLuint OutputsWritten; + + InputsRead = ctx->FragmentProgram._Current->Base.InputsRead; + OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->Base.OutputsWritten; + + for (i=0;i<ctx->Const.MaxTextureUnits;i++) { + /*if(B_FLAG(OutputsWritten & (1 << (VERT_RESULT_TEX0+i))) != B_FLAG(InputsRead & (FRAG_BIT_TEX0<<i))){ + fprintf(stderr, "vp_out != fp_in fails for unit %d\n", i); + exit(1); + }*/ + /* + if(B_FLAG(ctx->Texture.Unit[i]._ReallyEnabled) != B_FLAG(InputsRead & (FRAG_BIT_TEX0<<i))){ + fprintf(stderr, "re != fp_in fails for unit %d\n", i); + exit(1); + } + + if(B_FLAG(ctx->Texture.Unit[i]._ReallyEnabled) != B_FLAG(OutputsWritten & (1 << (VERT_RESULT_TEX0+i)))){ + fprintf(stderr, "re != vp_out fails for unit %d\n", i); + exit(1); + }*/ + } + } +#endif r300_setup_textures(ctx); r300_setup_rs_unit(ctx); diff --git a/src/mesa/drivers/dri/r300/r300_vertexprog.c b/src/mesa/drivers/dri/r300/r300_vertexprog.c index c7a0c105266..b2444411294 100644 --- a/src/mesa/drivers/dri/r300/r300_vertexprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertexprog.c @@ -463,7 +463,6 @@ void translate_vertex_shader(struct r300_vertex_program *vp) vp->outputs[i] = -1; assert(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS)); - assert(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_COL0)); /* Assign outputs */ if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS)) |