diff options
author | Eric Anholt <[email protected]> | 2011-08-10 11:38:42 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-08-16 13:04:43 -0700 |
commit | 072d64121e13ad6bcb9b703090de1ee4a59f7096 (patch) | |
tree | 04881738b11c51b8251b1dc3742065bac7b52021 /src | |
parent | aed5e353e95f47773864c6e61c506b9ddad0e2e9 (diff) |
i965/vs: Add support for GL_FIXED attributes.
Fixes arb_es2_compatibility-fixed-type
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_emit.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp index 517a3e3c75b..350d544aba3 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp @@ -42,6 +42,18 @@ vec4_visitor::setup_attributes(int payload_reg) if (prog_data->inputs_read & BITFIELD64_BIT(i)) { attribute_map[i] = payload_reg + nr_attributes; nr_attributes++; + + /* Do GL_FIXED rescaling for GLES2.0. Our GL_FIXED + * attributes come in as floating point conversions of the + * integer values. + */ + if (c->key.gl_fixed_input_size[i] != 0) { + struct brw_reg reg = brw_vec8_grf(attribute_map[i], 0); + + brw_MUL(p, + brw_writemask(reg, (1 << c->key.gl_fixed_input_size[i]) - 1), + reg, brw_imm_f(1.0 / 65536.0)); + } } } |