From: Marek Olšák <marek.ol...@amd.com> --- src/mesa/state_tracker/st_atifs_to_tgsi.c | 8 ++++---- src/mesa/state_tracker/st_atifs_to_tgsi.h | 4 ++-- src/mesa/state_tracker/st_cb_rasterpos.c | 4 ++-- src/mesa/state_tracker/st_context.h | 2 +- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 16 ++++++++-------- src/mesa/state_tracker/st_glsl_to_tgsi.h | 8 ++++---- src/mesa/state_tracker/st_mesa_to_tgsi.c | 8 ++++---- src/mesa/state_tracker/st_mesa_to_tgsi.h | 4 ++-- src/mesa/state_tracker/st_program.c | 10 +++++----- src/mesa/state_tracker/st_program.h | 8 ++++---- 10 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/src/mesa/state_tracker/st_atifs_to_tgsi.c b/src/mesa/state_tracker/st_atifs_to_tgsi.c index 90286a1..0cba169 100644 --- a/src/mesa/state_tracker/st_atifs_to_tgsi.c +++ b/src/mesa/state_tracker/st_atifs_to_tgsi.c @@ -38,22 +38,22 @@ struct st_translate { struct ureg_program *ureg; struct ati_fragment_shader *atifs; struct ureg_dst temps[MAX_PROGRAM_TEMPS]; struct ureg_src *constants; struct ureg_dst outputs[PIPE_MAX_SHADER_OUTPUTS]; struct ureg_src inputs[PIPE_MAX_SHADER_INPUTS]; struct ureg_src samplers[PIPE_MAX_SAMPLERS]; - const GLuint *inputMapping; - const GLuint *outputMapping; + const ubyte *inputMapping; + const ubyte *outputMapping; unsigned current_pass; bool regs_written[MAX_NUM_PASSES_ATI][MAX_NUM_FRAGMENT_REGISTERS_ATI]; boolean error; }; struct instruction_desc { unsigned TGSI_opcode; @@ -418,26 +418,26 @@ finalize_shader(struct st_translate *t, unsigned numPasses) /** * Called when a new variant is needed, we need to translate * the ATI fragment shader to TGSI */ enum pipe_error st_translate_atifs_program( struct ureg_program *ureg, struct ati_fragment_shader *atifs, struct gl_program *program, GLuint numInputs, - const GLuint inputMapping[], + const ubyte inputMapping[], const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], const GLuint interpMode[], GLuint numOutputs, - const GLuint outputMapping[], + const ubyte outputMapping[], const ubyte outputSemanticName[], const ubyte outputSemanticIndex[]) { enum pipe_error ret = PIPE_OK; unsigned pass, i, r; struct st_translate translate, *t; t = &translate; memset(t, 0, sizeof *t); diff --git a/src/mesa/state_tracker/st_atifs_to_tgsi.h b/src/mesa/state_tracker/st_atifs_to_tgsi.h index 1422702..980555c 100644 --- a/src/mesa/state_tracker/st_atifs_to_tgsi.h +++ b/src/mesa/state_tracker/st_atifs_to_tgsi.h @@ -36,26 +36,26 @@ struct ureg_program; struct tgsi_token; struct ati_fragment_shader; struct st_fp_variant_key; enum pipe_error st_translate_atifs_program( struct ureg_program *ureg, struct ati_fragment_shader *atifs, struct gl_program *program, GLuint numInputs, - const GLuint inputMapping[], + const ubyte inputMapping[], const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], const GLuint interpMode[], GLuint numOutputs, - const GLuint outputMapping[], + const ubyte outputMapping[], const ubyte outputSemanticName[], const ubyte outputSemanticIndex[]); void st_init_atifs_prog(struct gl_context *ctx, struct gl_program *prog); const struct tgsi_token * st_fixup_atifs(const struct tgsi_token *tokens, const struct st_fp_variant_key *key); diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index 8518454..c55b624 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -102,21 +102,21 @@ rastpos_destroy(struct draw_stage *stage) { free(stage); } /** * Update a raster pos attribute from the vertex result if it's present, * else copy the current attrib. */ static void -update_attrib(struct gl_context *ctx, const GLuint *outputMapping, +update_attrib(struct gl_context *ctx, const ubyte *outputMapping, const struct vertex_header *vert, GLfloat *dest, GLuint result, GLuint defaultAttrib) { const GLfloat *src; const GLuint k = outputMapping[result]; if (k != ~0U) src = vert->data[k]; else src = ctx->Current.Attrib[defaultAttrib]; @@ -127,21 +127,21 @@ update_attrib(struct gl_context *ctx, const GLuint *outputMapping, /** * Normally, this function would render a GL_POINT. */ static void rastpos_point(struct draw_stage *stage, struct prim_header *prim) { struct rastpos_stage *rs = rastpos_stage(stage); struct gl_context *ctx = rs->ctx; struct st_context *st = st_context(ctx); const GLfloat height = (GLfloat) ctx->DrawBuffer->Height; - const GLuint *outputMapping = st->vertex_result_to_slot; + const ubyte *outputMapping = st->vertex_result_to_slot; const GLfloat *pos; GLuint i; /* if we get here, we didn't get clipped */ ctx->Current.RasterPosValid = GL_TRUE; /* update raster pos */ pos = prim->v[0]->data[0]; ctx->Current.RasterPos[0] = pos[0]; if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 74ab43c..d02c6f8 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -164,21 +164,21 @@ struct st_context /* If true, further analysis of states is required to know if something * has changed. Used mainly for shaders. */ bool gfx_shaders_may_be_dirty; bool compute_shader_may_be_dirty; GLboolean vertdata_edgeflags; GLboolean edgeflag_culls_prims; /** Mapping from VARYING_SLOT_x to post-transformed vertex slot */ - const GLuint *vertex_result_to_slot; + const ubyte *vertex_result_to_slot; struct st_vertex_program *vp; /**< Currently bound vertex program */ struct st_fragment_program *fp; /**< Currently bound fragment program */ struct st_geometry_program *gp; /**< Currently bound geometry program */ struct st_tessctrl_program *tcp; /**< Currently bound tess control program */ struct st_tesseval_program *tep; /**< Currently bound tess eval program */ struct st_compute_program *cp; /**< Currently bound compute program */ struct st_vp_variant *vp_variant; struct st_fp_variant *fp_variant; diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 0f8688a..664dd61 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -5395,22 +5395,22 @@ struct st_translate { struct ureg_src buffers[PIPE_MAX_SHADER_BUFFERS]; struct ureg_src images[PIPE_MAX_SHADER_IMAGES]; struct ureg_src systemValues[SYSTEM_VALUE_MAX]; struct ureg_src shared_memory; unsigned *array_sizes; struct inout_decl *input_decls; unsigned num_input_decls; struct inout_decl *output_decls; unsigned num_output_decls; - const GLuint *inputMapping; - const GLuint *outputMapping; + const ubyte *inputMapping; + const ubyte *outputMapping; unsigned procType; /**< PIPE_SHADER_VERTEX/FRAGMENT */ }; /** Map Mesa's SYSTEM_VALUE_x to TGSI_SEMANTIC_x */ unsigned _mesa_sysval_to_semantic(unsigned sysval) { switch (sysval) { /* Vertex shader */ @@ -6131,32 +6131,32 @@ emit_compute_block_size(const struct gl_program *prog, prog->info.cs.local_size[1]); ureg_property(ureg, TGSI_PROPERTY_CS_FIXED_BLOCK_DEPTH, prog->info.cs.local_size[2]); } struct sort_inout_decls { bool operator()(const struct inout_decl &a, const struct inout_decl &b) const { return mapping[a.mesa_index] < mapping[b.mesa_index]; } - const GLuint *mapping; + const ubyte *mapping; }; /* Sort the given array of decls by the corresponding slot (TGSI file index). * * This is for the benefit of older drivers which are broken when the * declarations aren't sorted in this way. */ static void sort_inout_decls_by_slot(struct inout_decl *decls, unsigned count, - const GLuint mapping[]) + const ubyte mapping[]) { sort_inout_decls sorter; sorter.mapping = mapping; std::sort(decls, decls + count, sorter); } static unsigned st_translate_interp(enum glsl_interp_mode glsl_qual, GLuint varying) { switch (glsl_qual) { @@ -6196,27 +6196,27 @@ st_translate_interp(enum glsl_interp_mode glsl_qual, GLuint varying) * \return PIPE_OK or PIPE_ERROR_OUT_OF_MEMORY */ extern "C" enum pipe_error st_translate_program( struct gl_context *ctx, uint procType, struct ureg_program *ureg, glsl_to_tgsi_visitor *program, const struct gl_program *proginfo, GLuint numInputs, - const GLuint inputMapping[], + const ubyte inputMapping[], const GLuint inputSlotToAttr[], const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], const GLuint interpMode[], GLuint numOutputs, - const GLuint outputMapping[], + const ubyte outputMapping[], const GLuint outputSlotToAttr[], const ubyte outputSemanticName[], const ubyte outputSemanticIndex[]) { struct st_translate *t; unsigned i; struct gl_program_constants *frag_const = &ctx->Const.Program[MESA_SHADER_FRAGMENT]; enum pipe_error ret = PIPE_OK; @@ -7058,34 +7058,34 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) return GL_FALSE; } } } return GL_TRUE; } void st_translate_stream_output_info(glsl_to_tgsi_visitor *glsl_to_tgsi, - const GLuint outputMapping[], + const ubyte *outputMapping, struct pipe_stream_output_info *so) { if (!glsl_to_tgsi->shader_program->last_vert_prog) return; struct gl_transform_feedback_info *info = glsl_to_tgsi->shader_program->last_vert_prog->sh.LinkedTransformFeedback; st_translate_stream_output_info2(info, outputMapping, so); } void st_translate_stream_output_info2(struct gl_transform_feedback_info *info, - const GLuint outputMapping[], + const ubyte *outputMapping, struct pipe_stream_output_info *so) { unsigned i; for (i = 0; i < info->NumOutputs; i++) { so->output[i].register_index = outputMapping[info->Outputs[i].OutputRegister]; so->output[i].start_component = info->Outputs[i].ComponentOffset; so->output[i].num_components = info->Outputs[i].NumComponents; so->output[i].output_buffer = info->Outputs[i].OutputBuffer; diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.h b/src/mesa/state_tracker/st_glsl_to_tgsi.h index add534c..dec68c5 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.h +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.h @@ -35,41 +35,41 @@ struct gl_shader_program; struct glsl_to_tgsi_visitor; struct ureg_program; enum pipe_error st_translate_program( struct gl_context *ctx, uint procType, struct ureg_program *ureg, struct glsl_to_tgsi_visitor *program, const struct gl_program *proginfo, GLuint numInputs, - const GLuint inputMapping[], + const ubyte inputMapping[], const GLuint inputSlotToAttr[], const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], const GLuint interpMode[], GLuint numOutputs, - const GLuint outputMapping[], + const ubyte outputMapping[], const GLuint outputSlotToAttr[], const ubyte outputSemanticName[], const ubyte outputSemanticIndex[]); void free_glsl_to_tgsi_visitor(struct glsl_to_tgsi_visitor *v); GLboolean st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog); void st_translate_stream_output_info(struct glsl_to_tgsi_visitor *glsl_to_tgsi, - const GLuint outputMapping[], + const ubyte *outputMapping, struct pipe_stream_output_info *so); void st_translate_stream_output_info2(struct gl_transform_feedback_info *info, - const GLuint outputMapping[], + const ubyte *outputMapping, struct pipe_stream_output_info *so); unsigned _mesa_sysval_to_semantic(unsigned sysval); #ifdef __cplusplus } #endif diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index f906fed..d760962 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -58,22 +58,22 @@ struct st_translate { struct ureg_program *ureg; struct ureg_dst temps[MAX_PROGRAM_TEMPS]; struct ureg_src *constants; struct ureg_dst outputs[PIPE_MAX_SHADER_OUTPUTS]; struct ureg_src inputs[PIPE_MAX_SHADER_INPUTS]; struct ureg_dst address[1]; struct ureg_src samplers[PIPE_MAX_SAMPLERS]; struct ureg_src systemValues[SYSTEM_VALUE_MAX]; - const GLuint *inputMapping; - const GLuint *outputMapping; + const ubyte *inputMapping; + const ubyte *outputMapping; unsigned procType; /**< PIPE_SHADER_VERTEX/FRAGMENT */ }; /** * Map a Mesa dst register to a TGSI ureg_dst register. */ static struct ureg_dst dst_register( struct st_translate *t, @@ -792,26 +792,26 @@ emit_wpos(struct st_context *st, * * \return PIPE_OK or PIPE_ERROR_OUT_OF_MEMORY */ enum pipe_error st_translate_mesa_program( struct gl_context *ctx, uint procType, struct ureg_program *ureg, const struct gl_program *program, GLuint numInputs, - const GLuint inputMapping[], + const ubyte inputMapping[], const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], const GLuint interpMode[], GLuint numOutputs, - const GLuint outputMapping[], + const ubyte outputMapping[], const ubyte outputSemanticName[], const ubyte outputSemanticIndex[]) { struct st_translate translate, *t; unsigned i; enum pipe_error ret = PIPE_OK; assert(numInputs <= ARRAY_SIZE(t->inputs)); assert(numOutputs <= ARRAY_SIZE(t->outputs)); diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.h b/src/mesa/state_tracker/st_mesa_to_tgsi.h index 3df54ce..42015fc 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.h +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.h @@ -44,26 +44,26 @@ struct tgsi_token; struct ureg_program; enum pipe_error st_translate_mesa_program( struct gl_context *ctx, uint procType, struct ureg_program *ureg, const struct gl_program *program, GLuint numInputs, - const GLuint inputMapping[], + const ubyte inputMapping[], const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], const GLuint interpMode[], GLuint numOutputs, - const GLuint outputMapping[], + const ubyte outputMapping[], const ubyte outputSemanticName[], const ubyte outputSemanticIndex[]); unsigned st_translate_texture_target(GLuint textarget, GLboolean shadow); #if defined __cplusplus } /* extern "C" */ #endif diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 0dc3b1e..65377b9 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -369,21 +369,21 @@ st_release_cp_variants(struct st_context *st, struct st_compute_program *stcp) * Translate a vertex program. */ bool st_translate_vertex_program(struct st_context *st, struct st_vertex_program *stvp) { struct ureg_program *ureg; enum pipe_error error; unsigned num_outputs = 0; unsigned attr; - unsigned input_to_index[VERT_ATTRIB_MAX] = {0}; + ubyte input_to_index[VERT_ATTRIB_MAX] = {0}; unsigned output_slot_to_attr[VARYING_SLOT_MAX] = {0}; ubyte output_semantic_name[VARYING_SLOT_MAX] = {0}; ubyte output_semantic_index[VARYING_SLOT_MAX] = {0}; stvp->num_inputs = 0; if (stvp->Base.arb.IsPositionInvariant) _mesa_insert_mvp_code(st->ctx, &stvp->Base); /* @@ -709,22 +709,22 @@ st_get_vp_variant(struct st_context *st, } /** * Translate a Mesa fragment shader into a TGSI shader. */ bool st_translate_fragment_program(struct st_context *st, struct st_fragment_program *stfp) { - GLuint outputMapping[2 * FRAG_RESULT_MAX]; - GLuint inputMapping[VARYING_SLOT_MAX]; + ubyte outputMapping[2 * FRAG_RESULT_MAX]; + ubyte inputMapping[VARYING_SLOT_MAX]; GLuint inputSlotToAttr[VARYING_SLOT_MAX]; GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */ GLuint attr; GLbitfield64 inputsRead; struct ureg_program *ureg; GLboolean write_all = GL_FALSE; ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS]; ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS]; @@ -1342,23 +1342,23 @@ st_get_fp_variant(struct st_context *st, */ static void st_translate_program_common(struct st_context *st, struct gl_program *prog, struct glsl_to_tgsi_visitor *glsl_to_tgsi, struct ureg_program *ureg, unsigned tgsi_processor, struct pipe_shader_state *out_state) { GLuint inputSlotToAttr[VARYING_SLOT_TESS_MAX]; - GLuint inputMapping[VARYING_SLOT_TESS_MAX]; + ubyte inputMapping[VARYING_SLOT_TESS_MAX]; GLuint outputSlotToAttr[VARYING_SLOT_TESS_MAX]; - GLuint outputMapping[VARYING_SLOT_TESS_MAX]; + ubyte outputMapping[VARYING_SLOT_TESS_MAX]; GLuint attr; ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS]; ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS]; uint num_inputs = 0; ubyte output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; ubyte output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; uint num_outputs = 0; diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index 70664d1..cdc68a7 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -40,21 +40,21 @@ #include "pipe/p_state.h" #include "st_context.h" #include "st_texture.h" #include "st_glsl_to_tgsi.h" #ifdef __cplusplus extern "C" { #endif -#define ST_DOUBLE_ATTRIB_PLACEHOLDER 0xffffffff +#define ST_DOUBLE_ATTRIB_PLACEHOLDER 0xff struct st_external_sampler_key { GLuint lower_nv12; /**< bitmask of 2 plane YUV samplers */ GLuint lower_iyuv; /**< bitmask of 3 plane YUV samplers */ }; static inline struct st_external_sampler_key st_get_external_sampler_key(struct st_context *st, struct gl_program *prog) { @@ -207,25 +207,25 @@ struct st_vertex_program struct gl_program Base; /**< The Mesa vertex program */ struct pipe_shader_state tgsi; struct glsl_to_tgsi_visitor* glsl_to_tgsi; uint64_t affected_states; /**< ST_NEW_* flags to mark dirty when binding */ /* used when bypassing glsl_to_tgsi: */ struct gl_shader_program *shader_program; /** maps a Mesa VERT_ATTRIB_x to a packed TGSI input index */ /** maps a TGSI input index back to a Mesa VERT_ATTRIB_x */ - GLuint index_to_input[PIPE_MAX_SHADER_INPUTS]; - GLuint num_inputs; + ubyte index_to_input[PIPE_MAX_ATTRIBS]; + ubyte num_inputs; /** Maps VARYING_SLOT_x to slot */ - GLuint result_to_output[VARYING_SLOT_MAX]; + ubyte result_to_output[VARYING_SLOT_MAX]; /** List of translated variants of this vertex program. */ struct st_vp_variant *variants; /** SHA1 hash of linked tgsi shader program, used for on-disk cache */ unsigned char sha1[20]; }; -- 2.7.4 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev