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 <kenn...@whitecape.org> --- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) I was originally seeing a few oglconform regressions from this patch, but it appears that those tests give completely random results. At any rate, this patch does reliably fix a lot of tests, so I'm inclined to apply it. diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index 52e63f8..20da487 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) -- 1.7.8.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev