summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
14 daysanv: add missing data flush out of L3 for transform feedback writesLionel Landwerlin2-4/+1
Fixes zink's piglit.spec.arb_shader_image_load_store.host-mem-barrier on TGL Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: mesa-stable Reviewed-by: Francisco Jerez <currojerez@riseup.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28492>
2024-03-30asahi: be robust against tess batch changesAlyssa Rosenzweig2-4/+12
fixes faults in arb_shader_image_load_store-coherency Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28483>
2024-03-30asahi: implement CDM stream linking for GSAlyssa Rosenzweig1-12/+31
fixes crash with massive #s of geometry shader draws, as seen in arb_shader_image_load_store-coherency Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28483>
2024-03-21ac/llvm,radeonsi: fix memory leaks triggered by ac_nir_translate() errorsPatrick Lerda4-7/+6
For instance, this issue is triggered with "piglit/bin/glslparsertest tests/spec/arb_bindless_texture/compiler/images/arith-bound-image.frag pass 3.30 GL_ARB_bindless_texture GL_ARB_shader_image_load_store": Direct leak of 176 byte(s) in 1 object(s) allocated from: #0 0x7f84c3fbe9a7 in calloc (/usr/lib64/libasan.so.6+0xb19a7) #1 0x7f84ba7e0801 in ac_nir_translate ../src/amd/llvm/ac_nir_to_llvm.c:4391 #2 0x7f84ba53fdf4 in si_llvm_translate_nir ../src/gallium/drivers/radeonsi/si_shader_llvm.c:759 #3 0x7f84ba542bb7 in si_llvm_compile_shader ../src/gallium/drivers/radeonsi/si_shader_llvm.c:836 #4 0x7f84ba337b8e in si_compile_shader ../src/gallium/drivers/radeonsi/si_shader.c:2874 #5 0x7f84ba43a7c1 in si_init_shader_selector_async ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:3176 #6 0x7f84b81c3448 in util_queue_thread_func ../src/util/u_queue.c:309 #7 0x7f84b821ea6a in impl_thrd_routine ../src/c11/impl/threads_posix.c:67 #8 0x7f84c2fea38a (/lib64/libc.so.6+0x8438a) Direct leak of 136 byte(s) in 1 object(s) allocated from: #0 0x7f84c3fbff57 in operator new(unsigned long) (/usr/lib64/libasan.so.6+0xb2f57) #1 0x7f84b1a5f749 in LLVMCreateBuilderInContext (/usr/local/lib64/libLLVM-17.so+0xc84749) #2 0x7f84ba7817b0 in ac_llvm_context_init ../src/amd/llvm/ac_llvm_build.c:54 #3 0x7f84ba542b7a in si_llvm_context_init ../src/gallium/drivers/radeonsi/si_shader_llvm.c:120 #4 0x7f84ba542b7a in si_llvm_compile_shader ../src/gallium/drivers/radeonsi/si_shader_llvm.c:832 #5 0x7f84ba337b8e in si_compile_shader ../src/gallium/drivers/radeonsi/si_shader.c:2874 #6 0x7f84ba43a7c1 in si_init_shader_selector_async ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:3176 #7 0x7f84b81c3448 in util_queue_thread_func ../src/util/u_queue.c:309 #8 0x7f84b821ea6a in impl_thrd_routine ../src/c11/impl/threads_posix.c:67 #9 0x7f84c2fea38a (/lib64/libc.so.6+0x8438a) Indirect leak of 176 byte(s) in 1 object(s) allocated from: #0 0x7f84c3fbe7ef in __interceptor_malloc (/usr/lib64/libasan.so.6+0xb17ef) #1 0x7f84b81b9b3f in ralloc_size ../src/util/ralloc.c:118 #2 0x7f84b81b9fee in rzalloc_size ../src/util/ralloc.c:152 #3 0x7f84b81b9fee in rzalloc_array_size ../src/util/ralloc.c:232 #4 0x7f84b81b05c7 in _mesa_hash_table_init ../src/util/hash_table.c:163 #5 0x7f84b81b05c7 in _mesa_hash_table_create ../src/util/hash_table.c:186 #6 0x7f84ba7e06ae in ac_nir_translate ../src/amd/llvm/ac_nir_to_llvm.c:4381 #7 0x7f84ba53fdf4 in si_llvm_translate_nir ../src/gallium/drivers/radeonsi/si_shader_llvm.c:759 #8 0x7f84ba542bb7 in si_llvm_compile_shader ../src/gallium/drivers/radeonsi/si_shader_llvm.c:836 #9 0x7f84ba337b8e in si_compile_shader ../src/gallium/drivers/radeonsi/si_shader.c:2874 #10 0x7f84ba43a7c1 in si_init_shader_selector_async ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:3176 #11 0x7f84b81c3448 in util_queue_thread_func ../src/util/u_queue.c:309 #12 0x7f84b821ea6a in impl_thrd_routine ../src/c11/impl/threads_posix.c:67 #13 0x7f84c2fea38a (/lib64/libc.so.6+0x8438a) Indirect leak of 176 byte(s) in 1 object(s) allocated from: #0 0x7f84c3fbe7ef in __interceptor_malloc (/usr/lib64/libasan.so.6+0xb17ef) #1 0x7f84b81b9b3f in ralloc_size ../src/util/ralloc.c:118 #2 0x7f84b81b9fee in rzalloc_size ../src/util/ralloc.c:152 #3 0x7f84b81b9fee in rzalloc_array_size ../src/util/ralloc.c:232 #4 0x7f84b81b05c7 in _mesa_hash_table_init ../src/util/hash_table.c:163 #5 0x7f84b81b05c7 in _mesa_hash_table_create ../src/util/hash_table.c:186 #6 0x7f84ba7e06e4 in ac_nir_translate ../src/amd/llvm/ac_nir_to_llvm.c:4382 #7 0x7f84ba53fdf4 in si_llvm_translate_nir ../src/gallium/drivers/radeonsi/si_shader_llvm.c:759 #8 0x7f84ba542bb7 in si_llvm_compile_shader ../src/gallium/drivers/radeonsi/si_shader_llvm.c:836 #9 0x7f84ba337b8e in si_compile_shader ../src/gallium/drivers/radeonsi/si_shader.c:2874 #10 0x7f84ba43a7c1 in si_init_shader_selector_async ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:3176 #11 0x7f84b81c3448 in util_queue_thread_func ../src/util/u_queue.c:309 #12 0x7f84b821ea6a in impl_thrd_routine ../src/c11/impl/threads_posix.c:67 #13 0x7f84c2fea38a (/lib64/libc.so.6+0x8438a) Indirect leak of 128 byte(s) in 1 object(s) allocated from: #0 0x7f84c3fbe7ef in __interceptor_malloc (/usr/lib64/libasan.so.6+0xb17ef) #1 0x7f84b81b9b3f in ralloc_size ../src/util/ralloc.c:118 #2 0x7f84b81b046c in _mesa_hash_table_create ../src/util/hash_table.c:182 #3 0x7f84ba7e06e4 in ac_nir_translate ../src/amd/llvm/ac_nir_to_llvm.c:4382 #4 0x7f84ba53fdf4 in si_llvm_translate_nir ../src/gallium/drivers/radeonsi/si_shader_llvm.c:759 #5 0x7f84ba542bb7 in si_llvm_compile_shader ../src/gallium/drivers/radeonsi/si_shader_llvm.c:836 #6 0x7f84ba337b8e in si_compile_shader ../src/gallium/drivers/radeonsi/si_shader.c:2874 #7 0x7f84ba43a7c1 in si_init_shader_selector_async ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:3176 #8 0x7f84b81c3448 in util_queue_thread_func ../src/util/u_queue.c:309 #9 0x7f84b821ea6a in impl_thrd_routine ../src/c11/impl/threads_posix.c:67 #10 0x7f84c2fea38a (/lib64/libc.so.6+0x8438a) Indirect leak of 128 byte(s) in 1 object(s) allocated from: #0 0x7f84c3fbe7ef in __interceptor_malloc (/usr/lib64/libasan.so.6+0xb17ef) #1 0x7f84b81b9b3f in ralloc_size ../src/util/ralloc.c:118 #2 0x7f84b81b046c in _mesa_hash_table_create ../src/util/hash_table.c:182 #3 0x7f84ba7e06ae in ac_nir_translate ../src/amd/llvm/ac_nir_to_llvm.c:4381 #4 0x7f84ba53fdf4 in si_llvm_translate_nir ../src/gallium/drivers/radeonsi/si_shader_llvm.c:759 #5 0x7f84ba542bb7 in si_llvm_compile_shader ../src/gallium/drivers/radeonsi/si_shader_llvm.c:836 #6 0x7f84ba337b8e in si_compile_shader ../src/gallium/drivers/radeonsi/si_shader.c:2874 #7 0x7f84ba43a7c1 in si_init_shader_selector_async ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:3176 #8 0x7f84b81c3448 in util_queue_thread_func ../src/util/u_queue.c:309 #9 0x7f84b821ea6a in impl_thrd_routine ../src/c11/impl/threads_posix.c:67 #10 0x7f84c2fea38a (/lib64/libc.so.6+0x8438a) SUMMARY: AddressSanitizer: 920 byte(s) leaked in 6 allocation(s). Fixes: d92d35c9db6d ("ac/llvm: add a return value to ac_nir_translate") Signed-off-by: Patrick Lerda <patrick9876@free.fr> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28099>
2024-03-13zink: add a pass to strip out multisample storage image opsMike Blumenkrantz2-3/+56
ARB_shader_image_load_store requires that drivers can compile shaders containing these tokens, but it doesn't require that they can execute them. thus, deleting the multisample component is fine since these shaders will never be executed affects/fixes: KHR-GL46.gl_spirv.spirv_validation_capabilities_test Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28078>
2024-01-16zink/ci: skip more arb_shader_image_load_store.* on Polaris10/Navi10Samuel Pitoiset2-0/+8
This subset seems to be the root cause of the recent GPU hangs that have been uncovered since a077c14f150 ("zink: Fix resizable BAR detection logic"). Skip it completely until the issue is correctly fixed. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27077>
2023-12-09agx: handle force early-z + discardAlyssa Rosenzweig1-40/+61
fixes ./arb_shader_image_load_store-early-z. experimentally, an opaque pass type works too but better match what the blob does. also, I now have proof that sample_mask triggers occlusion query updates because if you run it multiple times, you get >1 hits per fragment in a counting query :p Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09agx: remove spurious z/s writes in force early-z shadersAlyssa Rosenzweig2-3/+12
fixes crash in arb_shader_image_load_store-early-z Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09asahi: flush before resource transitionAlyssa Rosenzweig1-0/+6
otherwise data_valid is not valid! fixes arb_shader_image_load_store-bitcast and who knows what else. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09asahi: defer texture packing to draw-timeAlyssa Rosenzweig2-37/+19
needed for correctness with layout transitions. fixes arb_shader_image_load_store-host-mem-barrier Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09asahi: use 2D descriptors for cubesAlyssa Rosenzweig3-31/+50
fixes arb_shader_image_load_store-invalid case imageLoad/address bounds test/imageCube/rgba32f this is also better codegen since it avoids the wacko division by 6. although it creates a div by 6 in imageSize, that's better because that one is much more likely to hoist to the preamble. probably should've done this from the start. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09asahi: handle null PBEAlyssa Rosenzweig1-8/+27
fixes some subcases of arb_shader_image_load_store-invalid Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-11-11radeonsi: fix piglit image coherency test when use acoQiang Yu1-0/+4
spec@arb_shader_image_load_store@coherency will write to coherent image in tess shader and read it in fragmant shader. There is a geometry shader in between. When lower ngg for the geometry shader, it will wait memory writes before pos0 export if there's no param output to prevent fragment shader start early and read any previous memory writes. We need to update the memory writes info of GS with ES ones because ES and GS is merged into one shader but when nir they are separated. LLVM does not have this problem because it will add memory write wait at the beginning of GS automatically. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26122>
2023-11-07agx: Legalize image MS indexAlyssa Rosenzweig2-7/+12
Fix 2D MSAA Array tests in arb_shader_image_load_store-max-size Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-04-17r600: fix refcnt imbalance related to evergreen_set_shader_images()Patrick Lerda1-1/+2
Indeed, the reference was overwritten. For instance, this issue is triggered with: "piglit/bin/shader_runner tests/spec/arb_shader_image_load_store/execution/write-to-rendered-image.shader_test -auto -fbo" while setting GALLIUM_REFCNT_LOG=refcnt.log. Fixes: a6b379284365 ("r600: add core pieces of image support.") Signed-off-by: Patrick Lerda <patrick9876@free.fr> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22394>
2023-04-04r600: fix typo that could lead to a possible crashPatrick Lerda1-1/+1
For instance, with "piglit/bin/arb_shader_image_load_store-host-mem-barrier --quick -auto -fbo": ==18549==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61200000a059 at pc 0x7f65d8937b80 bp 0x7fff6ed19a00 sp 0x7fff6ed199f8 READ of size 1 at 0x61200000a059 thread T0 #0 0x7f65d8937b7f in evergreen_set_shader_images ../src/gallium/drivers/r600/evergreen_state.c:4277 #1 0x7f65d6b471b8 in st_bind_images ../src/mesa/state_tracker/st_atom_image.c:172 #2 0x7f65d6b76b26 in st_validate_state ../src/mesa/state_tracker/st_util.h:129 #3 0x7f65d6b76b26 in prepare_draw ../src/mesa/state_tracker/st_draw.c:88 #4 0x7f65d6b77c8a in st_draw_gallium ../src/mesa/state_tracker/st_draw.c:141 #5 0x7f65d72698a2 in _mesa_draw_arrays ../src/mesa/main/draw.c:1202 Fixes: a6b379284365 ("r600: add core pieces of image support.") Signed-off-by: Patrick Lerda <patrick9876@free.fr> Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22273>
2023-03-15radeonsi: fix memory leak related to ureg_get_tokens()Patrick Lerda1-0/+2
Indeed, ureg_get_tokens() returns an allocated string that should be freed using ureg_free_tokens(). For instance, with "piglit/bin/arb_shader_image_load_store-invalid -auto -fbo" Direct leak of 768 byte(s) in 2 object(s) allocated from: #0 0x7fa819a78b48 in __interceptor_realloc (/usr/lib64/libasan.so.6+0xb1b48) #1 0x7fa80e189e04 in tokens_expand ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:239 #2 0x7fa80e189e04 in get_tokens ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:262 #3 0x7fa80e191f6e in copy_instructions ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2079 #4 0x7fa80e191f6e in ureg_finalize ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2129 #5 0x7fa80e19447b in ureg_get_tokens ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2206 #6 0x7fa80ec68b91 in si_create_fmask_expand_cs ../src/gallium/drivers/radeonsi/si_shaderlib_tgsi.c:564 Signed-off-by: Patrick Lerda <patrick9876@free.fr> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21871>
2022-12-14iris: Drop disable_rb_aux_buffer handling for image viewsKenneth Graunke1-15/+5
The goal here is to support OpenGL 4.6 section 9.3, "Feedback Loops Between Textures and the Framebuffer" (from GL_ARB_texture_barrier) where you can bind an image as both a framebuffer attachment and a texture, and simultaneously sample-from and render-to it. I'm not aware of any spec language that requires us to handle simultaneously accessing something as a framebuffer attachment and an image load/store resource. GL_ARB_shader_image_load_store tends to make flushing and synchronization something the app has to handle explicitly rather than something the driver needs to do implicitly. Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19060>
2022-07-24r600/dri-tweak: Disable ARB_shader_image_load_store for "Tomb Raider 2013"Gert Wollny1-0/+6
When "Depth of Field" is set to Ultra, a compute shader is emitted that results in Hardware hangs when OpenGL > 4.3 is available. If the option is enabled, the game will hang at the menu screen so that it is no longer possible to simply change the option back. To avoid this disable the extension for this game until the shader emission can be fixed. Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6857 Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17728>
2022-05-23lima: enable PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENTVasily Khoruzhick2-1/+2
It looks like we don't need to do anything special to enable it. Piglit spec@arb_buffer_storage@bufferstorage-persistent skip: 16 => skip: 12, pass: 4. The rest require GL_ARB_shader_image_load_store Reviewed-by: Erico Nunes <nunes.erico@gmail.com> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16660>
2022-05-10zink: fix null buffer/surface formatsMike Blumenkrantz3-9/+5
4-component formats are needed here in order to return the correct alpha value in invalid load scenarios cc: mesa-stable fixes: spec@arb_shader_image_load_store@invalid Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16167>
2022-03-03zink: emit Aliased decorations for any image that isn't explicitly marked ↵Mike Blumenkrantz1-0/+15
restrict these might be aliased fixes: arb_shader_image_load_store-restrict fixes #6090 Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15217>
2022-01-25svga: enable PIPE_CAP_IMAGE_STORE_FORMATTED on gl43 capable deviceNeha Bhende1-0/+2
With upstream mesa PIPE_CAP_IMAGE_STORE_FORMATTED needs to be set to enable ARB_shader_image_load_store extension. This will reenable GL43 support for svga GL43 capable device Fixes: 3b81d2d30dab ('mesa/st: do not expose ARB_shader_image_load_store if not fully implemented') Tested with glretrace Reviewed-by: Charmaine Lee <charmainel@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14688>
2022-01-13v3d/doc: do not expose ARB_shader_image_load_storeJuan A. Suarez Romero1-1/+1
V3D does not support formatless writings. Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14288>
2022-01-13mesa: fix MAX_GEOMETRY_IMAGE_UNIFORMS check supportJuan A. Suarez Romero1-2/+3
MAX_GEOMETRY_IMAGE_UNIFORMS are supported if geometry shaders and either ARB_shader_image_load_store or GLES 3.1 are supported. v2: - MAX_GEOMETRY_IMAGE_UNIFORMS shouldn't be supported for GL 3.2 if ARB_shader_image_load_store is not supported (Ilia). - MAX_TESS_{CONTROL,EVALUATION}_IMAGE_UNIFORMS requires tessellation shader support (Anholt). v3: - Use _mesa_is_gles31() function (Ilia). Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14288>
2022-01-13mesa/st: do not expose ARB_shader_image_load_store if not fully implementedJuan A. Suarez Romero4-8/+14
So far we were checking ARB_shader_image_load_store is supported as requirement to expose GLES 3.1. But when this extension functionality was added in GLES 3.1 spec, it was relaxed, and one of its requirements, the support for formatless writing, was not included. So this means that a driver that support all the extension functionality except formatless writing, could expose GLES 3.1, but it couldn't expose the extension itself (nor GL 4.2, which requires fully implementation of the extension). v2: - Add the same exposure treatment to ARB_shader_image_size (Ilia). v3: - Remove dependency for OES_texture_buffer (Ilia). - Check image resources for GLES 3.1 (Ilia). v4: - Check for MaxImageUniforms in compute shader (Ilia). - Check for max combined image uniforms/ssbo (Ilia). v5: - Remove ARB_shader_image_load_store from check (Ilia). - ARB_shader_image_store and ARB_shader_image required for ARB_ES3_1_compatibility (Ilia). Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14288>
2021-12-04nv50: don't claim support for format-less storesIlia Mirkin1-1/+1
This is not supported, nor is there any need to support it -- ES 3.1 doesn't need it, and we're in no danger of supporting ARB_shader_image_load_store (among other things, it requires frag images). Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14050>
2021-11-10freedreno: Fix constant-index assumptions in IBO loads.Emma Anholt4-21/+24
The encoder already sets up our IBO accesses as potentially nonuniform, so we just need to be careful to not try to force the IBO index into an immediate. Fixes assertion failures in piglit arb_shader_image_load_store-invalid (intermittent due to https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/597), which had some interesting actual failures hidden behind it. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13601>
2021-06-09mesa: always expose NV_image_formats and OES_shader_image_atomicIlia Mirkin1-2/+2
As a result of some previous changes, it is now possible to expose ES 3.1 without having the ARB_shader_image_load_store enable set. However we still want those other extensions. When there's a driver that's capable of exposing ES 3.1 but not these extensions, more caps can be added. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11204>
2021-05-28gallivm: fix oob imageLoad with formats that have <4 componentsMike Blumenkrantz1-1/+7
it's expected that these loads will have full alpha fixes spec@arb_shader_image_load_store@invalid Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11049>
2021-05-18r600/sfn: legalize image access on CaymanGert Wollny1-0/+6
This, seems to avoid hardware resets with the ARB_shader_image_load_store-invalid piglit. Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-03-03tgsi_exec: Jump over entirely non-taken THEN or ELSE branches.Eric Anholt1-3/+10
TGSI has these nice labels for us for where to jump in this case, let's use them. Improves piglit arb_shader_image_load_store-shader-mem-barrier runtime massively, though not enough to make the test really reasonable to run. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9347>
2021-03-03nir/vec_to_movs: Don't generate MOVs for undef channels.Eric Anholt1-0/+4
This appeared in softpipe's image operations, since NIR always uses 4-component values for the coords, while the GLSL IR only has 2 components for a 2D image (for example). arb_shader_image_load_store-shader-mem-barrier (which times out in CI and spends its time inside of tgsi_exec) was spending 4/51 of its instructions on moving these undefs around. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9345>
2021-01-25docs: Mark some ES3 zink features completeAdam Jackson1-13/+13
These are already enabled: - GL_ARB_draw_indirect - GL_ARB_framebuffer_no_attachments - GL_ARB_shader_atomic_counters - GL_ARB_shader_image_load_store - GL_ARB_shader_image_size - GL_ARB_stencil_texturing - GL_ARB_texture_multisample - GS5 Enhanced textureGather - GS5 Packing/bitfield/conversion functions - GL_KHR_robustness - GL_KHR_texture_compression_astc_ldr - GL_OES_sample_variables - GL_OES_shader_multisample_interpolation Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8701>
2020-10-28docs/features: Update extensions for swrAdam Jackson1-10/+10
The following are all supported: - GL_ARB_shader_atomic_counters - GL_ARB_shader_image_load_store - GL_ARB_shader_image_size - GL_ARB_texture_multisample - GL_KHR_texture_compression_astc_ldr - GL_KHR_texture_compression_astc_sliced_3d - GL_OES_texture_float - GL_OES_texture_float_linear - GL_OES_texture_half_float - GL_OES_texture_half_float_linear Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7281>
2020-07-09glsl: only allow 32 bits atomic operations on imagesPierre-Eric Pelloux-Prayer1-0/+44
EXT_shader_image_load_store says: The format of the image unit must be in the "1x32" equivalence class otherwise the atomic operation is invalid. ARB_shader_image_load_store says: We will only support 32-bit atomic operations on images Fixes: fc0a2e5d017 ("glsl: add EXT_shader_image_load_store new image functions") Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5688>
2019-08-27llvmpipe: enable ARB_shader_image_load_storeDave Airlie1-1/+2
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2019-08-06glsl: add EXT_shader_image_load_store keywords to lexerPierre-Eric Pelloux-Prayer1-36/+36
All of them already existed for ARB_shader_image_load_store. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-03-19gallium: Add PIPE_BARRIER_UPDATE_BUFFER and UPDATE_TEXTURE bits.Kenneth Graunke8-16/+44
The glMemoryBarrier() function makes shader memory stores ordered with respect to things specified by the given bits. Until now, st/mesa has ignored GL_TEXTURE_UPDATE_BARRIER_BIT and GL_BUFFER_UPDATE_BARRIER_BIT, saying that drivers should implicitly perform the needed flushing. This seems like a pretty big assumption to make. Instead, this commit opts to translate them to new PIPE_BARRIER bits, and adjusts existing drivers to continue ignoring them (preserving the current behavior). The i965 driver performs actions on these memory barriers. Shader memory stores go through a "data cache" which is separate from the render cache and other read caches (like the texture cache). All memory barriers need to flush the data cache (to ensure shader memory stores are visible), and possibly invalidate read caches (to ensure stale data is no longer visible). The driver implicitly flushes for most caches, but not for data cache, since ARB_shader_image_load_store introduced MemoryBarrier() precisely to order these explicitly. I would like to follow i965's approach in iris, flushing the data cache on any MemoryBarrier() call, so I need st/mesa to actually call the pipe->memory_barrier() callback. Fixes KHR-GL45.shader_image_load_store.advanced-sync-textureUpdate and Piglit's spec/arb_shader_image_load_store/host-mem-barrier on the iris driver. Roland said this looks reasonable to him. Reviewed-by: Eric Anholt <eric@anholt.net>
2019-03-08iris: Use copy_region and staging resources to avoid transfer stallsKenneth Graunke4-14/+161
This is similar to intel_miptree_map_blit and intel_buffer_object.c's temporary blits in i965. Improves performance of DiRT Rally by 20-25% by eliminating stalls. Breaks piglit's spec/arb_shader_image_load_store/host-mem-barrier, by using the GPU to do uploads, exposing a st/mesa issue where it doesn't give us memory_barrier() calls. This is a pre-existing issue and will be fixed by a later patch (currently out for review).
2018-05-23i965: Use intel_bufferobj_buffer() wrapper in image surface state setup.Francisco Jerez1-3/+5
Instead of directly using intel_obj->buffer. Among other things intel_bufferobj_buffer() will update intel_buffer_object:: gpu_active_start/end, which are used by glBufferSubData() to decide which path to take. Fixes a failure in the Piglit ARB_shader_image_load_store-host-mem-barrier Buffer Update/WaW tests, which could be reproduced with a non-standard glGetTexSubImage implementation (see bug report). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105351 Reported-by: Nanley Chery <nanleychery@gmail.com> Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2018-03-02intel/compiler: Memory fence commit must always be enabled for gen10+Anuj Phogat1-1/+3
Commit bit in the message descriptor (Bit 13) must be always set to true in CNL+ for memory fence messages. It also fixes a piglit GPU hang on cnl+ in simulation environment. Piglit test: arb_shader_image_load_store-shader-mem-barrier See HSD ES # 1404612949 Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2018-02-28r600/shader: when using images always load thread id gpr at start (v2)Dave Airlie1-15/+7
The delayed loading code was fail if we had control flow. This fixes: tests/spec/arb_shader_image_load_store/execution/image_checkerboard.shader_test v2: don't use temp_reg before setting temp_reg up. Tested-by: Gert Wollny <gw.fossdev@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-02-21glsl: Parse 'layout' as a token with advanced blending or bindlessKenneth Graunke1-0/+2
Both KHR_blend_equation_advanced and ARB_bindless_texture provide layout qualifiers, and are exposed in compatibility contexts. We need to parse the layout qualifier as a token in order for those to work, but forgot to extend this check. ARB_shader_image_load_store would need a similar treatment, but we don't expose that in legacy OpenGL contexts. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105161 Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2018-02-09radeonsi/nir: gather some missing fs infoTimothy Arceri1-0/+5
Fixes some early-z arb_shader_image_load_store piglit tests. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-02-09ac: pass struct ac_llvm_context to emit_membar()Timothy Arceri1-3/+3
Fixes segfault in piglit test: ./bin/arb_shader_image_load_store-shader-mem-barrier --quick -auto -fbo Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-01-23ac: fix image load store for GLSL_SAMPLER_DIM_3DTimothy Arceri1-1/+3
Fixes the following piglit tests: arb_shader_image_load_store/layer/image3d/layered binding test arb_shader_image_load_store/max-size/image3d max size test/2048x8x8x1 arb_shader_image_load_store/max-size/image3d max size test/8x2048x8x1 arb_shader_image_load_store/max-size/image3d max size test/8x8x2048x1 arb_shader_image_load_store/semantics/imageload/vertex shader/rgba32f/image3d test Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-12-01r600/cayman: looks like cmpxchg moved to ZDave Airlie1-2/+5
On cayman it appears the cmp component is now in Z. Fixes: arb_shader_image_load_store-dead-fragments on cayman. Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-11-17r600: enable ARB_shader_image_load_store, ARB_shader_image_sizeDave Airlie1-3/+9
This also enables GL4.2 for gpus with hw fp64 (cayman, cypress) Tested-By: Gert Wollny <gw.fossdev@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-05-06glsl: make sampler/image types as 64-bitSamuel Pitoiset2-2/+8
The ARB_bindless_texture spec says: "Samplers are represented using 64-bit integer handles." and, "Images are represented using 64-bit integer handles." It seems simpler to always consider sampler and image types as 64-bit unsigned integer. This introduces a temporary workaround in _mesa_get_uniform() because at this point no flag are used to distinguish between bound and bindless samplers. This is going to be removed in a separate series. This avoids breaking arb_shader_image_load_store-state. v3: - update the comment slightly Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>