Commit Graph

187956 Commits

Author SHA1 Message Date
Timothy Arceri 4655381e3b glsl: remove UsesEndPrimitive field
Here we store the value directly in shader info rather than passing
it around.

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/28709>
2024-04-13 11:36:08 +00:00
Timothy Arceri 1139a703c1 glsl: remove ActiveStreamMask field
There is no need to pass this value around just store it directly
in the shader info.

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/28709>
2024-04-13 11:36:08 +00:00
Timothy Arceri 1e13e9be45 glsl: remove FragDepthLayout field
Nothing uses it. I *looks* like _mesa_copy_linked_program_data()
copies it somewhere useful however that function is called before
the value are even initialised.

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/28709>
2024-04-13 11:36:08 +00:00
Pavel Ondračka 9dc6ea2fad r300: remove nir_to_rc_options wrapper
Just call nir_to_rc directly since we don't have any options anymore.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28663>
2024-04-13 09:49:38 +00:00
Pavel Ondračka b1c98ffd9e r300: move lower_fabb option out of the options struct
It is the last one, we don't need an extra struct for it...

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28663>
2024-04-13 09:49:38 +00:00
Pavel Ondračka 2de9142f9f r300: remove the ntr lower_cmp option
Only used in nir_lower_bool_to_float, so just hardcode the logic there.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28663>
2024-04-13 09:49:38 +00:00
Pavel Ondračka 4735265187 r300: get rid of the unused ubo_vec4_max ntr option
We now do the lowering in finalize_nir.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28663>
2024-04-13 09:49:38 +00:00
Pavel Ondračka 26bb068935 r300: inline unoptimized_ra ntr option
Also remove the check for overflowing 16bit TGSI register index.
If that ever happens we are out of luck anyway, no need to waste CPU
cycles on RA...

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28663>
2024-04-13 09:49:38 +00:00
Marek Olšák 7de43c4fb8 ac: add helper ac_get_ip_type_string to remove duplication
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28607>
2024-04-12 22:22:04 -04:00
Marek Olšák 8597870dcb ac/llvm: simplify the optimization barrier and apply it to the whole vector
Use the same code as the pointer type. It works with all types and works
with any vector, but we need to handle i1 and v3i16 as special cases,
otherwise LLVM fails when it sees them. The previous code only extracted
the first component, which is not what we want.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28607>
2024-04-12 22:22:04 -04:00
Marek Olšák c7e30cdbbb ac/llvm: remove unused fields of ac_shader_abi
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28607>
2024-04-12 22:22:04 -04:00
Marek Olšák 105e22f6fd ac/llvm: remove handling of input and output loads/stores that are lowered
There is a lot that we still use.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28607>
2024-04-12 22:22:04 -04:00
Marek Olšák ce7ca0d80b ac/llvm: allow image loads to return less than 4 components, trim DMASK
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28607>
2024-04-12 22:22:04 -04:00
Marek Olšák c91b56c271 ac/llvm: add support for 16-bit coordinates (A16) for image (non-sampler) opcodes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28607>
2024-04-12 22:22:03 -04:00
Marek Olšák c9ea9e96a7 ac/llvm: simplify extracting an element in get_image_coords
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28607>
2024-04-12 22:20:14 -04:00
Marek Olšák f49cfa9a1c ac/nir: allow 16-bit results for resinfo
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28607>
2024-04-12 22:20:14 -04:00
Marek Olšák 03d241b256 ac/surface: add radeon_surf::thick_tiling
It's not worth writing a compute shader for copying 3D textures yet.
I have a sophisticated compute shader that will do it properly.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28607>
2024-04-12 22:20:14 -04:00
Yiwei Zhang abc327a39a venus: use more relaxed profile for TLS ring seqno wait
Excessive polling for TLS ring synchronous cmds is a waste of cpu
cycles.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28706>
2024-04-13 00:52:22 +00:00
Mike Blumenkrantz 7f246bca04 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28580>
2024-04-12 21:30:45 +00:00
Mike Blumenkrantz 0e0effe59b zink: enable opt_varyings with ZINK_DEBUG=ioopt
uses copied instruction costs from radeonsi for AMD, need info for
other platforms...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28580>
2024-04-12 21:30:45 +00:00
Mike Blumenkrantz 942f3d3a3f zink: add a pass to fix vertex input locations
this is very stupid

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28580>
2024-04-12 21:30:45 +00:00
Mike Blumenkrantz e8c12c82ef zink: set nir_io_glsl_lower_derefs in compiler options
this runs all the io lowering in the frontend and allows for code--

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28580>
2024-04-12 21:30:45 +00:00
Mike Blumenkrantz 163bb2b9c1 zink: rework rework_io_vars
this should be a bit more robust and also maybe even readable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28580>
2024-04-12 21:30:45 +00:00
Mike Blumenkrantz c329ee200f zink: set lower_to_scalar
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28580>
2024-04-12 21:30:45 +00:00
Mike Blumenkrantz 0d756fd0bc zink: set indirect io compiler flags
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28580>
2024-04-12 21:30:45 +00:00
David Heidelberg e511ffea4b ci/intel: sona device_type is back online
Fixes: 44db558cea ("ci: disable sona devices, all devices are offline")
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28721>
2024-04-12 19:37:56 +00:00
Mike Blumenkrantz 2e5d49b3dd gallium: delete PIPE_CAP_NIR_COMPACT_ARRAYS
this is now nir_shader_compiler_options::compact_arrays

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-12 18:43:48 +00:00
Mike Blumenkrantz 44aee09cfb nine: stop checking PIPE_CAP_NIR_COMPACT_ARRAYS and use compact_arrays
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-12 18:43:48 +00:00
Mike Blumenkrantz 8d9c5cc6ed st/program: stop using PIPE_CAP_NIR_COMPACT_ARRAYS and use compact_arrays
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-12 18:43:48 +00:00
Mike Blumenkrantz cba1b03e86 mesa: delete LowerCombinedClipCullDistance from consts
no longer used

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-12 18:43:48 +00:00
Mike Blumenkrantz c9977f8de6 glsl: move an assert from st_context over to avoid using PIPE_CAP_NIR_COMPACT_ARRAYS
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-12 18:43:48 +00:00
Mike Blumenkrantz 9f5e62df89 ttn: stop using PIPE_CAP_NIR_COMPACT_ARRAYS and check compact_arrays
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-12 18:43:48 +00:00
Mike Blumenkrantz 20d0613c13 glsl: stop using PIPE_CAP_NIR_COMPACT_ARRAYS and check compact_arrays
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-12 18:43:48 +00:00
Mike Blumenkrantz d2abc7f9a6 freedreno: set compact_arrays in compiler options
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-12 18:43:48 +00:00
Mike Blumenkrantz 39b66f9c84 intel: set compact_arrays in compiler options
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-12 18:43:48 +00:00
Mike Blumenkrantz d694c1b094 v3d: set compact_arrays in compiler options
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-12 18:43:48 +00:00
Mike Blumenkrantz 7967be922d agx: set compact_arrays in compiler options
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-12 18:43:48 +00:00
Dave Airlie 223aedfa5d egl/dri2: don't bind dri2 for zink
I'm not sure why zink would want dri2 here instead of kopper,
I'm sure it's some side effect of something else, let zink
use the kopper paths.

This fixes:
dEQP-GL45-ES3.info.vendor
on zink on nvk with GL cts using EGL.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fixes: 12a47b84b7 ("egl/dri2: trigger drawable invalidation from surface queries for zink")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28707>
2024-04-12 17:48:51 +00:00
Pavel Ondračka 26836438cb r300: optimize swizzle for inline constants
We can use any swizzle to access it, so if the inline constant is in
ADD,try to have the swizzle same as the second channel so that we can
potentially use presubtract later.

RV530:
total instructions in shared programs: 129366 -> 129306 (-0.05%)
instructions in affected programs: 10191 -> 10131 (-0.59%)
helped: 56
HURT: 12
total presub in shared programs: 8421 -> 8791 (4.39%)
presub in affected programs: 1523 -> 1893 (24.29%)
helped: 0
HURT: 102
total temps in shared programs: 17561 -> 17562 (<.01%)
temps in affected programs: 47 -> 48 (2.13%)
helped: 2
HURT: 4
total lits in shared programs: 3021 -> 3179 (5.23%)
lits in affected programs: 427 -> 585 (37.00%)
helped: 0
HURT: 37
total cycles in shared programs: 197845 -> 197512 (-0.17%)
cycles in affected programs: 18949 -> 18616 (-1.76%)
helped: 50
HURT: 19

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28428>
2024-04-12 15:35:50 +00:00
Pavel Ondračka e34bb4738a r300: move presubtract pass later
We want to move it after rc_remove_constants because we can't reswizzle
presubtract sources and we need to pack multiple uniforms into vec4
slots to be able to run glamor shaders on R400.

This mostly works OK, the detection logic just needs to recognize the
case when 2.0 was converted to inline constant.

RV530:
total instructions in shared programs: 129384 -> 129366 (-0.01%)
instructions in affected programs: 2078 -> 2060 (-0.87%)
helped: 16
HURT: 7
total presub in shared programs: 8404 -> 8421 (0.20%)
presub in affected programs: 423 -> 440 (4.02%)
helped: 19
HURT: 25
total omod in shared programs: 410 -> 429 (4.63%)
omod in affected programs: 10 -> 29 (190.00%)
helped: 0
HURT: 13
total temps in shared programs: 17560 -> 17561 (<.01%)
temps in affected programs: 34 -> 35 (2.94%)
helped: 3
HURT: 3
total lits in shared programs: 3006 -> 3021 (0.50%)
lits in affected programs: 267 -> 282 (5.62%)
helped: 13
HURT: 20
total cycles in shared programs: 197840 -> 197845 (<.01%)
cycles in affected programs: 4159 -> 4164 (0.12%)
helped: 13
HURT: 13

R420:
total instructions in shared programs: 103810 -> 103762 (-0.05%)
instructions in affected programs: 4176 -> 4128 (-1.15%)
helped: 29
HURT: 1
total presub in shared programs: 2724 -> 2878 (5.65%)
presub in affected programs: 478 -> 632 (32.22%)
helped: 6
HURT: 40
total omod in shared programs: 411 -> 421 (2.43%)
omod in affected programs: 3 -> 13 (333.33%)
helped: 0
HURT: 7
total temps in shared programs: 16841 -> 16852 (0.07%)
temps in affected programs: 814 -> 825 (1.35%)
helped: 5
HURT: 17
total cycles in shared programs: 162397 -> 162361 (-0.02%)
cycles in affected programs: 5746 -> 5710 (-0.63%)
helped: 30
HURT: 3

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28428>
2024-04-12 15:35:49 +00:00
Pavel Ondračka a35a158b09 r300: check for the extra restrictions on presubtract swizzles
And don't use presubtract in the first place instead of relying on the
dataflow swizzle pass to sort things up later.

Just two shaders in shader-db hits this, but this patch prevents some
regressions in dEQP when we later move presubtract after the dataflow
swizzle pass.

RV420:
presub helped:   shaders/chromeos/24.shader_test FS:               6 -> 2 (-66.67%)
presub helped:   shaders/chromeos/21.shader_test FS:               6 -> 2 (-66.67%)
cycles helped:   shaders/chromeos/24.shader_test FS:               79 -> 78 (-1.27%)
cycles helped:   shaders/chromeos/21.shader_test FS:               47 -> 46 (-2.13%)

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28428>
2024-04-12 15:35:49 +00:00
Mike Blumenkrantz ede4e4aae3 lavapipe: clamp 32bit query results to low 32 bits rather than MIN
this should be more consistent with hardware driver behavior

cc: mesa-stable

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28671>
2024-04-12 13:36:56 +00:00
Mike Blumenkrantz 129bebd519 llvmpipe: clamp 32bit query results to low 32 bits rather than MIN
this should be more consistent with hardware driver behavior

cc: mesa-stable

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28671>
2024-04-12 13:36:55 +00:00
Martin Krastev 6067426549 svga/ci: add two new piglit flakes to svga
Two more piglit flakes appeared after yesterday's piglit uprev:
  spec@egl_chromium_sync_control@conformance
  spec@egl_chromium_sync_control@conformance@eglGetSyncValuesCHROMIUM_msc_and_sbc_test

Signed-off-by: Martin Krastev <martin.krastev@broadcom.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28712>
2024-04-12 13:06:07 +00:00
Danylo Piliaiev 56dba5489a ir3: Do not set clip/cull mask if no one writes clip/cull
This may happen when undefined value is written into gl_ClipDistance,
then it gets optimized out by nir_opt_undef.

Fixes GPU faults in Tropico 5 (D3D11) on at least A750.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28109>
2024-04-12 11:11:52 +00:00
Lionel Landwerlin 35831dded5 anv: increase maxResourceDescriptorBufferRange on DG2+
The current helper anv_physical_device_bindless_heap_size()
artificially limited the surface heap size on DG2+ to 128MB. The HW is
actually 4GB capable, but we have workaround requiring to overlap the
dynamic state heap with the bindless surface state heap.

The actual limit comes from our virtual address space setup. It is
different between descriptor buffers and regular descriptors.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: fe037dec6e ("anv: expose VK_EXT_descriptor_buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27873>
2024-04-12 10:23:39 +03:00
Samuel Pitoiset c82b8a8153 radv: stop ignoring shader stages that don't need to be imported with GPL
The Vulkan specification has been updated since I wrote this and it's
invalid now.

This marks some tests as expected failures because they are invalid
now and they will be removed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28692>
2024-04-12 06:24:43 +00:00
Patrick Lerda 2b6993cb71 r300: fix r300_draw_elements() behavior
Indeed, the pointer processed by r300_upload_index_buffer() was not the right one.
This is the reason why "deqp-gles2 --deqp-case=dEQP-GLES2.functional.draw.draw_elements.indices.user_ptr.index_byte"
was failing (the logs are below). This change corrects this issue and makes the related deqp tests work properly.

This change considers that r300_upload_index_buffer() sets indexBuffer to NULL. The indexBuffer resource
should be properly freed once the buffer is processed. This is required to avoid another refcnt imbalance
(another kind of memory leak).

==9962==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000721f at pc 0x7fd57b54a9a0 bp 0x7fffd2c39290 sp 0x7fffd2c38a40
READ of size 30 at 0x60200000721f thread T0
    #0 0x7fd57b54a99f in __interceptor_memcpy (/usr/lib64/libasan.so.6.0.0+0x3c99f)
    #1 0x7fd570d10528 in u_upload_data ../src/gallium/auxiliary/util/u_upload_mgr.c:333
    #2 0x7fd57114142b in r300_upload_index_buffer ../src/gallium/drivers/r300/r300_screen_buffer.c:44
    #3 0x7fd57113943c in r300_draw_elements ../src/gallium/drivers/r300/r300_render.c:632
    #4 0x7fd57113bbc4 in r300_draw_vbo ../src/gallium/drivers/r300/r300_render.c:840
    #5 0x7fd570d212e2 in u_vbuf_draw_vbo ../src/gallium/auxiliary/util/u_vbuf.c:1487
    #6 0x7fd56fceb873 in _mesa_validated_drawrangeelements ../src/mesa/main/draw.c:1709
    #7 0x7fd56fcf28c5 in _mesa_DrawElementsBaseVertex ../src/mesa/main/draw.c:1852

Fixes: 330d0607ed ("gallium: remove pipe_index_buffer and set_index_buffer")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28523>
2024-04-12 05:05:27 +00:00
Timothy Arceri 9e056fc962 glsl: remove now unused do_dead_functions()
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28690>
2024-04-12 12:17:31 +10:00
Timothy Arceri 875ca9ec11 glsl: move validate_{stage}_shader_executable() to the nir linker
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/28690>
2024-04-12 12:17:31 +10:00