[Mesa-dev] [PATCH 18/22] i965: Build SPIR-V programs' resource list using NIR
Alejandro PiƱeiro
apinheiro at igalia.com
Tue Apr 17 14:36:55 UTC 2018
From: Eduardo Lima Mitev <elima at igalia.com>
---
src/mesa/drivers/dri/i965/brw_link.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index 7841626dc33..48c06ce629f 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -28,7 +28,9 @@
#include "compiler/glsl/ir_optimization.h"
#include "compiler/glsl/program.h"
#include "compiler/nir/nir_serialize.h"
+#include "compiler/nir/nir_linker.h"
#include "program/program.h"
+#include "main/glspirv.h"
#include "main/mtypes.h"
#include "main/shaderapi.h"
#include "main/shaderobj.h"
@@ -363,7 +365,11 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
if (brw->precompile && !brw_shader_precompile(ctx, shProg))
return false;
- build_program_resource_list(ctx, shProg);
+ /* SPIR-V programs build its resource list from linked NIR shaders. */
+ if (!shProg->data->spirv)
+ build_program_resource_list(ctx, shProg);
+ else
+ nir_build_program_resource_list(ctx, shProg);
for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) {
struct gl_linked_shader *shader = shProg->_LinkedShaders[stage];
--
2.14.1
More information about the mesa-dev
mailing list