Commit graph

2877 commits

Author SHA1 Message Date
Matt Turner
a9139e0f97 glsl: Fix typos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33556>
2025-02-15 17:43:44 +00:00
Timur Kristóf
480c7100d8 glsl: Don't include full nir.h where not necessary.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33439>
2025-02-12 22:33:07 +01:00
James Hogan
b774b615d2 glsl: Expose gl_ViewID_OVR back to GLSL 1.30
OVR_multiview requires OpenGL 3.0, so expose gl_ViewID_OVR builtin back
to GLSL 1.30 on OpenGL.

v2: Minor whitespace fix

Fixes: 328c29d600 ("mesa,glsl,gallium: add GL_OVR_multiview")
Signed-off-by: James Hogan <james@albanarts.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33346>
2025-02-04 15:12:53 +00:00
Tapani Pälli
cb71030387 mesa: enable GL_EXT_conservative_depth extension
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33065>
2025-01-30 10:50:37 +00:00
Timothy Arceri
e639cd768d glsl: fix return value for subgroupBallot()
The original code attempted to create a second instance of the intrinsic
with only a different return value which isn't possible since the params
(in this case 0 params) are the same. To fix this were need to create
two differently named intrinsics.

Reviewed-by: Qiang Yu <yuq825@gmail.com>

Fixes: a496d84ac8 ("glsl: add KHR_shader_subgroup_ballot builtin functions")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12510
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33231>
2025-01-30 06:06:32 +00:00
Timothy Arceri
09f73024a5 glsl: fix num_views linker error
The declaration must be the same across shaders but not all shaders
must make the declaration.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33149>
2025-01-24 01:47:55 +00:00
Timothy Arceri
914697c4ac glsl: fix num_views validation message
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33149>
2025-01-24 01:47:55 +00:00
Marek Olšák
f29530533c glsl: simplify nir_lower_io_to_temporaries logic
no change in behavior

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33146>
2025-01-22 02:15:04 +00:00
Marek Olšák
b7c4a1479e glsl: remove dead code due to IO being always lowered
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33146>
2025-01-22 02:15:04 +00:00
Mike Blumenkrantz
48d0a0322f glsl: plumb num_views down to shader_info::view_mask
this is needed for drivers to more effectively compile multiview-enabled
shaders

Reviewed-by: Timothy Arceri <tarceri@itqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33016>
2025-01-20 22:43:23 +00:00
Timothy Arceri
7d41cfa1a9 glsl: enable layout qualifier if OVR_multiview enabled
OVR_multiview requires 1.30 but makes use of layout qualifier

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33074>
2025-01-19 01:10:54 +00:00
Qiang Yu
e5041ef036 docs,src: replace doc and comments for PIPE_CAP with pipe_caps
Use command:
  find . -type d \( -path "./.git" -o -path "./docs/relnotes" \) -prune -o -type f -exec sed -i 's/PIPE_CAP_\([A-Za-z0-9_]*\)/pipe_caps.\L\1/g' {} +
  find . -type d \( -path "./.git" -o -path "./docs/relnotes" \) -prune -o -type f -exec sed -i 's/PIPE_CAPF_\([A-Za-z0-9_]*\)/pipe_caps.\L\1/g' {} +

With manual adjustment for docs/gallium/screen.rst to merge
pipe_cap and pipe_capf section.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32955>
2025-01-17 04:39:47 +00:00
Timothy Arceri
6bca0cc3d9 glsl: drop opt_dead_code_local
This does nothing useful anymore as we now convert to nir at compile
time which will handle all this for us.

shader-db radeonsi:

TOTALS FROM AFFECTED SHADERS (63/168079)
  SGPRS: 3248.00 -> 3208.00 (-1.23 %)
  VGPRS: 2224.00 -> 2228.00 (0.18 %)
  Spilled SGPRs: 0.00 -> 0.00 (0.00 %)
  Spilled VGPRs: 0.00 -> 0.00 (0.00 %)
  Private memory VGPRs: 0.00 -> 0.00 (0.00 %)
  Scratch size: 0.00 -> 0.00 (0.00 %) dwords per thread
  Code Size: 138484.00 -> 138068.00 (-0.30 %) bytes
  Max Waves: 877.00 -> 877.00 (0.00 %)
  Outputs: 0.00 -> 0.00 (0.00 %)
  Patch Outputs: 0.00 -> 0.00 (0.00 %)

shader-db Iris (BDW):

total instructions in shared programs: 17805897 -> 17805917 (<.01%)
instructions in affected programs: 1240 -> 1260 (1.61%)
helped: 0
HURT: 8
HURT stats (abs)   min: 1 max: 4 x̄: 2.50 x̃: 2
HURT stats (rel)   min: 0.39% max: 7.14% x̄: 4.26% x̃: 4.06%
95% mean confidence interval for instructions value: 1.61 3.39
95% mean confidence interval for instructions %-change: 2.01% 6.51%
Instructions are HURT.

total cycles in shared programs: 856868505 -> 856876266 (<.01%)
cycles in affected programs: 2879959 -> 2887720 (0.27%)
helped: 79
HURT: 100
helped stats (abs) min: 1 max: 742 x̄: 61.96 x̃: 12
helped stats (rel) min: <.01% max: 41.84% x̄: 1.17% x̃: 0.20%
HURT stats (abs)   min: 1 max: 1231 x̄: 126.56 x̃: 14
HURT stats (rel)   min: <.01% max: 33.98% x̄: 3.32% x̃: 0.30%
95% mean confidence interval for cycles value: 7.37 79.35
95% mean confidence interval for cycles %-change: 0.29% 2.38%
Cycles are HURT.

LOST:   1
GAINED: 4

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33008>
2025-01-15 02:01:09 +00:00
Mike Blumenkrantz
010732b8ef glsl: enable OVR_multiview if OVR_multiview2 is enabled
according to spec

Fixes: 328c29d600 ("mesa,glsl,gallium: add GL_OVR_multiview")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32946>
2025-01-10 19:10:48 +00:00
Mike Blumenkrantz
3c5eae639d glsl: make gl_ViewID_OVR visible to all shader stages
according to spec

Fixes: 328c29d600 ("mesa,glsl,gallium: add GL_OVR_multiview")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32946>
2025-01-10 19:10:48 +00:00
Marek Olšák
d09ba36f98 glsl: fix corruption due to blake3 hash not being set for nir_opt_undef
NIR is generated sooner, so we need to set it sooner.
This fixes Viewperf13/CATIA_car_04.

Fixes: cbfc225e2b - glsl: switch to a full nir based linker

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32876>
2025-01-06 19:50:51 +00:00
Marek Olšák
451d252ca2 glsl: remove unused code
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32779>
2025-01-06 19:09:18 +00:00
Marek Olšák
dae57e184a glsl,st/mesa: always lower IO for GLSL, unlower IO for drivers
This enables nir_opt_varyings for all gallium drivers.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31942>
2024-12-24 05:54:07 -05:00
Benjamin Lee
becb014d27 nir: treat per-view outputs as arrayed IO
This is needed for implementing multiview in panvk, where the address
calculation for multiview outputs is not well-represented by lowering to
nir_intrinsic_store_output with a single offset.

The case where a variable is both per-view and per-{vertex,primitive} is
now unsupported. This would come up with drivers implementing
NV_mesh_shader or using nir_lower_multiview on geometry, tessellation,
or mesh shaders. No drivers currently do either of these. There was some
code that attempted to handle the nested per-view case by unwrapping
per-view/arrayed types twice, but it's unclear to what extent this
actually worked.

ANV and Turnip both rely on per-view outputs being assigned a unique
driver location for each view, so I've added on option to configure that
behavior rather than removing it.

Signed-off-by: Benjamin Lee <benjamin.lee@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31704>
2024-12-09 20:31:49 +00:00
Timothy Arceri
fcebbfc399 glsl: drop unused array refcount code and tests
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32450>
2024-12-04 11:50:57 +00:00
Timothy Arceri
fd431a5b71 glsl: drop unused ir_equals.cpp
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32448>
2024-12-03 02:46:39 +00:00
Timothy Arceri
05d2fe2372 glsl: remove glsl/program.h
It is now unused.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32402>
2024-11-29 14:31:30 +11:00
Timothy Arceri
8142797721 glsl: move _mesa_glsl_compile_shader() declaration
The function is in glsl_parser_extras.cpp so move the declaration to
glsl_parser_extras.h

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32402>
2024-11-29 14:30:03 +11:00
Timothy Arceri
1f954a207b glsl: remove now unused ir reader
This was used to parse glsl ir in string format and create real ir with
it. It was previously used for some really old test infrastructure which
has now been removed so lets burn this with fire also.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32364>
2024-11-27 22:05:06 +00:00
Timothy Arceri
722f939614 glsl: drop last remaining lower jump test
This test only tests that a redundant continue is removed. This test is
not very useful and there are hundreds of lines of supporting test
infrastructure that can be removed if we drop it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32364>
2024-11-27 22:05:06 +00:00
Timothy Arceri
cf188a0efb glsl: remove return lowering from glsl ir
We don't need it as nir does it for us anyway.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32364>
2024-11-27 22:05:06 +00:00
Timothy Arceri
6c86b56c06 glsl: disable function return lowering in glsl ir
We just let the nir lowering pass do it instead.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32364>
2024-11-27 22:05:06 +00:00
Timothy Arceri
340f7edfba glsl: use symbol table directly for builtin functions
Builtin functions do no make use of gl_shader at all other than to store
a symbol table. So lets just create and use the symbol table directly
instead. This will allow us to drop the symbol table member from
gl_shader in the following patch.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32293>
2024-11-25 23:53:37 +00:00
Timothy Arceri
4ce9421acb glsl: drop _mesa_glsl_copy_symbols_from_table()
Unused since the previous commit

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32293>
2024-11-25 23:53:37 +00:00
Timothy Arceri
3b40db0ef6 glsl: don't copy symbol table to shaders
This is no longer needed since we switched to a full nir base linker. The
symbol table witchcraft is now only used in the ast code.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32293>
2024-11-25 23:53:37 +00:00
Timothy Arceri
7469f99ea1 glsl: remove more now unused params from glsl_to_nir()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32239>
2024-11-21 03:21:08 +00:00
Timothy Arceri
44de5f1c46 Revert "glsl: Move ForceGLSLAbsSqrt handling to glsl-to-nir."
This reverts commit 46bf687882.

We wont be removing this lowering file and having this workaround in
glsl_to_nir() creates a dependency on the const values that we could
otherwise avoid, so lets just move this back. Dropping the consts
will be useful in a follow up series that aims to drop all the glsl
ir function inlining code by converting builtin functions to nir.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32239>
2024-11-21 03:21:08 +00:00
Timothy Arceri
10c292acf6 glsl: remove unused member
Unused since 063d62f142

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32239>
2024-11-21 03:21:08 +00:00
Timothy Arceri
8ac81c5bb4 glsl: tidy up glsl_to_nir() params
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32239>
2024-11-21 03:21:08 +00:00
Alyssa Rosenzweig
3da8444be5 nir: add names to function parameters
SPIR-V has this information. We should try to preserve it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32208>
2024-11-20 16:53:51 +00:00
Timothy Arceri
e34357015c glsl: fix compiler global temp collisions
glsl ir creates these temps to copy global initialiser values for
example. To avoid collisions during linking due to 2 shaders in the same
stage having temps with the same name we make sure to define these as
function variables not shader globals. This will put the temps into the
global instructions wrapper created in 7c5b21c032.

Fixes: cbfc225e2b ("glsl: switch to a full nir based linker")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12136

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32202>
2024-11-20 03:20:47 +00:00
Marek Olšák
4da5b11ca9 nir: add nir_io_separate_clip_cull_distance_arrays to replace PIPE_CAP
to make the flag available in NIR passes

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32173>
2024-11-19 23:48:38 +00:00
Marek Olšák
23eb4f3454 nir: rename nir_io_glsl_opt_varyings to nir_io_dont_optimize and deprecate it
The meaning is negated.

This NIR option is deprecated and shouldn't be used. It means any IO
optimizations can be disabled and it's a currently a workaround for zink,
which is the only driver that asks for it by default. The original option
is replaced by an environment variable for the GLSL linker.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32173>
2024-11-19 23:48:38 +00:00
Rhys Perry
6c07c0b862 glsl/list: remove underscores in foreach_list_typed macros
I'm not sure why they're here, but I find them to be annoying to read.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32225>
2024-11-19 18:59:05 +00:00
Rhys Perry
66df291513 glsl/list: remove parenthesis in foreach_list_typed macros
These are not necessary because __node is only a single token. The
variable declaration wouldn't work otherwise.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32225>
2024-11-19 18:59:05 +00:00
Rhys Perry
02e353a066 glsl/list: add and use helpers in foreach_list_typed macros
This reduces noise when reading them.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32225>
2024-11-19 18:59:05 +00:00
Rhys Perry
17045b9465 glsl/list: add comments above foreach macros
The _safe suffix is misleading.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32225>
2024-11-19 18:59:05 +00:00
Marek Olšák
6cd302dc39 glsl: add a helper for duplicated code calling nir_opt_varyings
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32175>
2024-11-18 11:25:18 +00:00
Timothy Arceri
59b2549279 glsl/nir: fix function cloning at link time
As per the code comment added in this commit the nir produced from
glsl to nir doesn't always keep function declarations before the
code that calls them e.g. calls from within other function
implementations. The change in this commit works around this problem by
first cloning all function declarations in a first pass, then cloning
the implementations in a second pass once we have filled the remap
table.

Fixes: cbfc225e2b ("glsl: switch to a full nir based linker")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12115

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32100>
2024-11-13 22:47:50 +00:00
Marek Olšák
979373d583 glsl: fix accidentally disabling nir_opt_varyings for all drivers
Fixes: adc40aee25 - glsl: lower IO in the linker if enabled, don't lower it later

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31994>
2024-11-06 15:51:51 +00:00
Marek Olšák
2ca56376a4 nir: rename nir_io_glsl_lower_derefs -> nir_io_has_io_intrinsics
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31968>
2024-11-05 14:13:40 +00:00
Marek Olšák
adc40aee25 glsl: lower IO in the linker if enabled, don't lower it later
This removes the useless codepath that kept IO derefs until st_finalize_nir.
It was used before nir_opt_varyings existed.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31968>
2024-11-05 14:13:40 +00:00
Patrick Lerda
5a423d2d9a glsl: fix gl_nir_validate_intrastage_interface_blocks() memory leak
For instance, this issue is triggered on redeonsi with
"piglit/bin/shader_runner tests/spec/glsl-1.50/linker/interface-blocks-multiple-vs-member-count-mismatch.shader_test -auto -fbo":
Indirect leak of 176 byte(s) in 1 object(s) allocated from:
    #0 0x7f894b5cd7ef in __interceptor_malloc (/usr/lib64/libasan.so.6+0xb17ef)
    #1 0x7f894183aebf in ralloc_size ../src/util/ralloc.c:118
    #2 0x7f894183b36e in rzalloc_size ../src/util/ralloc.c:152
    #3 0x7f894183b36e in rzalloc_array_size ../src/util/ralloc.c:232
    #4 0x7f894182da67 in _mesa_hash_table_init ../src/util/hash_table.c:163
    #5 0x7f894182da67 in _mesa_hash_table_create ../src/util/hash_table.c:186
    #6 0x7f894169af03 in gl_nir_validate_intrastage_interface_blocks ../src/compiler/glsl/gl_nir_link_interface_blocks.c:533
    #7 0x7f89414464a4 in link_intrastage_shaders ../src/compiler/glsl/gl_nir_linker.c:2750
    #8 0x7f894144bad2 in gl_nir_link_glsl ../src/compiler/glsl/gl_nir_linker.c:3785
    #9 0x7f894128977e in st_link_glsl_to_nir ../src/mesa/state_tracker/st_glsl_to_nir.cpp:515
    #10 0x7f894128977e in st_link_shader ../src/mesa/state_tracker/st_glsl_to_nir.cpp:1008
    #11 0x7f894113c7b5 in link_program ../src/mesa/main/shaderapi.c:1317
    #12 0x7f894113c7b5 in link_program_error ../src/mesa/main/shaderapi.c:1426
    #13 0x7f8940afb1bb in _mesa_unmarshal_LinkProgram src/mapi/glapi/gen/marshal_generated2.c:1627
    #14 0x7f894063319b in glthread_unmarshal_batch ../src/mesa/main/glthread.c:141
    #15 0x7f894184e658 in util_queue_thread_func ../src/util/u_queue.c:294
    #16 0x7f89418d220a in impl_thrd_routine ../src/c11/impl/threads_posix.c:67
    #17 0x7f894a66a7c3  (/lib64/libc.so.6+0x867c3)
...
SUMMARY: AddressSanitizer: 1392 byte(s) leaked in 11 allocation(s).

Fixes: ffbd763586 ("glsl: add gl_nir_validate_intrastage_interface_blocks()")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31871>
2024-10-28 22:23:29 +00:00
Pierre-Eric Pelloux-Prayer
9434ac65f4 glsl: use nir_io_add_const_offset_to_base in gl_nir_opts
This fixes:
   KHR-GLES32.core.tessellation_shader.tessellation_shader_tessellation.max_in_out_attributes

Without this change the assert in gather_output is hit:
   assert(!nir_src_is_const(offset) || nir_src_as_uint(offset) == 0)

Because nir_opt_algebraic determines that some ssa values are constant,
but the nir_io_add_const_offset_to_base wasn't run afterwards.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31684>
2024-10-25 13:36:54 +00:00
Timothy Arceri
065b45e4dc glsl: remove linker.cpp
All functionality has now been converted to NIR or moved elsewhere.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31500>
2024-10-04 00:10:59 +00:00