* We also use a texture coordinate to pass wpos when possible.
*/
- sem_name = p->input_semantic_name[index];
- sem_ind = p->input_semantic_index[index];
+ sem_name = p->shader->info.input_semantic_name[index];
+ sem_ind = p->shader->info.input_semantic_index[index];
switch (sem_name) {
case TGSI_SEMANTIC_POSITION:
switch (dest->DstRegister.File) {
case TGSI_FILE_OUTPUT:
{
- uint sem_name = p->output_semantic_name[dest->DstRegister.Index];
+ uint sem_name = p->shader->info.output_semantic_name[dest->DstRegister.Index];
switch (sem_name) {
case TGSI_SEMANTIC_POSITION:
return UREG(REG_TYPE_OD, 0);
switch( parse.FullToken.Token.Type ) {
case TGSI_TOKEN_TYPE_DECLARATION:
if (parse.FullToken.FullDeclaration.Declaration.File
- == TGSI_FILE_INPUT) {
- /* save input register info for use in src_vector() */
- uint ind, sem, semi;
- ind = parse.FullToken.FullDeclaration.u.DeclarationRange.First;
- sem = parse.FullToken.FullDeclaration.Semantic.SemanticName;
- semi = parse.FullToken.FullDeclaration.Semantic.SemanticIndex;
- /*debug_printf("FS Input DECL [%u] sem %u\n", ind, sem);*/
- 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;
- /*debug_printf("FS Output DECL [%u] sem %u\n", ind, sem);*/
- p->output_semantic_name[ind] = sem;
- p->output_semantic_index[ind] = semi;
- }
- else if (parse.FullToken.FullDeclaration.Declaration.File
== TGSI_FILE_CONSTANT) {
uint i;
for (i = parse.FullToken.FullDeclaration.u.DeclarationRange.First;
i <= parse.FullToken.FullDeclaration.u.DeclarationRange.Last;
i++) {
assert(i < I915_MAX_TEMPORARY);
+ /* XXX just use shader->info->file_mask[TGSI_FILE_TEMPORARY] */
p->temp_flag |= (1 << i); /* mark temp as used */
}
}
i915_program_error(p, "No free texcoord for wpos value");
}
#else
- if (p->shader->state.input_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
+ if (p->shader->info.input_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
/* frag shader using the fragment position input */
#if 0
assert(0);
i915_fixup_depth_write(struct i915_fp_compile *p)
{
/* XXX assuming pos/depth is always in output[0] */
- if (p->shader->state.output_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
+ if (p->shader->info.output_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
const uint depth = UREG(REG_TYPE_OD, 0);
i915_emit_arith(p,
*/
static void calculate_vertex_layout( struct i915_context *i915 )
{
- const struct pipe_shader_state *fs = &i915->fs->state;
+ const struct i915_fragment_shader *fs = i915->fs;
const enum interp_mode colorInterp = i915->rasterizer->color_interp;
struct vertex_info vinfo;
boolean texCoords[8], colors[2], fog, needW;
/* Determine which fragment program inputs are needed. Setup HW vertex
* layout below, in the HW-specific attribute order.
*/
- for (i = 0; i < fs->num_inputs; i++) {
- switch (fs->input_semantic_name[i]) {
+ for (i = 0; i < fs->info.num_inputs; i++) {
+ switch (fs->info.input_semantic_name[i]) {
case TGSI_SEMANTIC_POSITION:
break;
case TGSI_SEMANTIC_COLOR:
- assert(fs->input_semantic_index[i] < 2);
- colors[fs->input_semantic_index[i]] = TRUE;
+ assert(fs->info.input_semantic_index[i] < 2);
+ colors[fs->info.input_semantic_index[i]] = TRUE;
break;
case TGSI_SEMANTIC_GENERIC:
/* usually a texcoord */
{
- const uint unit = fs->input_semantic_index[i];
+ const uint unit = fs->info.input_semantic_index[i];
assert(unit < 8);
texCoords[unit] = TRUE;
needW = TRUE;