st/mesa: decrease the size of st_vertex_program
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -45,8 +45,8 @@ struct st_translate {
|
||||
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;
|
||||
|
||||
@@ -425,12 +425,12 @@ st_translate_atifs_program(
|
||||
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[])
|
||||
{
|
||||
|
@@ -43,12 +43,12 @@ st_translate_atifs_program(
|
||||
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[]);
|
||||
|
||||
|
@@ -109,7 +109,7 @@ rastpos_destroy(struct draw_stage *stage)
|
||||
* 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)
|
||||
@@ -134,7 +134,7 @@ rastpos_point(struct draw_stage *stage, struct prim_header *prim)
|
||||
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;
|
||||
|
||||
|
@@ -171,7 +171,7 @@ struct st_context
|
||||
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 */
|
||||
|
@@ -5436,8 +5436,8 @@ struct st_translate {
|
||||
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 */
|
||||
};
|
||||
@@ -6172,7 +6172,7 @@ struct sort_inout_decls {
|
||||
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).
|
||||
@@ -6183,7 +6183,7 @@ struct sort_inout_decls {
|
||||
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;
|
||||
@@ -6237,13 +6237,13 @@ st_translate_program(
|
||||
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[])
|
||||
@@ -7100,7 +7100,7 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
|
||||
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)
|
||||
@@ -7113,7 +7113,7 @@ st_translate_stream_output_info(glsl_to_tgsi_visitor *glsl_to_tgsi,
|
||||
|
||||
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;
|
||||
|
@@ -42,13 +42,13 @@ enum pipe_error st_translate_program(
|
||||
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[]);
|
||||
@@ -59,12 +59,12 @@ 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
|
||||
|
@@ -65,8 +65,8 @@ struct st_translate {
|
||||
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 */
|
||||
};
|
||||
@@ -799,12 +799,12 @@ st_translate_mesa_program(
|
||||
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[])
|
||||
{
|
||||
|
@@ -51,12 +51,12 @@ st_translate_mesa_program(
|
||||
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[]);
|
||||
|
||||
|
@@ -376,7 +376,7 @@ st_translate_vertex_program(struct st_context *st,
|
||||
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};
|
||||
@@ -716,8 +716,8 @@ 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;
|
||||
@@ -1349,9 +1349,9 @@ st_translate_program_common(struct st_context *st,
|
||||
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];
|
||||
|
@@ -47,7 +47,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ST_DOUBLE_ATTRIB_PLACEHOLDER 0xffffffff
|
||||
#define ST_DOUBLE_ATTRIB_PLACEHOLDER 0xff
|
||||
|
||||
struct st_external_sampler_key
|
||||
{
|
||||
@@ -214,11 +214,11 @@ struct st_vertex_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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user