uint input_semantic_name[PIPE_MAX_SHADER_INPUTS];
uint input_semantic_index[PIPE_MAX_SHADER_INPUTS];
+ uint output_semantic_name[PIPE_MAX_SHADER_OUTPUTS];
+ uint output_semantic_index[PIPE_MAX_SHADER_OUTPUTS];
+
/** points into the i915->current.constants array: */
float (*constants)[4];
uint num_constants;
{
switch (dest->DstRegister.File) {
case TGSI_FILE_OUTPUT:
- switch (dest->DstRegister.Index) {
- case 0: /**TGSI_ATTRIB_POS:**/
- return UREG(REG_TYPE_OD, 0);
- case 1: /**TGSI_ATTRIB_COLOR0:**/
- return UREG(REG_TYPE_OC, 0);
- default:
- i915_program_error(p, "Bad inst->DstReg.Index");
- return 0;
+ {
+ uint sem_name = p->output_semantic_name[dest->DstRegister.Index];
+ switch (sem_name) {
+ case TGSI_SEMANTIC_POSITION:
+ return UREG(REG_TYPE_OD, 0);
+ case TGSI_SEMANTIC_COLOR:
+ return UREG(REG_TYPE_OC, 0);
+ default:
+ i915_program_error(p, "Bad inst->DstReg.Index/semantics");
+ return 0;
+ }
}
case TGSI_FILE_TEMPORARY:
return UREG(REG_TYPE_R, dest->DstRegister.Index);
p->input_semantic_name[ind] = sem;
p->input_semantic_index[ind] = semi;
}
+ else if (parse.FullToken.FullDeclaration.Declaration.File
+ == TGSI_FILE_OUTPUT) {
+ /* save output register info for use in get_result_vector() */
+ uint ind, sem, semi;
+ ind = parse.FullToken.FullDeclaration.u.DeclarationRange.First;
+ sem = parse.FullToken.FullDeclaration.Semantic.SemanticName;
+ semi = parse.FullToken.FullDeclaration.Semantic.SemanticIndex;
+ /*printf("FS Output DECL [%u] sem %u\n", ind, sem);*/
+ p->output_semantic_name[ind] = sem;
+ p->output_semantic_index[ind] = semi;
+ }
break;
case TGSI_TOKEN_TYPE_IMMEDIATE: