st/mesa: set result writemask based on ir type
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 4 Mar 2017 18:52:48 +0000 (13:52 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 19 Mar 2017 00:16:45 +0000 (20:16 -0400)
This prevents textureQueryLevels, which maps as LODQ, from ending up
with a xyzw writemask, which is illegal.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100061
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 7b917ebe47fe8e9c57ea5421c057f7a02f7f8f8e..c53da293222bd9b29e725266b68aade017e00328 100644 (file)
@@ -4166,6 +4166,7 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
     */
    result_src = get_temp(ir->type);
    result_dst = st_dst_reg(result_src);
+   result_dst.writemask = (1 << ir->type->vector_elements) - 1;
 
    switch (ir->op) {
    case ir_tex: