From: Kenneth Graunke Date: Mon, 2 Jan 2012 23:51:58 +0000 (-0800) Subject: i965/vs: Use the proper dimensionality for the sampler result register. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fbbbc8c04e2462a0ae272d81e61eee5f85f08aa6;p=mesa.git i965/vs: Use the proper dimensionality for the sampler result register. textureSize() returns an int, ivec2, or ivec3, but never an ivec4. Creating the destination register as an ivec4 triggered later failures, even though the register did hold the proper values. For example, piglit test vs-textureSize-compare calls textureSize on a 2D texture and compares the result to an expected value. Unfortunately, our generated code also tried to compare the third and fourth components which were undefined, and failed. Fixes piglit test vs-textureSize-compare as well as 19 subcases of oglconform's glsl-bif-tex-size test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44339 Signed-off-by: Kenneth Graunke Reviewed-by: Ian Romanick Reviewed-by: Eric Anholt --- diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index 52e63f86b54..20da487399f 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -1786,7 +1786,7 @@ vec4_visitor::visit(ir_texture *ir) inst->base_mrf = 2; inst->mlen = inst->header_present + 1; /* always at least one */ inst->sampler = sampler; - inst->dst = dst_reg(this, glsl_type::get_instance(ir->type->base_type,4,1)); + inst->dst = dst_reg(this, ir->type); inst->shadow_compare = ir->shadow_comparitor != NULL; if (ir->offset != NULL)