[Mesa-dev] [PATCH 2/9] i965/vec4: Initialize LOD to 0.0f.

Matt Turner mattst88 at gmail.com
Mon Oct 19 21:09:00 PDT 2015


We implement textureQueryLevels (which takes no arguments, save the
sampler) using the resinfo message (which takes an argument of LOD).
Without initializing it, we'd generate a MOV from the null register to
load the LOD argument.
---
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index ea1e3e7..c942c80 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -1579,7 +1579,7 @@ vec4_visitor::nir_emit_texture(nir_tex_instr *instr)
    const glsl_type *coord_type = NULL;
    src_reg shadow_comparitor;
    src_reg offset_value;
-   src_reg lod, lod2;
+   src_reg lod(0.0f), lod2;
    src_reg sample_index;
    src_reg mcs;
 
-- 
2.4.9



More information about the mesa-dev mailing list