aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/linker.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2020-05-05 14:24:46 +1000
committerMarge Bot <[email protected]>2020-06-03 10:34:22 +0000
commita34cc97ca3e19fb36045bf361b3a6bd865f71c7b (patch)
treeb32c57ecd0e1011608ea438024266c5b99994f58 /src/compiler/glsl/linker.cpp
parent7d1eadb7906628af800ab797a7423f79bbcba56c (diff)
glsl: when NIR linker enable use it to resize uniform arrays
Here we turn on uniform array resizing in the NIR linker and disable the GLSL IR resizing pass when the NIR linker is enabled. This will potentially make uniform arrays smaller due to NIR optimising away more uniform uses. Shader-db results (SKL): total instructions in shared programs: 14947192 -> 14944093 (-0.02%) instructions in affected programs: 138088 -> 134989 (-2.24%) helped: 822 HURT: 4 total cycles in shared programs: 324868402 -> 324794597 (-0.02%) cycles in affected programs: 3904170 -> 3830365 (-1.89%) helped: 2333 HURT: 1485 Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4910>
Diffstat (limited to 'src/compiler/glsl/linker.cpp')
-rw-r--r--src/compiler/glsl/linker.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index a674726312f..8761c16e2fe 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -4444,21 +4444,20 @@ static void
link_and_validate_uniforms(struct gl_context *ctx,
struct gl_shader_program *prog)
{
- update_array_sizes(prog);
+ assert(!ctx->Const.UseNIRGLSLLinker);
- if (!ctx->Const.UseNIRGLSLLinker) {
- link_assign_uniform_locations(prog, ctx);
+ update_array_sizes(prog);
+ link_assign_uniform_locations(prog, ctx);
- if (prog->data->LinkStatus == LINKING_FAILURE)
- return;
+ if (prog->data->LinkStatus == LINKING_FAILURE)
+ return;
- link_util_calculate_subroutine_compat(prog);
- link_util_check_uniform_resources(ctx, prog);
- link_util_check_subroutine_resources(prog);
- check_image_resources(ctx, prog);
- link_assign_atomic_counter_resources(ctx, prog);
- link_check_atomic_counter_resources(ctx, prog);
- }
+ link_util_calculate_subroutine_compat(prog);
+ link_util_check_uniform_resources(ctx, prog);
+ link_util_check_subroutine_resources(prog);
+ check_image_resources(ctx, prog);
+ link_assign_atomic_counter_resources(ctx, prog);
+ link_check_atomic_counter_resources(ctx, prog);
}
static bool
@@ -4505,7 +4504,8 @@ link_varyings_and_uniforms(unsigned first, unsigned last,
if (!link_varyings(prog, first, last, ctx, mem_ctx))
return false;
- link_and_validate_uniforms(ctx, prog);
+ if (!ctx->Const.UseNIRGLSLLinker)
+ link_and_validate_uniforms(ctx, prog);
if (!prog->data->LinkStatus)
return false;