Commit graph

167720 commits

Author SHA1 Message Date
SoroushIMG
b3ed037ca8 zink: allocate program shader caches from the program's mem ctx
these will now be freed when the program itself is freed.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
2023-02-13 19:00:06 +00:00
SoroushIMG
6af3a12e70 zink: fix compute shader leaks
Compute program owns the nir and zink shaders now and must free them
too when destroyed.

Fixes: 4cb4bb555e ("zink: create compute programs from compute shaders directly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
2023-02-13 19:00:06 +00:00
Michel Zou
742c77078c ci/mingw: drop useless -Wno-error flags
Will prevent merging incorrect code like in #8260

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21244>
2023-02-13 18:00:34 +00:00
Chia-I Wu
4e03cfa3c6 radv: fix a hang with binning on CHIP_RENOIR
Using (6, 16) for (context_states_per_bin, persistent_states_per_bin)
causes gpu hang in RDR2 benchmark on CHIP_RENOIR.  Follow radeonsi and
use (3, 8) instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21254>
2023-02-13 17:23:53 +00:00
osy
1c72424770 virgl: enable timer queries only if host supports it
Timer queries is tied to GL_ARB_timer_query/GL_EXT_disjoint_timer_query
support on the host. We have a flag that detects this so lets use it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20380>
2023-02-13 16:07:12 +00:00
Alyssa Rosenzweig
f2740ac69c pan/decode: Add support for decoding CSF
Add support to pandecode for Mali architecture v10, featuring the new command
stream frontend (CSF). This replaces the "job chain" with a new Command
Execution Unit (CEU) that runs a domain-specific assembly language. That
requires us to refactor pandecode substantially, splitting out JM-only code from
shared JM/CSF common code, and adding new CSF-only decode routines to
disassemble and interpret CSF command streams and pretty-printing the
data structures hit.

This is of course impossible to do properly, since the CEU is pretty easily
Turing-complete and hence subject to the halting problem. But we implement some
simple heuristics to follow jumps that are just good enough for the simple
command streams emitting by both the DDK and Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20837>
2023-02-13 15:24:10 +00:00
Alyssa Rosenzweig
102d4292d5 panfrost: Fix some fields in v10.xml
Correct some errors from the file's initial check in, as we're about to add
corresponding pandecode changes for the file.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20837>
2023-02-13 15:24:10 +00:00
Alyssa Rosenzweig
39774503b3 asahi: Implement indirect draws
Passes dEQP-GLES31.functional.draw_indirect.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>
2023-02-13 09:51:42 -05:00
Alyssa Rosenzweig
ad3375478c asahi: Refactor index buffer upload for indirect
We need to avoid the reference to draws->count when indirect draws are used, as
it is not available CPU side.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>
2023-02-13 09:51:42 -05:00
Alyssa Rosenzweig
e4731ec335 asahi: Remove default=true on index list values
These will cause issues with indirect draws.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>
2023-02-13 09:51:42 -05:00
Alyssa Rosenzweig
7968c474b8 panvk: Disable SNORM rendering
Driver isn't ready for this yet. 7f98a9ba2b ("panfrost: Implement
GL_EXT_render_snorm on Bifrost+") caused piles of tests to go from NotSupported
-> Fail, so let's functionally revert that.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>
2023-02-13 14:04:52 +00:00
Alyssa Rosenzweig
6142d50375 panvk: Fix varying linking
Since 2316b80d77 ("panfrost: Don't use nir_variable to link varyings"), we can
only get correct type information from the fragment shader inputs (not the
vertex shader output). Fixes piles of CTS regressions.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>
2023-02-13 14:04:52 +00:00
Alyssa Rosenzweig
1ba20868c4 panvk: Take lock when tracing
We're not supposed to call the GENX(pandecode_jc) routines (e.g.
pandecode_jc_v7), since it's an internal interface that expects the caller to
take a lock first. Instead we're supposed to call the non-GenXML pandecode_jc
entrypoint which does the locking properly. Fixes assertion failures when
tracing with recent pandecode:

deqp-vk: ../src/util/simple_mtx.h:142: simple_mtx_assert_locked: Assertion `mtx->val' failed.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>
2023-02-13 14:04:52 +00:00
Karol Herbst
13a4c49cb1 rusticl/program: enable spirv
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19008>
2023-02-13 12:45:07 +00:00
Karol Herbst
2a0b58434d rusticl/kernel: fix clGetKernelInfo CL_KERNEL_ATTRIBUTES for non source programs
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19008>
2023-02-13 12:45:07 +00:00
Marcin Ślusarz
771f7c1d91 anv: bump ANV_MAX_QUEUE_FAMILIES
Now it's possible to overflow anv_physical_device.queue.families
and anv_device.decoder.

CID: 1520852

Fixes: 056b0cb87f ("anv: add video engine support in various places")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21278>
2023-02-13 12:19:45 +00:00
Yusuf Khan
a157133380 nvc0/nv50: support and enable EXT_memory_object*
Passes the ext_external_objects-memory-object-api-errors piglit:

./bin/ext_external_objects-memory-object-api-errors
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem1DEXT(memory=0)
PIGLIT: {"subtest": {"1D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem2DEXT(memory=0)
PIGLIT: {"subtest": {"2D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem3DEXT(memory=0)
PIGLIT: {"subtest": {"3D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem1DEXT(memory=0)
PIGLIT: {"subtest": {"1D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexureStorageMem2DEXT(memory=0)
PIGLIT: {"subtest": {"2D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem3DEXT(memory=0)
PIGLIT: {"subtest": {"3D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem2DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"2D texture ms" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem3DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"3D texture ms" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem2DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"2D texture ms direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem3DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"3D texture ms direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glBufferStorageMemEXT(memory == 0)
PIGLIT: {"subtest": {"buffer storage" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glNamedBufferStorageMemEXT(memory == 0)
PIGLIT: {"subtest": {"buffer storage direct state access" : "pass"}}
Mesa: User error: GL_INVALID_ENUM in glGetUnsignedBytevEXT(pname=0xffffffff)
PIGLIT: {"subtest": {"unsigned-byte-v-bad-enum" : "pass"}}
Mesa: User error: GL_INVALID_ENUM in glGetUnsignedBytei_vEXT(pname=0xffffffff)
PIGLIT: {"subtest": {"unsigned-byte-i-v-bad-enum" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glGetUnsignedBytei_vEXT(pname=GL_DEVICE_UUID_EXT)
PIGLIT: {"subtest": {"unsigned-byte-i-v-bad-value" : "pass"}}

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19405>
2023-02-13 12:03:13 +00:00
Alyssa Rosenzweig
8e1eee8b5e asahi: Add XML for VDM memory barriers
We'll use these in our implementation of transform feedback.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>
2023-02-13 11:45:03 +00:00
Alyssa Rosenzweig
8e0e68510f asahi: Add XML for indirect draws
Nice and simple.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>
2023-02-13 11:45:03 +00:00
Alyssa Rosenzweig
c3b8928b84 asahi: Add XML for indirect dispatch
This splits up the CDM commands into their subparts, after which
indirect dispatch is straightforward.

Also fix the pipeline bits.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>
2023-02-13 11:45:03 +00:00
Alyssa Rosenzweig
3da4838591 asahi: Submit batches that don't touch RTs
If there is any draw, we should submit in case there are active queries,
fragment shader side effects, etc. Together with previous commit fixes
no_attachment framebuffers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21267>
2023-02-13 11:28:07 +00:00
Alyssa Rosenzweig
2c2f189fe7 agx: Write sample mask even with no colour output
Needed for discard to work properly, which has visible side effects with
occlusion queries. Fixes no_attachment framebuffers together with the next
commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21267>
2023-02-13 11:28:07 +00:00
Alyssa Rosenzweig
e785ae6125 agx: Implement load_helper_invocation
Passes dEQP-GLES31.functional.shaders.helper_invocation.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21265>
2023-02-13 11:12:05 +00:00
Alyssa Rosenzweig
6214c9921a agx: Remove bogus gl_Position assertion
It is reasonable not to write gl_Position in a transform feedback program.

Fixes rendering of the apitrace of Domekeeper in #7798.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Alyssa Rosenzweig
eeae9b93de agx: Fix AGX_MAX_CF_BINDINGS
Potentially could be larger with aliasing of component offsets, though that
would be silly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Alyssa Rosenzweig
fbe8878dcb agx: Respect component in frag load_input
Fixes fails in dEQP-GLES31.functional.separate_shader.random.*.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Alyssa Rosenzweig
a5d478d17c agx: Remove unused AGX_MAX_VARYINGS
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Mike Blumenkrantz
b73fe8d52e zink: also replace hash_entry::key when replacing separable program
this otherwise still points to the separable program's shader array
and will access freed memory

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
b5029a90df zink: calloc separable program zink_gfx_library_key struct
this matches other zink_gfx_library_key allocations

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
4cda98c827 zink: implement a scaling descriptor buffer size
previously descriptor buffers were sized to allow for 25,000 descriptors

this is a great number.

but in some scenarios it's overkill, and it's theoretically possible that
it might be underkill in others (citation needed), so add some handling
for both cases to save small amounts of vram on average and not crash
in the distant future when hypercomputers try running drawoverhead

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
453701256d zink: store base descriptor size on the screen
useful to have this around for reuse

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
651f322091 zink: ensure db is bound before separate shader update
seems unlikely but who knows

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
bec6087699 zink: move db_bound to batch descriptor data
this is where descriptor stuff goes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
f57f28a348 zink: move zink_batch_state::db_bound reset to zink_batch_descriptor_reset()
descriptor code goes in descriptor file

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
5b31659650 zink: rename a struct member for clarity
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
27dec4a262 zink: add an io assignment pass for separate shaders
usually this is handled by zink_compiler_assign_io() for full pipelines,
where locations are compacted and variables are eliminated, but separate
shaders still need to have "correct" locations set, which can be achieved
by relying on 'location' instead of the (failed) attempt by the frontend
to set 'driver_location' with nir_assign_io_var_locations()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
13c6ad0038 zink: use a single descriptor buffer for all non-bindless types
the descriptor count (buffer size) calculated for buffers was based
on drawoverhead throughput, which is the fastest descriptors can be changed
at the cpu level. these cases demonstrate the maximum speed that ANY
descriptor can be changed, which means that changing multiple types in
a given cmdbuf will, at best, be the same throughput

thus, instead of allocating a separate buffer for each type, only a single
buffer needs to be allocated, and all descriptors can be bound to this buffer

this should reduce descriptor vram usage by ~80%

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
facb1b7884 zink: rework separate shader descriptor iterating
using the shader struct members is a bit more natural here and
avoids some confusion when one of the stages has no descriptors

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
e6a55bfc16 zink: flag gfx programs as removed-from-cache by default
this fixes some desync where async programs are destroyed before being
added to the cache

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
f70b1732da zink: assert that the found program matches the expected one in shader_free
avoid bugs

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
66f2a1c526 zink: don't fetch/update pipeline cache for separate shader programs
this is illegal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
ffd91ee7a8 zink: fix descriptor pool free iterating
these arrays are sparsely allocated, and using pop() on them will
fail to access some elements

Fixes: cf7c17a7af ("zink: rework descriptor pool overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
16c019142b zink: sync LTO compiles for GPL pipelines on shader free
this avoids invalid access

affects:
KHR-Single-GL46.arrays_of_arrays_gl.InteractionStorageBuffers2

Fixes: 41ffb15de5 ("zink: implement async gfx precompile")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
e8b8279b61 zink: allocate all batch command buffers in one call
just simpler

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Lionel Landwerlin
295dd6f515 intel/dev: add a default urb value for intel_stub_gpu on dg2
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21249>
2023-02-13 09:38:06 +00:00
Samuel Pitoiset
214d6d05ed radv simplify compiling graphics shaders with a mask of active NIR stages
Instead of recomputing the same bitfield everywhere.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Samuel Pitoiset
8dd0b98786 radv: only initialize shader arguments for the active stages
Other stages don't need to be initialized.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Samuel Pitoiset
d05a02018b radv: use last_vgt_api_stage for determining the last stage with XFB
It's shorter and cleaner.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Mike Blumenkrantz
36d8443e5f zink: add a local is_compute var for set_shader_images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
cff6e6e13b zink: pull out image descriptor updating in set_shader_images
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00