summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-08-23 06:50:11 -0700
committerCaio Marcelo de Oliveira Filho <[email protected]>2019-09-10 14:36:46 -0700
commit83fd1e58d8faebb7eb10094899b3175a2b55b24d (patch)
tree37fb188a45512e99152999e3c069fab8d170098e /src/mesa
parenteca8032f20d0970184843d98e2bddb688e94a3a9 (diff)
glsl/nir: Add and use a gl_nir_link() function
Perform all the NIR linking steps in order. Change iris and i965 to use it. Suggested by Alejandro. v2: Add gl_nir_linker_options struct. Reviewed-by: Alejandro PiƱeiro <[email protected]> [v1]
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_link.cpp12
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp11
2 files changed, 8 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index c726551513a..512206e71e6 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -269,15 +269,11 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
/* SPIR-V programs use a NIR linker */
if (shProg->data->spirv) {
- if (!gl_nir_link_uniform_blocks(ctx, shProg)) {
+ static const gl_nir_linker_options opts = {
+ .fill_parameters = false,
+ };
+ if (!gl_nir_link(ctx, shProg, &opts))
return GL_FALSE;
- }
-
- if (!gl_nir_link_uniforms(ctx, shProg, /* fill_parameters */ false))
- return GL_FALSE;
-
- gl_nir_link_assign_atomic_counter_resources(ctx, shProg);
- gl_nir_link_assign_xfb_resources(ctx, shProg);
}
for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) {
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 39203435515..280a7782170 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -687,15 +687,12 @@ st_link_nir(struct gl_context *ctx,
* st_nir_preprocess.
*/
if (shader_program->data->spirv) {
- if (!gl_nir_link_uniform_blocks(ctx, shader_program))
+ static const gl_nir_linker_options opts = {
+ .fill_parameters = true,
+ };
+ if (!gl_nir_link(ctx, shader_program, &opts))
return GL_FALSE;
- if (!gl_nir_link_uniforms(ctx, shader_program, /* fill_parameters */ true))
- return GL_FALSE;
-
- gl_nir_link_assign_atomic_counter_resources(ctx, shader_program);
- gl_nir_link_assign_xfb_resources(ctx, shader_program);
-
nir_build_program_resource_list(ctx, shader_program);
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {