diff options
author | Bryan Cain <[email protected]> | 2011-05-17 17:13:20 -0500 |
---|---|---|
committer | Bryan Cain <[email protected]> | 2011-08-01 17:59:07 -0500 |
commit | 6d89abadbcd68bbe9e08f041412549f8dc1fc73c (patch) | |
tree | 9876b1797693765c2cde010487011f7db6725020 /src/mesa/state_tracker | |
parent | 17b695e6e7dd730497fb60a8e161935b23fa0e9c (diff) |
mesa: support boolean and integer-based parameters in prog_parameter
The functionality is not used by anything yet, and the glUniform functions will
need to be reworked before this can reach its full usefulness. It is
nonetheless a step towards integer support in the state tracker and classic drivers.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 75ab9c5de7c..881b9e05de1 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -706,9 +706,11 @@ struct st_src_reg glsl_to_tgsi_visitor::st_src_reg_for_float(float val) { st_src_reg src(PROGRAM_CONSTANT, -1, NULL); + union gl_constant_value uval; + uval.f = val; src.index = _mesa_add_unnamed_constant(this->prog->Parameters, - &val, 1, &src.swizzle); + &uval, 1, &src.swizzle); return src; } @@ -1791,7 +1793,7 @@ glsl_to_tgsi_visitor::visit(ir_constant *ir) src = st_src_reg(PROGRAM_CONSTANT, -1, NULL); src.index = _mesa_add_unnamed_constant(this->prog->Parameters, - values, + (gl_constant_value *) values, ir->type->vector_elements, &src.swizzle); emit(ir, TGSI_OPCODE_MOV, mat_column, src); @@ -1829,7 +1831,7 @@ glsl_to_tgsi_visitor::visit(ir_constant *ir) this->result = st_src_reg(PROGRAM_CONSTANT, -1, ir->type); this->result.index = _mesa_add_unnamed_constant(this->prog->Parameters, - values, + (gl_constant_value *) values, ir->type->vector_elements, &this->result.swizzle); } @@ -2401,7 +2403,7 @@ add_uniforms_to_parameters_list(struct gl_shader_program *shader_program, */ if (file == PROGRAM_SAMPLER) { for (unsigned int j = 0; j < size / 4; j++) - prog->Parameters->ParameterValues[index + j][0] = next_sampler++; + prog->Parameters->ParameterValues[index + j][0].f = next_sampler++; } /* The location chosen in the Parameters list here (returned @@ -3762,7 +3764,7 @@ st_translate_program( else t->constants[i] = ureg_DECL_immediate( ureg, - proginfo->Parameters->ParameterValues[i], + (GLfloat *) proginfo->Parameters->ParameterValues[i], 4 ); break; default: |