GLuint usage_mask,
GLboolean semantic_info,
GLuint semantic_name,
- GLbitfield semantic_index )
+ GLbitfield semantic_index,
+ GLbitfield input_flags)
{
struct tgsi_full_declaration decl;
if (interpolate_info) {
decl.Declaration.Interpolate = interpolate;
}
+ if (input_flags & PROG_PARAM_BIT_CENTROID)
+ decl.Declaration.Centroid = 1;
+ if (input_flags & PROG_PARAM_BIT_INVARIANT)
+ decl.Declaration.Invariant = 1;
return decl;
}
GLuint index,
GLuint semantic_name,
GLuint semantic_index,
- GLbitfield usage_mask )
+ GLuint usage_mask,
+ GLbitfield output_flags)
{
struct tgsi_full_declaration decl;
decl.DeclarationRange.Last = index;
decl.Semantic.SemanticName = semantic_name;
decl.Semantic.SemanticIndex = semantic_index;
+ if (output_flags & PROG_PARAM_BIT_CENTROID)
+ decl.Declaration.Centroid = 1;
+ if (output_flags & PROG_PARAM_BIT_INVARIANT)
+ decl.Declaration.Invariant = 1;
return decl;
}
const ubyte inputSemanticName[],
const ubyte inputSemanticIndex[],
const GLuint interpMode[],
+ const GLbitfield inputFlags[],
GLuint numOutputs,
const GLuint outputMapping[],
const ubyte outputSemanticName[],
const ubyte outputSemanticIndex[],
+ const GLbitfield outputFlags[],
struct tgsi_token *tokens,
GLuint maxTokens )
{
GL_TRUE, interpMode[i],
TGSI_WRITEMASK_XYZW,
GL_TRUE, inputSemanticName[i],
- inputSemanticIndex[i]);
+ inputSemanticIndex[i],
+ inputFlags[i]);
ti += tgsi_build_full_declaration(&fulldecl,
&tokens[ti],
header,
fulldecl = make_input_decl(i,
GL_FALSE, 0,
TGSI_WRITEMASK_XYZW,
- GL_FALSE, 0, 0);
+ GL_FALSE, 0, 0,
+ inputFlags[i]);
ti += tgsi_build_full_declaration(&fulldecl,
&tokens[ti],
header,
fulldecl = make_output_decl(i,
TGSI_SEMANTIC_POSITION, /* Z / Depth */
outputSemanticIndex[i],
- TGSI_WRITEMASK_Z );
+ TGSI_WRITEMASK_Z,
+ outputFlags[i]);
break;
case TGSI_SEMANTIC_COLOR:
fulldecl = make_output_decl(i,
TGSI_SEMANTIC_COLOR,
outputSemanticIndex[i],
- TGSI_WRITEMASK_XYZW );
+ TGSI_WRITEMASK_XYZW,
+ outputFlags[i]);
break;
default:
assert(0);
fulldecl = make_output_decl(i,
outputSemanticName[i],
outputSemanticIndex[i],
- TGSI_WRITEMASK_XYZW );
+ TGSI_WRITEMASK_XYZW,
+ outputFlags[i]);
ti += tgsi_build_full_declaration(&fulldecl,
&tokens[ti],
header,
ubyte vs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS];
uint vs_num_outputs = 0;
+ GLbitfield input_flags[MAX_PROGRAM_INPUTS];
+ GLbitfield output_flags[MAX_PROGRAM_OUTPUTS];
+
memset(&vs, 0, sizeof(vs));
+ memset(input_flags, 0, sizeof(input_flags));
+ memset(output_flags, 0, sizeof(output_flags));
if (stvp->Base.IsPositionInvariant)
_mesa_insert_mvp_code(st->ctx, &stvp->Base);
default:
assert(0);
}
+
+ input_flags[slot] = stvp->Base.Base.InputFlags[attr];
}
}
for (i = 0; i < PIPE_MAX_SHADER_OUTPUTS; i++) {
vs_output_semantic_name[i] = TGSI_SEMANTIC_GENERIC;
vs_output_semantic_index[i] = 0;
+ output_flags[i] = 0x0;
}
num_generic = 0;
vs_output_semantic_index[slot] = num_generic++;
}
}
+
+ output_flags[slot] = stvp->Base.Base.OutputFlags[attr];
}
}
/* XXX: fix static allocation of tokens:
*/
- num_tokens = st_translate_mesa_program( TGSI_PROCESSOR_VERTEX,
- &stvp->Base.Base,
- /* inputs */
- vs_num_inputs,
- stvp->input_to_index,
- vs_input_semantic_name,
- vs_input_semantic_index,
- NULL,
- /* outputs */
- vs_num_outputs,
- outputMapping,
- vs_output_semantic_name,
- vs_output_semantic_index,
- /* tokenized result */
- tokens, ST_MAX_SHADER_TOKENS);
+ num_tokens = st_translate_mesa_program(TGSI_PROCESSOR_VERTEX,
+ &stvp->Base.Base,
+ /* inputs */
+ vs_num_inputs,
+ stvp->input_to_index,
+ vs_input_semantic_name,
+ vs_input_semantic_index,
+ NULL,
+ input_flags,
+ /* outputs */
+ vs_num_outputs,
+ outputMapping,
+ vs_output_semantic_name,
+ vs_output_semantic_index,
+ output_flags,
+ /* tokenized result */
+ tokens, ST_MAX_SHADER_TOKENS);
assert(num_tokens < ST_MAX_SHADER_TOKENS);
ubyte fs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS];
uint fs_num_outputs = 0;
+ GLbitfield input_flags[MAX_PROGRAM_INPUTS];
+ GLbitfield output_flags[MAX_PROGRAM_OUTPUTS];
+
memset(&fs, 0, sizeof(fs));
+ memset(input_flags, 0, sizeof(input_flags));
+ memset(output_flags, 0, sizeof(output_flags));
/* which vertex output goes to the first fragment input: */
if (inputsRead & FRAG_BIT_WPOS)
stfp->input_semantic_index[slot] = num_generic++;
interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
}
+
+ input_flags[slot] = stfp->Base.Base.InputFlags[attr];
}
}
default:
assert(0);
}
+
+ output_flags[fs_num_outputs] = stfp->Base.Base.OutputFlags[attr];
+
fs_num_outputs++;
}
}
/* XXX: fix static allocation of tokens:
*/
- num_tokens = st_translate_mesa_program( TGSI_PROCESSOR_FRAGMENT,
- &stfp->Base.Base,
- /* inputs */
- fs_num_inputs,
- inputMapping,
- stfp->input_semantic_name,
- stfp->input_semantic_index,
- interpMode,
- /* outputs */
- fs_num_outputs,
- outputMapping,
- fs_output_semantic_name,
- fs_output_semantic_index,
- /* tokenized result */
- tokens, ST_MAX_SHADER_TOKENS);
+ num_tokens = st_translate_mesa_program(TGSI_PROCESSOR_FRAGMENT,
+ &stfp->Base.Base,
+ /* inputs */
+ fs_num_inputs,
+ inputMapping,
+ stfp->input_semantic_name,
+ stfp->input_semantic_index,
+ interpMode,
+ input_flags,
+ /* outputs */
+ fs_num_outputs,
+ outputMapping,
+ fs_output_semantic_name,
+ fs_output_semantic_index,
+ output_flags,
+ /* tokenized result */
+ tokens, ST_MAX_SHADER_TOKENS);
assert(num_tokens < ST_MAX_SHADER_TOKENS);