Commit graph

186288 commits

Author SHA1 Message Date
Christian Gmeiner
20022f5389 etnaviv: isa: Add branch_any opcode
Encoded instruction is taken from blob running:
- dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.get_uniform.basic.bvec3_api_int_both

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27871>
2024-03-12 17:02:43 +00:00
Christian Gmeiner
6a71636179 etnaviv: isa: Correct dp2 opcode
Encoded instruction is taken from blob running:
- dEQP-GLES2.functional.shaders.operator.geometric.refract.highp_vec2_float_vertex

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27871>
2024-03-12 17:02:43 +00:00
Christian Gmeiner
47106e0f80 etnaviv: isa: Add bit_extract opcode
Encoded instruction is taken from blob running:
- dEQP-GLES31.functional.shaders.builtin_functions.integer.bitfieldextract.int_lowp_vertex

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27871>
2024-03-12 17:02:43 +00:00
Christian Gmeiner
3b4cbbf0d2 etnaviv: isa: Add norm_dp2, norm_dp3 and norm_dp4 opcodes
Encoded instructions are taken from blob running:
- dEQP-GLES2.functional.shaders.operator.geometric.normalize.mediump_vec2_vertex
- dEQP-GLES2.functional.shaders.operator.geometric.normalize.mediump_vec3_vertex
- dEQP-GLES2.functional.shaders.operator.geometric.normalize.mediump_vec4_vertex

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27871>
2024-03-12 17:02:43 +00:00
Christian Gmeiner
4cd779af3f etnaviv: isa: Add frc opcode
Encoded instruction is taken from blob running:
- dEQP-GLES2.functional.shaders.operator.common_functions.fract.mediump_vec4_vertex

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27871>
2024-03-12 17:02:43 +00:00
Christian Gmeiner
ede0008c16 etnaviv: isa: Add dsx and dsy opcodes
Encoded instructions are taken from blob running:
- dEQP-GLES3.functional.shaders.derivate.dfdx.texture.basic.float_highp
- dEQP-GLES3.functional.shaders.derivate.dfdy.texture.basic.float_highp

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27871>
2024-03-12 17:02:43 +00:00
Christian Gmeiner
031c2c26df etnaviv: isa: Remove duplicate #instruction-alu-atomic
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27871>
2024-03-12 17:02:43 +00:00
Mike Blumenkrantz
0f66589c2a mesa: force rendertarget usage on required-renderable formats
the existing guesswork during format selection for teximage is
accurate most of the time, but it's not accurate all of the time.
GL/ES each have a set of sized formats that are required to be
color renderable, and so any time one of these is allocated as a
texture, it MUST have the rendertarget usage bit attached so that
it can later be bound as a framebuffer attachment

an alternative might be to relax this and then try to do migration
to a different format/buffer later if necessary, but that's hard and
probably not actually as useful

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28055>
2024-03-12 14:22:17 +00:00
Erik Faye-Lund
d7def3ccdf panfrost: add pan_force_afbc_packing driconf
This is useful for forcing AFBC-P to be used in applications where it's
know to work well. This can significantly reduce memory consumption and
bandwidth, leading more applications working in the first place, and
also better performance.

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27916>
2024-03-12 12:44:49 +00:00
Erik Faye-Lund
2bcdc4939c panfrost: add driconf infrastructure
This is the boiler-plate code needed to support driver-specific driconf
variables in Panfrost.

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27916>
2024-03-12 12:44:49 +00:00
Erik Faye-Lund
d861bd1563 panfrost: give afbc-packing its own flag
There's no point in querying this over and over again for each
resource, especially not when this test is about to become more
complicated. So let's give this its own flag.

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27916>
2024-03-12 12:44:49 +00:00
Karol Herbst
7487ac2046 rusticl/device: support query_memory_info to retrieve available memory
Some drivers implement query_memory_info, but not the MAX_GLOBAL_SIZE
compute cap.

Long term we should drop the compute cap anyway.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28122>
2024-03-12 12:24:31 +00:00
Karol Herbst
2df640c4f6 rusticl/kernel: assign sampler locations before DCEing variables
This fixes an issue hit by one of darktable's kernels, where the sampler
argument got assigned the location of a dead kernel parameter turning it
into a zombie and leading us to trash the kernel input buffer's layout.

Fixes: 25b8a34b48 ("rusticl/kernel: inline samplers")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28121>
2024-03-12 11:30:48 +01:00
Tapani Pälli
493d5764e3 iris: setup distribution granularity with Wa_14019166699
Workaround describes that we need to set instance level distribution
granularity when primitive id is used by the draw.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27955>
2024-03-12 09:25:32 +00:00
Tapani Pälli
da3d5d1064 iris: refactor function that checks primitive id usage
We will need this for another workaround, make it more generic.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27955>
2024-03-12 09:25:32 +00:00
Tapani Pälli
275bcbd7a7 anv: setup distribution granularity with Wa_14019166699
Workaround describes that we need to set instance level distribution
granularity when primitive id is used by the draw.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27955>
2024-03-12 09:25:32 +00:00
Lionel Landwerlin
75c6ad9907 intel/fs: fixup sampler header message
If you look at the sampler message header on Gfx9+, you'll see that we
mostly only use 2 dwords (dw2 & dw3). DW2 has a bunch of sampler
parameters, DW3 is the sampler handle.

On Gfx9 we can micro optimize by copying r0 into the header because
the HW mostly doesn't care about other DWs. We just have to clear dw2
on non VS/FS stages.

On Gfx11+, we always have to do a careful copy of the r0.3 bits to
mask out the bottom unrelated bits. So there, just clearing the entire
header makes more sense.

On Xe2+, the dw4 of the header references the sampler feedback surface
handle and bit0 is a boolean to know whether to use that surface or
not. So it *REALLY* matters to have that as 0. If we copy r0, we'll
get random bits in dw4, leading to enable that surface.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28082>
2024-03-12 07:25:45 +00:00
Hyunjun Ko
db8eaa3620 anv/video: fix scan order for scaling lists on H265 decoding.
The default scan order of scaling lists is up-right-diagonal
according to the spec. But the device requires raster order,
so we need to convert from the passed scaling lists.

Fixes: 8d519eb ("anv: add initial video decode support for h265")

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28063>
2024-03-12 03:33:49 +00:00
Timothy Arceri
182bff5c05 glsl: remove unrequired do_lower_jumps() call
We were using this to remove unreachable instructions following
jumps. The previous patch allowed glsl to nir to handle these
instructions so this call is no longer needed.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27288>
2024-03-12 01:43:03 +00:00
Timothy Arceri
1391bc3721 glsl_to_nir: never convert instructions after jump
Unlike in GLSL IR it is illegal to add an instruction to a block
following a jump in NIR. Here we add code to the glsl_to_ir pass
to remove any such instructions before they are processed i.e.
we remove them as soon as we process the jumps.

Handling this in glsl to nir allows us to avoid depending on the
lower_jumps() pass being called directly before glsl to nir when
it otherwise doesn't need to be called an additional time.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27288>
2024-03-12 01:43:03 +00:00
Timothy Arceri
f06aed8e1d glsl: make an explicitly safe version of visit_exec_list()
visit_exec_list() has always called foreach_in_list_safe() here
were rename that version to visit_exec_list_safe() and create
a version that calls the non-safe foreach call.

There are only 2 users of visit_exec_list() we change lower_jumps
to use the renamed version and leave glsl_to_nir() to use the
non-safe version as it never deletes the current instruction and
in the following patch we will add code that may delete the next
instruction meaning the safe version would be unsafe to use.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27288>
2024-03-12 01:43:03 +00:00
Faith Ekstrand
626502d7c7 nil: Advertise support for PIPE_FORMAT_R5G6B5_UNORM
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28103>
2024-03-12 01:20:18 +00:00
Faith Ekstrand
edd3379c09 nvk: Manually offset array and Z slices in BeginRendering
We can't trust the hardware above about 4095 so we're better off just
offsetting manually now that we have the code to do so.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10655
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28103>
2024-03-12 01:20:18 +00:00
Faith Ekstrand
81db82bd8c nvk: Add a nil_image helper variable in BeginRendering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28103>
2024-03-12 01:20:18 +00:00
Faith Ekstrand
696e2064bd nil: Move Z slice offset calculations to a helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28103>
2024-03-12 01:20:18 +00:00
Marek Olšák
813f37a8ed nir: add nir_block::divergent to indicate a divergent entry condition
to be used by nir_opt_varyings

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28049>
2024-03-12 00:29:03 +00:00
Marek Olšák
936690f733 nir: print nir_io_semantics::invariant
this was missing

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28049>
2024-03-12 00:29:03 +00:00
Marek Olšák
867a0a7db9 nir/divergence_analysis: handle derefs of system values
needed by GLSL compiler optimizations that have unlowered sysvals

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28049>
2024-03-12 00:29:03 +00:00
Marek Olšák
eb670d6eaf nir/divergence_analysis: load_instance_id is convergent within a primitive
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28049>
2024-03-12 00:29:03 +00:00
Marek Olšák
310b13b7f0 nir/divergence_analysis: load_primitive_id is convergent within a primitive
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28049>
2024-03-12 00:29:03 +00:00
Marek Olšák
1621d4a0d3 nir/divergence_analysis: change function prototypes
for following commits

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28049>
2024-03-12 00:29:03 +00:00
Qiang Yu
6b1fd20780 radeonsi: split RADEON_USAGE_NEEDS_IMPLICIT_SYNC into CB and DB flags
it will be required in the future

Signed-off-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
123e0b4240 radeonsi: add radeonsi_cache_rb_gl2 option enabling GL2 caching for CB and DB
for perf testing

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
2347259f1d radeonsi/gfx11: add missing DCC_RD_POLICY setting
Fixes: 5acff16ce4 ("radeonsi: add a separate gfx10_init_gfx_preamble_state function")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
82aca689c1 ac: use the gfx11 shadowed register tables for gfx11.5
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
6ce3a95852 radeonsi/gfx11: program SAMPLE_MASK_TRACKER_WATERMARK optimally for APUs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
bd71d62b8f radeonsi: program tessellation rings right before draws
so that we only wait for idle right before draw packets and all preceding
SET packets can be processed in parallel with draws from the previous IB.

This way we also don't need to update the preamble and flush the context
just to emit the preamble. It's a normal state now.

Use the new state atom that is emitted last.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
b9b7d34d05 radeonsi/gfx11: program the attribute ring right before draws
This way, we only wait for idle right before draw packets,
so that all preceding SET packets can be processed in parallel
with draws from the previous IB.

Add a new state atom that is emitted last. It only contains code for gfx11,
but some code for older chips will be added by the next commit.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
9e08569d6a radeonsi: allocate only one set of tessellation rings per device
Move them to si_screen. The "has_tessellation" context flag indicates that
the screen has valid tess rings, so that we don't have to lock the mutex
to check whether the rings are valid.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
ea94cb95e4 radeonsi/gfx10.3: add a GPU hang workaround for legacy tess+GS
Fixes: a23802bcb9 - ac,radeonsi: start adding support for gfx10.3

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
7d3a414662 radeonsi/gfx11: fix programming of PA_SC_BINNER_CNTL_1.MAX_ALLOC_COUNT
Fixes: 25a66477d0 - radeonsi/gfx11: register changes

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
20445f296b radeonsi: disable binning correctly on gfx11.5
Fixes: b44a886b84 - amd/common: add registers for gfx11.5

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
62d360c287 amd/registers: add correct gfx11.x enums for BINNING_MODE
Fixes: ced3fbbcf9 - amd/registers: add gfx11.json

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27943>
2024-03-11 23:36:55 +00:00
Marek Olšák
74c28b93c8 glthread: invert _mesa_glthread_has_no_{un}pack_buffer by removing the negation
transform _mesa_glthread_has_no_unpack_buffer into
_mesa_glthread_has_unpack_buffer, etc.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27490>
2024-03-11 22:44:42 +00:00
Marek Olšák
9939f20a49 glthread: execute small glDrawPixels asynchronously
Compute the image size and copy the image into the batch.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27490>
2024-03-11 22:44:41 +00:00
Marek Olšák
b43b111b19 glthread: execute small glBitmap asynchronously
Compute the bitmap size and copy the bitmap into the batch.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27490>
2024-03-11 22:44:41 +00:00
Marek Olšák
ada351f2ea glthread: track glPixelStore(GL_UNPACK_*)
so that glthread can compute the size of images passed to GL functions.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27490>
2024-03-11 22:44:41 +00:00
Marek Olšák
c76efafc0d mesa: move struct gl_pixelstore_attrib into glthread.h
it will be used there

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27490>
2024-03-11 22:44:41 +00:00
Marek Olšák
9fe8ef1282 mesa: deduplicate initialization of gl_pixelstore_attrib
the new helper will be used later

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27490>
2024-03-11 22:44:41 +00:00
Mike Blumenkrantz
6a52c50a65 zink: simplify vb masking on bind
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28118>
2024-03-11 22:22:39 +00:00