<div dir="ltr">NEVER MIND THIS PATCH. I had a git-send-email fail<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 27, 2015 at 12:26 PM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Cc: 10.5 <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=89292" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=89292</a><br>
---<br>
src/glsl/nir/nir_lower_vars_to_ssa.c | 34 +++++++++++++++++++++--------<br>
src/mesa/drivers/common/meta_tex_subimage.c | 2 +-<br>
2 files changed, 26 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/src/glsl/nir/nir_lower_vars_to_ssa.c b/src/glsl/nir/nir_lower_vars_to_ssa.c<br>
index 8af7530..cf88c58 100644<br>
--- a/src/glsl/nir/nir_lower_vars_to_ssa.c<br>
+++ b/src/glsl/nir/nir_lower_vars_to_ssa.c<br>
@@ -675,15 +675,31 @@ get_ssa_def_for_block(struct deref_node *node, nir_block *block,<br>
if (node->def_stack && node->def_stack_tail >= node->def_stack)<br>
return *node->def_stack_tail;<br>
<br>
- /* If we got here then we don't have a definition that dominates the<br>
- * given block. This means that we need to add an undef and use that.<br>
- */<br>
- nir_ssa_undef_instr *undef =<br>
- nir_ssa_undef_instr_create(state->mem_ctx,<br>
- glsl_get_vector_elements(node->type));<br>
- nir_instr_insert_before_cf_list(&state->impl->body, &undef->instr);<br>
- def_stack_push(node, &undef->def, state);<br>
- return &undef->def;<br>
+ nir_ssa_def *def;<br>
+ if (getenv("zero_undefined_variables")) {<br>
+ /* The user wants us to zero all undefined variables. We'll do so<br>
+ * while printing a (hopefully) helpful warning.<br>
+ */<br>
+ fprintf(stderr, "Undefined variable\n");<br>
+<br>
+ nir_load_const_instr *load =<br>
+ nir_load_const_instr_create(state->mem_ctx,<br>
+ glsl_get_vector_elements(node->type));<br>
+ memset(&load->value, 0, sizeof(load->value));<br>
+ nir_instr_insert_before_cf_list(&state->impl->body, &load->instr);<br>
+ def = &load->def;<br>
+ } else {<br>
+ /* If we got here then we don't have a definition that dominates the<br>
+ * given block. This means that we need to add an undef and use that.<br>
+ */<br>
+ nir_ssa_undef_instr *undef =<br>
+ nir_ssa_undef_instr_create(state->mem_ctx,<br>
+ glsl_get_vector_elements(node->type));<br>
+ nir_instr_insert_before_cf_list(&state->impl->body, &undef->instr);<br>
+ def = &undef->def;<br>
+ }<br>
+ def_stack_push(node, def, state);<br>
+ return def;<br>
}<br>
<br>
/* Given a block and one of its predecessors, this function fills in the<br>
diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c<br>
index 5ae12c8..0aeb2c9 100644<br>
--- a/src/mesa/drivers/common/meta_tex_subimage.c<br>
+++ b/src/mesa/drivers/common/meta_tex_subimage.c<br>
@@ -312,7 +312,7 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,<br>
return false;<br>
<br>
/* Only stash the current FBO */<br>
- _mesa_meta_begin(ctx, 0);<br>
+ _mesa_meta_begin(ctx, MESA_META_SCISSOR);<br>
<br>
_mesa_GenFramebuffers(2, fbos);<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.3.0<br>
<br>
</font></span></blockquote></div><br></div>