<p dir="ltr">LGTM RB</p>
<div class="gmail_quote">On Aug 1, 2015 5:16 AM, "Eduardo Lima Mitev" <<a href="mailto:elima@igalia.com">elima@igalia.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Antia Puentes <<a href="mailto:apuentes@igalia.com">apuentes@igalia.com</a>><br>
<br>
---<br>
 src/mesa/drivers/dri/i965/brw_vec4.cpp | 47 +++++++++++++++++-----------------<br>
 1 file changed, 24 insertions(+), 23 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp<br>
index 8d83887..88b601a 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp<br>
@@ -1732,18 +1732,16 @@ vec4_visitor::run(gl_clip_plane *clip_planes)<br>
<br>
    emit_prolog();<br>
<br>
-   if (shader) {<br>
-      if (use_vec4_nir) {<br>
-         assert(prog->nir != NULL);<br>
-         emit_nir_code();<br>
-         if (failed)<br>
-            return false;<br>
-      } else {<br>
-         /* Generate VS IR for main().  (the visitor only descends into<br>
-          * functions called "main").<br>
-          */<br>
-         visit_instructions(shader-><a href="http://base.ir" rel="noreferrer" target="_blank">base.ir</a>);<br>
-      }<br>
+   if (use_vec4_nir) {<br>
+      assert(prog->nir != NULL);<br>
+      emit_nir_code();<br>
+      if (failed)<br>
+         return false;<br>
+   } else if (shader) {<br>
+      /* Generate VS IR for main().  (the visitor only descends into<br>
+       * functions called "main").<br>
+       */<br>
+      visit_instructions(shader-><a href="http://base.ir" rel="noreferrer" target="_blank">base.ir</a>);<br>
    } else {<br>
       emit_program_code();<br>
    }<br>
@@ -1921,18 +1919,21 @@ brw_vs_emit(struct brw_context *brw,<br>
    if (unlikely(INTEL_DEBUG & DEBUG_VS))<br>
       brw_dump_ir("vertex", prog, &shader->base, &vp->Base);<br>
<br>
-   if (brw->intelScreen->compiler->scalar_vs) {<br>
-      if (!vp->Base.nir) {<br>
-         /* Normally we generate NIR in LinkShader() or<br>
-          * ProgramStringNotify(), but Mesa's fixed-function vertex program<br>
-          * handling doesn't notify the driver at all.  Just do it here, at<br>
-          * the last minute, even though it's lame.<br>
-          */<br>
-         assert(vp->Base.Id == 0 && prog == NULL);<br>
-         vp->Base.nir =<br>
-            brw_create_nir(brw, NULL, &vp->Base, MESA_SHADER_VERTEX, true);<br>
-      }<br>
+   if (!vp->Base.nir &&<br>
+       (brw->intelScreen->compiler->scalar_vs ||<br>
+        brw->intelScreen->compiler->glsl_compiler_options[MESA_SHADER_VERTEX].NirOptions != NULL)) {<br>
+      /* Normally we generate NIR in LinkShader() or<br>
+       * ProgramStringNotify(), but Mesa's fixed-function vertex program<br>
+       * handling doesn't notify the driver at all.  Just do it here, at<br>
+       * the last minute, even though it's lame.<br>
+       */<br>
+      assert(vp->Base.Id == 0 && prog == NULL);<br>
+      vp->Base.nir =<br>
+         brw_create_nir(brw, NULL, &vp->Base, MESA_SHADER_VERTEX,<br>
+                        brw->intelScreen->compiler->scalar_vs);<br>
+   }<br>
<br>
+   if (brw->intelScreen->compiler->scalar_vs) {<br>
       prog_data->base.dispatch_mode = DISPATCH_MODE_SIMD8;<br>
<br>
       fs_visitor v(brw->intelScreen->compiler, brw,<br>
--<br>
2.4.6<br>
<br>
</blockquote></div>