diff options
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_atom_pixeltransfer.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_atom_rasterizer.c | 6 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_bitmap.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_drawpixels.c | 10 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_drawtex.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_fbo.c | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_feedback.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_rasterpos.c | 6 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_context.h | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 40 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_manager.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c | 26 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_program.c | 160 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_program.h | 16 |
14 files changed, 144 insertions, 141 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_pixeltransfer.c b/mesalib/src/mesa/state_tracker/st_atom_pixeltransfer.c index b612f7846..7e3997ef2 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/mesalib/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -161,11 +161,11 @@ get_pixel_transfer_program(struct gl_context *ctx, const struct state_key *key) inst[ic].DstReg.File = PROGRAM_TEMPORARY; inst[ic].DstReg.Index = colorTemp; inst[ic].SrcReg[0].File = PROGRAM_INPUT; - inst[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; + inst[ic].SrcReg[0].Index = VARYING_SLOT_TEX0; inst[ic].TexSrcUnit = 0; inst[ic].TexSrcTarget = TEXTURE_2D_INDEX; ic++; - fp->Base.InputsRead = BITFIELD64_BIT(FRAG_ATTRIB_TEX0); + fp->Base.InputsRead = BITFIELD64_BIT(VARYING_SLOT_TEX0); fp->Base.OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR); fp->Base.SamplersUsed = 0x1; /* sampler 0 (bit 0) is used */ diff --git a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c index 0e2a152cd..866e5627d 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c @@ -171,9 +171,9 @@ static void update_raster_state( struct st_context *st ) raster->sprite_coord_enable |= 1 << i; } } - if (fragProg->Base.InputsRead & FRAG_BIT_PNTC) { + if (fragProg->Base.InputsRead & VARYING_BIT_PNTC) { raster->sprite_coord_enable |= - 1 << (FRAG_ATTRIB_PNTC - FRAG_ATTRIB_TEX0); + 1 << (VARYING_SLOT_PNTC - VARYING_SLOT_TEX0); } raster->point_quad_rasterization = 1; @@ -183,7 +183,7 @@ static void update_raster_state( struct st_context *st ) */ if (vertProg) { if (vertProg->Base.Id == 0) { - if (vertProg->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_PSIZ)) { + if (vertProg->Base.OutputsWritten & BITFIELD64_BIT(VARYING_SLOT_PSIZ)) { /* generated program which emits point size */ raster->point_size_per_vertex = TRUE; } diff --git a/mesalib/src/mesa/state_tracker/st_cb_bitmap.c b/mesalib/src/mesa/state_tracker/st_cb_bitmap.c index 36fffe90d..bae9ff858 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_bitmap.c +++ b/mesalib/src/mesa/state_tracker/st_cb_bitmap.c @@ -139,7 +139,7 @@ make_bitmap_fragment_program(struct gl_context *ctx, GLuint samplerIndex) p->Instructions[ic].DstReg.File = PROGRAM_TEMPORARY; p->Instructions[ic].DstReg.Index = 0; p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; - p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; + p->Instructions[ic].SrcReg[0].Index = VARYING_SLOT_TEX0; p->Instructions[ic].TexSrcUnit = samplerIndex; p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX; ic++; @@ -160,7 +160,7 @@ make_bitmap_fragment_program(struct gl_context *ctx, GLuint samplerIndex) assert(ic == p->NumInstructions); - p->InputsRead = FRAG_BIT_TEX0; + p->InputsRead = VARYING_BIT_TEX0; p->OutputsWritten = 0x0; p->SamplersUsed = (1 << samplerIndex); diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c index e282bf98d..f0baa3435 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c @@ -87,7 +87,7 @@ is_passthrough_program(const struct gl_fragment_program *prog) inst[0].DstReg.Index == FRAG_RESULT_COLOR && inst[0].DstReg.WriteMask == WRITEMASK_XYZW && inst[0].SrcReg[0].File == PROGRAM_INPUT && - inst[0].SrcReg[0].Index == FRAG_ATTRIB_COL0 && + inst[0].SrcReg[0].Index == VARYING_SLOT_COL0 && inst[0].SrcReg[0].Swizzle == SWIZZLE_XYZW) { return GL_TRUE; } @@ -233,7 +233,7 @@ st_make_drawpix_z_stencil_program(struct st_context *st, p->Instructions[ic].DstReg.Index = FRAG_RESULT_DEPTH; p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Z; p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; - p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; + p->Instructions[ic].SrcReg[0].Index = VARYING_SLOT_TEX0; p->Instructions[ic].TexSrcUnit = 0; p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX; ic++; @@ -242,7 +242,7 @@ st_make_drawpix_z_stencil_program(struct st_context *st, p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT; p->Instructions[ic].DstReg.Index = FRAG_RESULT_COLOR; p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; - p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_COL0; + p->Instructions[ic].SrcReg[0].Index = VARYING_SLOT_COL0; ic++; } @@ -253,7 +253,7 @@ st_make_drawpix_z_stencil_program(struct st_context *st, p->Instructions[ic].DstReg.Index = FRAG_RESULT_STENCIL; p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Y; p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; - p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; + p->Instructions[ic].SrcReg[0].Index = VARYING_SLOT_TEX0; p->Instructions[ic].TexSrcUnit = 1; p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX; ic++; @@ -264,7 +264,7 @@ st_make_drawpix_z_stencil_program(struct st_context *st, assert(ic == p->NumInstructions); - p->InputsRead = FRAG_BIT_TEX0 | FRAG_BIT_COL0; + p->InputsRead = VARYING_BIT_TEX0 | VARYING_BIT_COL0; p->OutputsWritten = 0; if (write_depth) { p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_DEPTH); diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawtex.c b/mesalib/src/mesa/state_tracker/st_cb_drawtex.c index 5ca097004..a8806c91e 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawtex.c +++ b/mesalib/src/mesa/state_tracker/st_cb_drawtex.c @@ -116,7 +116,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, st_validate_state(st); /* determine if we need vertex color */ - if (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL0) + if (ctx->FragmentProgram._Current->Base.InputsRead & VARYING_BIT_COL0) emitColor = GL_TRUE; else emitColor = GL_FALSE; diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.c b/mesalib/src/mesa/state_tracker/st_cb_fbo.c index 72bc960b0..87c5b048c 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_fbo.c +++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.c @@ -330,6 +330,9 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) /* accum buffer */ strb->Base.InternalFormat = GL_RGBA16_SNORM; break; + case PIPE_FORMAT_R16G16B16A16_UNORM: + strb->Base.InternalFormat = GL_RGBA16; + break; case PIPE_FORMAT_R8_UNORM: strb->Base.InternalFormat = GL_R8; break; diff --git a/mesalib/src/mesa/state_tracker/st_cb_feedback.c b/mesalib/src/mesa/state_tracker/st_cb_feedback.c index 9092e3a71..7a8fde465 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_feedback.c +++ b/mesalib/src/mesa/state_tracker/st_cb_feedback.c @@ -97,13 +97,13 @@ feedback_vertex(struct gl_context *ctx, const struct draw_context *draw, * color and texcoord attribs to use here. */ - slot = st->vertex_result_to_slot[VERT_RESULT_COL0]; + slot = st->vertex_result_to_slot[VARYING_SLOT_COL0]; if (slot != ~0U) color = v->data[slot]; else color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; - slot = st->vertex_result_to_slot[VERT_RESULT_TEX0]; + slot = st->vertex_result_to_slot[VARYING_SLOT_TEX0]; if (slot != ~0U) texcoord = v->data[slot]; else diff --git a/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c b/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c index fb4a62ee3..4731f2648 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c @@ -154,16 +154,16 @@ rastpos_point(struct draw_stage *stage, struct prim_header *prim) /* update other raster attribs */ update_attrib(ctx, outputMapping, prim->v[0], ctx->Current.RasterColor, - VERT_RESULT_COL0, VERT_ATTRIB_COLOR0); + VARYING_SLOT_COL0, VERT_ATTRIB_COLOR0); update_attrib(ctx, outputMapping, prim->v[0], ctx->Current.RasterSecondaryColor, - VERT_RESULT_COL1, VERT_ATTRIB_COLOR1); + VARYING_SLOT_COL1, VERT_ATTRIB_COLOR1); for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { update_attrib(ctx, outputMapping, prim->v[0], ctx->Current.RasterTexCoords[i], - VERT_RESULT_TEX0 + i, VERT_ATTRIB_TEX0 + i); + VARYING_SLOT_TEX0 + i, VERT_ATTRIB_TEX0 + i); } if (ctx->RenderMode == GL_SELECT) { diff --git a/mesalib/src/mesa/state_tracker/st_context.h b/mesalib/src/mesa/state_tracker/st_context.h index a7b6cb535..b9a98cd05 100644 --- a/mesalib/src/mesa/state_tracker/st_context.h +++ b/mesalib/src/mesa/state_tracker/st_context.h @@ -126,7 +126,7 @@ struct st_context GLboolean missing_textures; GLboolean vertdata_edgeflags; - /** Mapping from VERT_RESULT_x to post-transformed vertex slot */ + /** Mapping from VARYING_SLOT_x to post-transformed vertex slot */ const GLuint *vertex_result_to_slot; struct st_vertex_program *vp; /**< Currently bound vertex program */ diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 131ecb22a..0cef092d3 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -148,7 +148,7 @@ public: explicit st_src_reg(st_dst_reg reg); gl_register_file file; /**< PROGRAM_* from Mesa */ - int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */ + int index; /**< temporary index, VERT_ATTRIB_*, VARYING_SLOT_*, etc. */ int index2D; GLuint swizzle; /**< SWIZZLE_XYZWONEZERO swizzles from Mesa. */ int negate; /**< NEGATE_XYZW mask from mesa */ @@ -182,7 +182,7 @@ public: explicit st_dst_reg(st_src_reg reg); gl_register_file file; /**< PROGRAM_* from Mesa */ - int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */ + int index; /**< temporary index, VERT_ATTRIB_*, VARYING_SLOT_*, etc. */ int writemask; /**< Bitfield of WRITEMASK_[XYZW] */ GLuint cond_mask:4; int type; /** GLSL_TYPE_* from GLSL IR (enum glsl_base_type) */ @@ -3830,14 +3830,14 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp, * Get initial pixel color from the texture. * TEX colorTemp, fragment.texcoord[0], texture[0], 2D; */ - coord = st_src_reg(PROGRAM_INPUT, FRAG_ATTRIB_TEX0, glsl_type::vec2_type); + coord = st_src_reg(PROGRAM_INPUT, VARYING_SLOT_TEX0, glsl_type::vec2_type); src0 = v->get_temp(glsl_type::vec4_type); dst0 = st_dst_reg(src0); inst = v->emit(NULL, TGSI_OPCODE_TEX, dst0, coord); inst->sampler = 0; inst->tex_target = TEXTURE_2D_INDEX; - prog->InputsRead |= FRAG_BIT_TEX0; + prog->InputsRead |= VARYING_BIT_TEX0; prog->SamplersUsed |= (1 << 0); /* mark sampler 0 as used */ v->samplers_used |= (1 << 0); @@ -3903,7 +3903,7 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp, for (int i=0; i<3; i++) { src_regs[i] = inst->src[i]; if (src_regs[i].file == PROGRAM_INPUT && - src_regs[i].index == FRAG_ATTRIB_COL0) + src_regs[i].index == VARYING_SLOT_COL0) { src_regs[i].file = PROGRAM_TEMPORARY; src_regs[i].index = src0.index; @@ -3958,14 +3958,14 @@ get_bitmap_visitor(struct st_fragment_program *fp, v->num_immediates = original->num_immediates; /* TEX tmp0, fragment.texcoord[0], texture[0], 2D; */ - coord = st_src_reg(PROGRAM_INPUT, FRAG_ATTRIB_TEX0, glsl_type::vec2_type); + coord = st_src_reg(PROGRAM_INPUT, VARYING_SLOT_TEX0, glsl_type::vec2_type); src0 = v->get_temp(glsl_type::vec4_type); dst0 = st_dst_reg(src0); inst = v->emit(NULL, TGSI_OPCODE_TEX, dst0, coord); inst->sampler = samplerIndex; inst->tex_target = TEXTURE_2D_INDEX; - prog->InputsRead |= FRAG_BIT_TEX0; + prog->InputsRead |= VARYING_BIT_TEX0; prog->SamplersUsed |= (1 << samplerIndex); /* mark sampler as used */ v->samplers_used |= (1 << samplerIndex); @@ -4144,11 +4144,11 @@ dst_register(struct st_translate *t, case PROGRAM_OUTPUT: if (t->procType == TGSI_PROCESSOR_VERTEX) - assert(index < VERT_RESULT_MAX); + assert(index < VARYING_SLOT_MAX); else if (t->procType == TGSI_PROCESSOR_FRAGMENT) assert(index < FRAG_RESULT_MAX); else - assert(index < GEOM_RESULT_MAX); + assert(index < VARYING_SLOT_MAX); assert(t->outputMapping[index] < Elements(t->outputs)); @@ -4246,10 +4246,10 @@ translate_dst(struct st_translate *t, case TGSI_PROCESSOR_VERTEX: /* XXX if the geometry shader is present, this must be done there * instead of here. */ - if (dst_reg->index == VERT_RESULT_COL0 || - dst_reg->index == VERT_RESULT_COL1 || - dst_reg->index == VERT_RESULT_BFC0 || - dst_reg->index == VERT_RESULT_BFC1) { + if (dst_reg->index == VARYING_SLOT_COL0 || + dst_reg->index == VARYING_SLOT_COL1 || + dst_reg->index == VARYING_SLOT_BFC0 || + dst_reg->index == VARYING_SLOT_BFC1) { dst = ureg_saturate(dst); } break; @@ -4441,7 +4441,7 @@ emit_wpos_adjustment( struct st_translate *t, struct ureg_src wpostrans = ureg_DECL_constant( ureg, wposTransConst ); struct ureg_dst wpos_temp = ureg_DECL_temporary( ureg ); - struct ureg_src wpos_input = t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]]; + struct ureg_src wpos_input = t->inputs[t->inputMapping[VARYING_SLOT_POS]]; /* First, apply the coordinate shift: */ if (adjX || adjY[0] || adjY[1]) { @@ -4492,7 +4492,7 @@ emit_wpos_adjustment( struct st_translate *t, /* Use wpos_temp as position input from here on: */ - t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]] = ureg_src(wpos_temp); + t->inputs[t->inputMapping[VARYING_SLOT_POS]] = ureg_src(wpos_temp); } @@ -4610,21 +4610,21 @@ emit_face_var(struct st_translate *t) { struct ureg_program *ureg = t->ureg; struct ureg_dst face_temp = ureg_DECL_temporary(ureg); - struct ureg_src face_input = t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]]; + struct ureg_src face_input = t->inputs[t->inputMapping[VARYING_SLOT_FACE]]; /* MOV_SAT face_temp, input[face] */ face_temp = ureg_saturate(face_temp); ureg_MOV(ureg, face_temp, face_input); /* Use face_temp as face input from here on: */ - t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]] = ureg_src(face_temp); + t->inputs[t->inputMapping[VARYING_SLOT_FACE]] = ureg_src(face_temp); } static void emit_edgeflags(struct st_translate *t) { struct ureg_program *ureg = t->ureg; - struct ureg_dst edge_dst = t->outputs[t->outputMapping[VERT_RESULT_EDGE]]; + struct ureg_dst edge_dst = t->outputs[t->outputMapping[VARYING_SLOT_EDGE]]; struct ureg_src edge_src = t->inputs[t->inputMapping[VERT_ATTRIB_EDGEFLAG]]; ureg_MOV(ureg, edge_dst, edge_src); @@ -4710,14 +4710,14 @@ st_translate_program( is_centroid[i]); } - if (proginfo->InputsRead & FRAG_BIT_WPOS) { + if (proginfo->InputsRead & VARYING_BIT_POS) { /* Must do this after setting up t->inputs, and before * emitting constant references, below: */ emit_wpos(st_context(ctx), t, proginfo, ureg); } - if (proginfo->InputsRead & FRAG_BIT_FACE) + if (proginfo->InputsRead & VARYING_BIT_FACE) emit_face_var(t); /* diff --git a/mesalib/src/mesa/state_tracker/st_manager.c b/mesalib/src/mesa/state_tracker/st_manager.c index a3a67712a..0b025d9d5 100644 --- a/mesalib/src/mesa/state_tracker/st_manager.c +++ b/mesalib/src/mesa/state_tracker/st_manager.c @@ -883,7 +883,7 @@ st_manager_add_color_renderbuffer(struct st_context *st, } static const struct st_api st_gl_api = { - "Mesa " MESA_VERSION_STRING, + "Mesa " PACKAGE_VERSION, ST_API_OPENGL, #if FEATURE_GL ST_PROFILE_DEFAULT_MASK | diff --git a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c index e326bcc70..3831a0a79 100644 --- a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -175,11 +175,11 @@ dst_register( struct st_translate *t, case PROGRAM_OUTPUT: if (t->procType == TGSI_PROCESSOR_VERTEX) - assert(index < VERT_RESULT_MAX); + assert(index < VARYING_SLOT_MAX); else if (t->procType == TGSI_PROCESSOR_FRAGMENT) assert(index < FRAG_RESULT_MAX); else - assert(index < GEOM_RESULT_MAX); + assert(index < VARYING_SLOT_MAX); assert(t->outputMapping[index] < Elements(t->outputs)); @@ -310,10 +310,10 @@ translate_dst( struct st_translate *t, case TGSI_PROCESSOR_VERTEX: /* XXX if the geometry shader is present, this must be done there * instead of here. */ - if (DstReg->Index == VERT_RESULT_COL0 || - DstReg->Index == VERT_RESULT_COL1 || - DstReg->Index == VERT_RESULT_BFC0 || - DstReg->Index == VERT_RESULT_BFC1) { + if (DstReg->Index == VARYING_SLOT_COL0 || + DstReg->Index == VARYING_SLOT_COL1 || + DstReg->Index == VARYING_SLOT_BFC0 || + DstReg->Index == VARYING_SLOT_BFC1) { dst = ureg_saturate(dst); } break; @@ -790,7 +790,7 @@ emit_wpos_adjustment( struct st_translate *t, struct ureg_src wpostrans = ureg_DECL_constant( ureg, wposTransConst ); struct ureg_dst wpos_temp = ureg_DECL_temporary( ureg ); - struct ureg_src wpos_input = t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]]; + struct ureg_src wpos_input = t->inputs[t->inputMapping[VARYING_SLOT_POS]]; /* First, apply the coordinate shift: */ if (adjX || adjY[0] || adjY[1]) { @@ -841,7 +841,7 @@ emit_wpos_adjustment( struct st_translate *t, /* Use wpos_temp as position input from here on: */ - t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]] = ureg_src(wpos_temp); + t->inputs[t->inputMapping[VARYING_SLOT_POS]] = ureg_src(wpos_temp); } @@ -961,7 +961,7 @@ emit_face_var( struct st_translate *t, { struct ureg_program *ureg = t->ureg; struct ureg_dst face_temp = ureg_DECL_temporary( ureg ); - struct ureg_src face_input = t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]]; + struct ureg_src face_input = t->inputs[t->inputMapping[VARYING_SLOT_FACE]]; /* MOV_SAT face_temp, input[face] */ @@ -970,7 +970,7 @@ emit_face_var( struct st_translate *t, /* Use face_temp as face input from here on: */ - t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]] = ureg_src(face_temp); + t->inputs[t->inputMapping[VARYING_SLOT_FACE]] = ureg_src(face_temp); } @@ -979,7 +979,7 @@ emit_edgeflags( struct st_translate *t, const struct gl_program *program ) { struct ureg_program *ureg = t->ureg; - struct ureg_dst edge_dst = t->outputs[t->outputMapping[VERT_RESULT_EDGE]]; + struct ureg_dst edge_dst = t->outputs[t->outputMapping[VARYING_SLOT_EDGE]]; struct ureg_src edge_src = t->inputs[t->inputMapping[VERT_ATTRIB_EDGEFLAG]]; ureg_MOV( ureg, edge_dst, edge_src ); @@ -1051,14 +1051,14 @@ st_translate_mesa_program( interpMode[i]); } - if (program->InputsRead & FRAG_BIT_WPOS) { + if (program->InputsRead & VARYING_BIT_POS) { /* Must do this after setting up t->inputs, and before * emitting constant references, below: */ emit_wpos(st_context(ctx), t, program, ureg); } - if (program->InputsRead & FRAG_BIT_FACE) { + if (program->InputsRead & VARYING_BIT_FACE) { emit_face_var( t, program ); } diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c index f56f7cb1c..6af8df316 100644 --- a/mesalib/src/mesa/state_tracker/st_program.c +++ b/mesalib/src/mesa/state_tracker/st_program.c @@ -168,7 +168,7 @@ st_release_gp_variants(struct st_context *st, struct st_geometry_program *stgp) /** * Translate a Mesa vertex shader into a TGSI shader. - * \param outputMapping to map vertex program output registers (VERT_RESULT_x) + * \param outputMapping to map vertex program output registers (VARYING_SLOT_x) * to TGSI output slots * \param tokensOut destination for TGSI tokens * \return pointer to cached pipe_shader object. @@ -205,7 +205,7 @@ st_prepare_vertex_program(struct gl_context *ctx, /* Compute mapping of vertex program outputs to slots. */ - for (attr = 0; attr < VERT_RESULT_MAX; attr++) { + for (attr = 0; attr < VARYING_SLOT_MAX; attr++) { if ((stvp->Base.Base.OutputsWritten & BITFIELD64_BIT(attr)) == 0) { stvp->result_to_output[attr] = ~0; } @@ -215,76 +215,76 @@ st_prepare_vertex_program(struct gl_context *ctx, stvp->result_to_output[attr] = slot; switch (attr) { - case VERT_RESULT_HPOS: + case VARYING_SLOT_POS: stvp->output_semantic_name[slot] = TGSI_SEMANTIC_POSITION; stvp->output_semantic_index[slot] = 0; break; - case VERT_RESULT_COL0: + case VARYING_SLOT_COL0: stvp->output_semantic_name[slot] = TGSI_SEMANTIC_COLOR; stvp->output_semantic_index[slot] = 0; break; - case VERT_RESULT_COL1: + case VARYING_SLOT_COL1: stvp->output_semantic_name[slot] = TGSI_SEMANTIC_COLOR; stvp->output_semantic_index[slot] = 1; break; - case VERT_RESULT_BFC0: + case VARYING_SLOT_BFC0: stvp->output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR; stvp->output_semantic_index[slot] = 0; break; - case VERT_RESULT_BFC1: + case VARYING_SLOT_BFC1: stvp->output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR; stvp->output_semantic_index[slot] = 1; break; - case VERT_RESULT_FOGC: + case VARYING_SLOT_FOGC: stvp->output_semantic_name[slot] = TGSI_SEMANTIC_FOG; stvp->output_semantic_index[slot] = 0; break; - case VERT_RESULT_PSIZ: + case VARYING_SLOT_PSIZ: stvp->output_semantic_name[slot] = TGSI_SEMANTIC_PSIZE; stvp->output_semantic_index[slot] = 0; break; - case VERT_RESULT_CLIP_DIST0: + case VARYING_SLOT_CLIP_DIST0: stvp->output_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST; stvp->output_semantic_index[slot] = 0; break; - case VERT_RESULT_CLIP_DIST1: + case VARYING_SLOT_CLIP_DIST1: stvp->output_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST; stvp->output_semantic_index[slot] = 1; break; - case VERT_RESULT_EDGE: + case VARYING_SLOT_EDGE: assert(0); break; - case VERT_RESULT_CLIP_VERTEX: + case VARYING_SLOT_CLIP_VERTEX: stvp->output_semantic_name[slot] = TGSI_SEMANTIC_CLIPVERTEX; stvp->output_semantic_index[slot] = 0; break; - case VERT_RESULT_TEX0: - case VERT_RESULT_TEX1: - case VERT_RESULT_TEX2: - case VERT_RESULT_TEX3: - case VERT_RESULT_TEX4: - case VERT_RESULT_TEX5: - case VERT_RESULT_TEX6: - case VERT_RESULT_TEX7: + case VARYING_SLOT_TEX0: + case VARYING_SLOT_TEX1: + case VARYING_SLOT_TEX2: + case VARYING_SLOT_TEX3: + case VARYING_SLOT_TEX4: + case VARYING_SLOT_TEX5: + case VARYING_SLOT_TEX6: + case VARYING_SLOT_TEX7: stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - stvp->output_semantic_index[slot] = attr - VERT_RESULT_TEX0; + stvp->output_semantic_index[slot] = attr - VARYING_SLOT_TEX0; break; - case VERT_RESULT_VAR0: + case VARYING_SLOT_VAR0: default: - assert(attr < VERT_RESULT_MAX); + assert(attr < VARYING_SLOT_MAX); stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - stvp->output_semantic_index[slot] = (FRAG_ATTRIB_VAR0 - - FRAG_ATTRIB_TEX0 + + stvp->output_semantic_index[slot] = (VARYING_SLOT_VAR0 - + VARYING_SLOT_TEX0 + attr - - VERT_RESULT_VAR0); + VARYING_SLOT_VAR0); break; } } } /* similar hack to above, presetup potentially unused edgeflag output */ - stvp->result_to_output[VERT_RESULT_EDGE] = stvp->num_outputs; + stvp->result_to_output[VARYING_SLOT_EDGE] = stvp->num_outputs; stvp->output_semantic_name[stvp->num_outputs] = TGSI_SEMANTIC_EDGEFLAG; stvp->output_semantic_index[stvp->num_outputs] = 0; } @@ -472,7 +472,7 @@ st_translate_fragment_program(struct st_context *st, GLboolean deleteFP = GL_FALSE; GLuint outputMapping[FRAG_RESULT_MAX]; - GLuint inputMapping[FRAG_ATTRIB_MAX]; + GLuint inputMapping[VARYING_SLOT_MAX]; GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */ GLuint attr; GLbitfield64 inputsRead; @@ -529,7 +529,7 @@ st_translate_fragment_program(struct st_context *st, * Convert Mesa program inputs to TGSI input register semantics. */ inputsRead = stfp->Base.Base.InputsRead; - for (attr = 0; attr < FRAG_ATTRIB_MAX; attr++) { + for (attr = 0; attr < VARYING_SLOT_MAX; attr++) { if ((inputsRead & BITFIELD64_BIT(attr)) != 0) { const GLuint slot = fs_num_inputs++; @@ -537,46 +537,46 @@ st_translate_fragment_program(struct st_context *st, is_centroid[slot] = (stfp->Base.IsCentroid & BITFIELD64_BIT(attr)) != 0; switch (attr) { - case FRAG_ATTRIB_WPOS: + case VARYING_SLOT_POS: input_semantic_name[slot] = TGSI_SEMANTIC_POSITION; input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_LINEAR; break; - case FRAG_ATTRIB_COL0: + case VARYING_SLOT_COL0: input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; input_semantic_index[slot] = 0; interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr], TRUE); break; - case FRAG_ATTRIB_COL1: + case VARYING_SLOT_COL1: input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; input_semantic_index[slot] = 1; interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr], TRUE); break; - case FRAG_ATTRIB_FOGC: + case VARYING_SLOT_FOGC: input_semantic_name[slot] = TGSI_SEMANTIC_FOG; input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; break; - case FRAG_ATTRIB_FACE: + case VARYING_SLOT_FACE: input_semantic_name[slot] = TGSI_SEMANTIC_FACE; input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_CONSTANT; break; - case FRAG_ATTRIB_CLIP_DIST0: + case VARYING_SLOT_CLIP_DIST0: input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST; input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; break; - case FRAG_ATTRIB_CLIP_DIST1: + case VARYING_SLOT_CLIP_DIST1: input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST; input_semantic_index[slot] = 1; interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; break; /* In most cases, there is nothing special about these * inputs, so adopt a convention to use the generic - * semantic name and the mesa FRAG_ATTRIB_ number as the + * semantic name and the mesa VARYING_SLOT_ number as the * index. * * All that is required is that the vertex shader labels @@ -589,24 +589,24 @@ st_translate_fragment_program(struct st_context *st, * zero or be restricted to a particular range -- nobody * should be building tables based on semantic index. */ - case FRAG_ATTRIB_PNTC: - case FRAG_ATTRIB_TEX0: - case FRAG_ATTRIB_TEX1: - case FRAG_ATTRIB_TEX2: - case FRAG_ATTRIB_TEX3: - case FRAG_ATTRIB_TEX4: - case FRAG_ATTRIB_TEX5: - case FRAG_ATTRIB_TEX6: - case FRAG_ATTRIB_TEX7: - case FRAG_ATTRIB_VAR0: + case VARYING_SLOT_PNTC: + case VARYING_SLOT_TEX0: + case VARYING_SLOT_TEX1: + case VARYING_SLOT_TEX2: + case VARYING_SLOT_TEX3: + case VARYING_SLOT_TEX4: + case VARYING_SLOT_TEX5: + case VARYING_SLOT_TEX6: + case VARYING_SLOT_TEX7: + case VARYING_SLOT_VAR0: default: /* Actually, let's try and zero-base this just for * readability of the generated TGSI. */ - assert(attr >= FRAG_ATTRIB_TEX0); - input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0); + assert(attr >= VARYING_SLOT_TEX0); + input_semantic_index[slot] = (attr - VARYING_SLOT_TEX0); input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - if (attr == FRAG_ATTRIB_PNTC) + if (attr == VARYING_SLOT_PNTC) interpMode[slot] = TGSI_INTERPOLATE_LINEAR; else interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr], @@ -800,8 +800,8 @@ st_translate_geometry_program(struct st_context *st, struct st_geometry_program *stgp, const struct st_gp_variant_key *key) { - GLuint inputMapping[GEOM_ATTRIB_MAX]; - GLuint outputMapping[GEOM_RESULT_MAX]; + GLuint inputMapping[VARYING_SLOT_MAX]; + GLuint outputMapping[VARYING_SLOT_MAX]; struct pipe_context *pipe = st->pipe; GLuint attr; GLbitfield64 inputsRead; @@ -844,7 +844,7 @@ st_translate_geometry_program(struct st_context *st, * Convert Mesa program inputs to TGSI input register semantics. */ inputsRead = stgp->Base.Base.InputsRead; - for (attr = 0; attr < GEOM_ATTRIB_MAX; attr++) { + for (attr = 0; attr < VARYING_SLOT_MAX; attr++) { if ((inputsRead & BITFIELD64_BIT(attr)) != 0) { const GLuint slot = gs_num_inputs; @@ -857,7 +857,7 @@ st_translate_geometry_program(struct st_context *st, stgp->index_to_input[vslot] = attr; ++vslot; - if (attr != GEOM_ATTRIB_PRIMITIVE_ID) { + if (attr != VARYING_SLOT_PRIMITIVE_ID) { gs_array_offset += 2; } else ++gs_builtin_inputs; @@ -868,31 +868,31 @@ st_translate_geometry_program(struct st_context *st, #endif switch (attr) { - case GEOM_ATTRIB_PRIMITIVE_ID: + case VARYING_SLOT_PRIMITIVE_ID: stgp->input_semantic_name[slot] = TGSI_SEMANTIC_PRIMID; stgp->input_semantic_index[slot] = 0; break; - case GEOM_ATTRIB_POSITION: + case VARYING_SLOT_POS: stgp->input_semantic_name[slot] = TGSI_SEMANTIC_POSITION; stgp->input_semantic_index[slot] = 0; break; - case GEOM_ATTRIB_COLOR0: + case VARYING_SLOT_COL0: stgp->input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; stgp->input_semantic_index[slot] = 0; break; - case GEOM_ATTRIB_COLOR1: + case VARYING_SLOT_COL1: stgp->input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; stgp->input_semantic_index[slot] = 1; break; - case GEOM_ATTRIB_FOG_FRAG_COORD: + case VARYING_SLOT_FOGC: stgp->input_semantic_name[slot] = TGSI_SEMANTIC_FOG; stgp->input_semantic_index[slot] = 0; break; - case GEOM_ATTRIB_TEX_COORD: + case VARYING_SLOT_TEX0: stgp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; stgp->input_semantic_index[slot] = num_generic++; break; - case GEOM_ATTRIB_VAR0: + case VARYING_SLOT_VAR0: /* fall-through */ default: stgp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; @@ -912,7 +912,7 @@ st_translate_geometry_program(struct st_context *st, * Determine number of outputs, the (default) output register * mapping and the semantic information for each output. */ - for (attr = 0; attr < GEOM_RESULT_MAX; attr++) { + for (attr = 0; attr < VARYING_SLOT_MAX; attr++) { if (stgp->Base.Base.OutputsWritten & BITFIELD64_BIT(attr)) { GLuint slot; @@ -921,45 +921,45 @@ st_translate_geometry_program(struct st_context *st, outputMapping[attr] = slot; switch (attr) { - case GEOM_RESULT_POS: + case VARYING_SLOT_POS: assert(slot == 0); gs_output_semantic_name[slot] = TGSI_SEMANTIC_POSITION; gs_output_semantic_index[slot] = 0; break; - case GEOM_RESULT_COL0: + case VARYING_SLOT_COL0: gs_output_semantic_name[slot] = TGSI_SEMANTIC_COLOR; gs_output_semantic_index[slot] = 0; break; - case GEOM_RESULT_COL1: + case VARYING_SLOT_COL1: gs_output_semantic_name[slot] = TGSI_SEMANTIC_COLOR; gs_output_semantic_index[slot] = 1; break; - case GEOM_RESULT_SCOL0: + case VARYING_SLOT_BFC0: gs_output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR; gs_output_semantic_index[slot] = 0; break; - case GEOM_RESULT_SCOL1: + case VARYING_SLOT_BFC1: gs_output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR; gs_output_semantic_index[slot] = 1; break; - case GEOM_RESULT_FOGC: + case VARYING_SLOT_FOGC: gs_output_semantic_name[slot] = TGSI_SEMANTIC_FOG; gs_output_semantic_index[slot] = 0; break; - case GEOM_RESULT_PSIZ: + case VARYING_SLOT_PSIZ: gs_output_semantic_name[slot] = TGSI_SEMANTIC_PSIZE; gs_output_semantic_index[slot] = 0; break; - case GEOM_RESULT_TEX0: - case GEOM_RESULT_TEX1: - case GEOM_RESULT_TEX2: - case GEOM_RESULT_TEX3: - case GEOM_RESULT_TEX4: - case GEOM_RESULT_TEX5: - case GEOM_RESULT_TEX6: - case GEOM_RESULT_TEX7: + case VARYING_SLOT_TEX0: + case VARYING_SLOT_TEX1: + case VARYING_SLOT_TEX2: + case VARYING_SLOT_TEX3: + case VARYING_SLOT_TEX4: + case VARYING_SLOT_TEX5: + case VARYING_SLOT_TEX6: + case VARYING_SLOT_TEX7: /* fall-through */ - case GEOM_RESULT_VAR0: + case VARYING_SLOT_VAR0: /* fall-through */ default: assert(slot < Elements(gs_output_semantic_name)); @@ -973,7 +973,7 @@ st_translate_geometry_program(struct st_context *st, assert(gs_output_semantic_name[0] == TGSI_SEMANTIC_POSITION); /* find max output slot referenced to compute gs_num_outputs */ - for (attr = 0; attr < GEOM_RESULT_MAX; attr++) { + for (attr = 0; attr < VARYING_SLOT_MAX; attr++) { if (outputMapping[attr] != ~0 && outputMapping[attr] > maxSlot) maxSlot = outputMapping[attr]; } diff --git a/mesalib/src/mesa/state_tracker/st_program.h b/mesalib/src/mesa/state_tracker/st_program.h index 23a262ccc..c764dc9c4 100644 --- a/mesalib/src/mesa/state_tracker/st_program.h +++ b/mesalib/src/mesa/state_tracker/st_program.h @@ -152,10 +152,10 @@ struct st_vertex_program GLuint index_to_input[PIPE_MAX_SHADER_INPUTS]; GLuint num_inputs; - /** Maps VERT_RESULT_x to slot */ - GLuint result_to_output[VERT_RESULT_MAX]; - ubyte output_semantic_name[VERT_RESULT_MAX]; - ubyte output_semantic_index[VERT_RESULT_MAX]; + /** Maps VARYING_SLOT_x to slot */ + GLuint result_to_output[VARYING_SLOT_MAX]; + ubyte output_semantic_name[VARYING_SLOT_MAX]; + ubyte output_semantic_index[VARYING_SLOT_MAX]; GLuint num_outputs; /** List of translated variants of this vertex program. @@ -198,14 +198,14 @@ struct st_geometry_program /** map GP input back to VP output */ GLuint input_map[PIPE_MAX_SHADER_INPUTS]; - /** maps a Mesa GEOM_ATTRIB_x to a packed TGSI input index */ - GLuint input_to_index[GEOM_ATTRIB_MAX]; - /** maps a TGSI input index back to a Mesa GEOM_ATTRIB_x */ + /** maps a Mesa VARYING_SLOT_x to a packed TGSI input index */ + GLuint input_to_index[VARYING_SLOT_MAX]; + /** maps a TGSI input index back to a Mesa VARYING_SLOT_x */ GLuint index_to_input[PIPE_MAX_SHADER_INPUTS]; GLuint num_inputs; - GLuint input_to_slot[GEOM_ATTRIB_MAX]; /**< Maps GEOM_ATTRIB_x to slot */ + GLuint input_to_slot[VARYING_SLOT_MAX]; /**< Maps VARYING_SLOT_x to slot */ GLuint num_input_slots; ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS]; |