summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vs.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2015-09-30 16:06:43 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2015-10-02 14:19:38 -0700
commitfc3f45234b4ff9545c84fbe8ec5261604d5ab611 (patch)
tree777ec4944356afa89cd0abd52bcab7bf9df94d7c /src/mesa/drivers/dri/i965/brw_vs.c
parent64b145422b928bed75d3665e4149a323b7208470 (diff)
downloadexternal_mesa3d-fc3f45234b4ff9545c84fbe8ec5261604d5ab611.zip
external_mesa3d-fc3f45234b4ff9545c84fbe8ec5261604d5ab611.tar.gz
external_mesa3d-fc3f45234b4ff9545c84fbe8ec5261604d5ab611.tar.bz2
i965/vs: Move lazy NIR creation to codegen_vs_prog
The next commit will add code to codegen_vs_prog that requires the NIR shader to be there in all cases. It doesn't hurt anything to just move it from brw_vs_emit to its only caller. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 0a348a5..e1a0d9c 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -37,6 +37,7 @@
#include "brw_state.h"
#include "program/prog_print.h"
#include "program/prog_parameter.h"
+#include "brw_nir.h"
#include "util/ralloc.h"
@@ -81,6 +82,18 @@ brw_codegen_vs_prog(struct brw_context *brw,
bool start_busy = false;
double start_time = 0;
+ if (!vp->program.Base.nir) {
+ /* Normally we generate NIR in LinkShader() or
+ * ProgramStringNotify(), but Mesa's fixed-function vertex program
+ * handling doesn't notify the driver at all. Just do it here, at
+ * the last minute, even though it's lame.
+ */
+ assert(vp->program.Base.Id == 0 && prog == NULL);
+ vp->program.Base.nir =
+ brw_create_nir(brw, NULL, &vp->program.Base, MESA_SHADER_VERTEX,
+ brw->intelScreen->compiler->scalar_vs);
+ }
+
if (prog)
vs = (struct brw_shader *) prog->_LinkedShaders[MESA_SHADER_VERTEX];