summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/tgsi
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-10-09 14:55:22 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-10-09 14:55:22 -0600
commitbc139a19b00f8686caa8db7c56af2087f26e369a (patch)
tree4e598ff84144599ad115ed9abdaf8b21cc2f33b0 /src/mesa/pipe/tgsi
parent342bc50c3d8765ea4ab50aa7d77df5c86c478c61 (diff)
Pack fragment program outputs to be consistant with vertex programs.
Previously, output[0] was always Z and output[1] was color. Now output[0] will be color if Z is not written. In shade_quad() use the semantic info to determine which quantity is in which output slot.
Diffstat (limited to 'src/mesa/pipe/tgsi')
-rw-r--r--src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c b/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c
index 88de85994a..5a1ec3553e 100644
--- a/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c
+++ b/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c
@@ -46,47 +46,22 @@ map_register_file(
*/
static GLuint
map_register_file_index(
- GLuint processor,
GLuint file,
GLuint index,
const GLuint inputMapping[],
const GLuint outputMapping[])
{
- GLuint mapped_index;
-
- assert(processor == TGSI_PROCESSOR_FRAGMENT
- || processor == TGSI_PROCESSOR_VERTEX);
-
switch( file ) {
case TGSI_FILE_INPUT:
/* inputs are mapped according to the user-defined map */
return inputMapping[index];
case TGSI_FILE_OUTPUT:
- if( processor == TGSI_PROCESSOR_FRAGMENT ) {
- /* fragment program outputs are hard-coded:
- * depth result -> index 0
- * color results -> index 1, 2, ...
- */
- if( index == FRAG_RESULT_DEPR ) {
- mapped_index = 0; /**TGSI_ATTRIB_POS;**/
- }
- else {
- assert( index == FRAG_RESULT_COLR );
- mapped_index = 1; /**TGSI_ATTRIB_COLOR0;**/
- }
- }
- else {
- /* vertex outputs are mapped according to the user-defined map */
- mapped_index = outputMapping[index];
- }
- break;
+ return outputMapping[index];
default:
- mapped_index = index;
+ return index;
}
-
- return mapped_index;
}
/*
@@ -166,7 +141,6 @@ compile_instruction(
fulldst = &fullinst->FullDstRegisters[0];
fulldst->DstRegister.File = map_register_file( inst->DstReg.File );
fulldst->DstRegister.Index = map_register_file_index(
- processor,
fulldst->DstRegister.File,
inst->DstReg.Index,
inputMapping,
@@ -180,7 +154,6 @@ compile_instruction(
fullsrc = &fullinst->FullSrcRegisters[i];
fullsrc->SrcRegister.File = map_register_file( inst->SrcReg[i].File );
fullsrc->SrcRegister.Index = map_register_file_index(
- processor,
fullsrc->SrcRegister.File,
inst->SrcReg[i].Index,
inputMapping,