summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-08-23 13:30:42 -0700
committerEric Anholt <eric@anholt.net>2011-08-30 12:09:40 -0700
commit81a0b2166991a3015f8336e184c34cf6a92adfe0 (patch)
tree5122ce9f1e31f31c760f9679b60c41163acab43c /src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
parent72cfc6f3778d8297e52c254a5861a88eb62e4d67 (diff)
downloadexternal_mesa3d-81a0b2166991a3015f8336e184c34cf6a92adfe0.zip
external_mesa3d-81a0b2166991a3015f8336e184c34cf6a92adfe0.tar.gz
external_mesa3d-81a0b2166991a3015f8336e184c34cf6a92adfe0.tar.bz2
i965/vs: Fix GL_FIXED setup when a writemask is present.
By emitting code before generate_code(), we ended up in align1 mode where writemasks don't exist, so we rescaled gl_Vertex.w and things went badly. By moving GL_FIXED support to the visitor, we end up with normal codegen, and as a bonus the GL_FIXED setup ends up getting printed appropriately in debug output. Fixes gtf/GL2Tests/fixed_data_type Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 6939904..4babc56 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -666,6 +666,18 @@ vec4_visitor::visit(ir_variable *ir)
switch (ir->mode) {
case ir_var_in:
reg = new(mem_ctx) dst_reg(ATTR, ir->location);
+
+ /* Do GL_FIXED rescaling for GLES2.0. Our GL_FIXED attributes
+ * come in as floating point conversions of the integer values.
+ */
+ for (int i = ir->location; i < ir->location + type_size(ir->type); i++) {
+ if (!c->key.gl_fixed_input_size[i])
+ continue;
+
+ dst_reg dst = *reg;
+ dst.writemask = (1 << c->key.gl_fixed_input_size[i]) - 1;
+ emit(BRW_OPCODE_MUL, dst, src_reg(dst), src_reg(1.0f / 65536.0f));
+ }
break;
case ir_var_out: