From c3c680950d9f7736723469ff74d0a3c9bbcaaeb1 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Thu, 22 Nov 2012 16:23:21 +1300 Subject: i965: Generalize GL_FIXED VS w/a support Next few patches build on this to add other workarounds for packed formats. V2: rename BRW_ATTRIB_WA_COMPONENTS to BRW_ATTRIB_WA_COMPONENT_MASK; V3 (Kayden): remove separate bit for ES3 signed normalization Signed-off-by: Chris Forbes Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp') diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index be5f8f2f99c..a176e8a15e7 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -815,13 +815,13 @@ vec4_visitor::visit(ir_variable *ir) * 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.type = brw_type_for_base_type(ir->type); - dst.writemask = (1 << c->key.gl_fixed_input_size[i]) - 1; - emit(MUL(dst, src_reg(dst), src_reg(1.0f / 65536.0f))); + uint8_t wa_flags = c->key.gl_attrib_wa_flags[i]; + if (wa_flags & BRW_ATTRIB_WA_COMPONENT_MASK) { + dst_reg dst = *reg; + dst.type = brw_type_for_base_type(ir->type); + dst.writemask = (1 << (wa_flags & BRW_ATTRIB_WA_COMPONENT_MASK)) - 1; + emit(MUL(dst, src_reg(dst), src_reg(1.0f / 65536.0f))); + } } break; -- cgit v1.2.3