Commit graph

184774 commits

Author SHA1 Message Date
Faith Ekstrand
df62471fef nvk: CBuf alignment reduces to 64B on Turing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
289149ebcb nvk: Simplify alignment limit plumbing
We dont't need this whole function just for advertising alignment
requirements.  We now have enough #defines and helpers that they map
pretty cleanly to those.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
08222146ac nak: Reduce minStorageBufferAlignment
The only real requirement here is that we can load an entire vec4 at a
time without getting a misaligned address.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
35a40b4c6a nvk: Add an NVK_MIN_TEXEL_BUFFER_ALIGNMENT #define
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
b7f8a9e648 nvk: Add a nvk_min_cbuf_alignment() helper and use it
We want to be able to use cbufs for UBOs and descriptor buffers going
forward.  This also cleans up alignments all over the code-base where
just kinda did whatever seemed like a good idea at the time.  The result
is a lot more flexible and accurate.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
bc236acff5 nvk: Plumb a physical device into descriptor_stride_align_for_type
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
c7de8afbe0 nvk: s/device/dev in nvk_descriptor_set_layout.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
700d5c56d1 nvk: Make NVK_DEBUG=push an alias for push_dump
This has been bothering me for a while.  I can never remember whether
it's push_dump or dump_push.  Let's just get rid of the confusion.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Alyssa Rosenzweig
d11c9f9836 asahi: clamp draw count for mdi
spec req. KHR-GL43.indirect_parameters_tests.MultiDrawArraysIndirectCount

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
fdec9dcf05 asahi: wire up hardware gl_PrimitiveID
when FS reads but no GS in the pipeline, the hw supplies for us. fixes

KHR-GL43.shader_image_size.basic-*-fs-*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
1e2de134ad asahi: respect render condition for compute
KHR-GL43.compute_shader.conditional-dispatching

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
1a39d1c73a asahi: allow more format reinterpretation
This seems to be the hw rule... would like to confirm with perf counters
though...

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
e69a0f830e asahi: fix size calculation for 2d msaa arrays
otherwise the hw can overprefetch. fixes KHR-GL42.shader_image_load_store.basic-allTargets-load-ms

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
982e644d18 agx: don't produce split of immediate
can't be consumed, affects KHR-GL42.shader_image_load_store.basic-allTargets-load-ms

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
6e2c71dc3b agx: Lower 64-bit I/O to 32-bit
Fixes KHR-GL42.vertex_attrib_64bit.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
d6474be46b agx: fix fp64 lowering options
we have no fp64 whatsoever.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
8d451fe9f2 asahi: fix integer RT clamping
fixes the rest of KHR-GL33.packed_pixels.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
01d0fb1cde asahi: fix pbe swizzling
fixes cases in KHR-GL33.packed_pixels.rectangle.*. matches what the powervr
driver does.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
6d05bf8761 asahi: fix dupe rgb65 formats
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
b68caa13e4 asahi: add more BGR formats
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
c89f0becf7 asahi: Implement ARB_cull_distance
Passes KHR-GL33.cull_distance.* and the piglits.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
ba077d899e asahi: handle compact clip/cull in gs component gather
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
f02190b688 asahi: prepare gs copy shaders for compact clip/cull
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
0dc004888c asahi: handle some components/offsets in GS lowering
occurs for compact clip/cull xfb. not hard to deal with, do so instead of
getting caught up in assertions.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
17f348f73a asahi: Implement ARB_viewport_array
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
af9241ce92 asahi: add XML for multiple viewports
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
3435ccb49a asahi: allow empty scissor box
we can't cull on the cpu when we have a scissor array, so don't try.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
bb59c787ec agx: report if we have a nonzero viewport
so driver can optimize.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
bc7afbf23d agx: allocate varying slot if writing viewport only
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
643acacd1b agx: note that sample_mask runs occlusion queries
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
79e58e1d77 agx: handle force early-z + discard
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-09 12:08:39 -04:00
Alyssa Rosenzweig
3987c8a35f agx: remove spurious z/s writes in force early-z shaders
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-09 12:08:39 -04:00
Alyssa Rosenzweig
c43c90a5fa asahi: rewrite pointsize handling
In the wise words of Mike Blumenkrantz, "I hate gl_PointSize and so can you".

The mesa/st lowering won't mesh well with vertex shader epilogues, and it falls
over in various circumstances. I am too tired to go against the grain, so let's
just pretend to be a normal gallium driver and trust in the rasterizer CSO,
lowering point size internally. This properly handles transform feedback without
any hacks, both GL and GLES behaviours, etc.

Fixes:

   KHR-GL31.transform_feedback.capture_vertex_separate_test
   gl-2.0-large-point-fs

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
aa1849a541 asahi: assert hw invariant
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
23f216d6e7 asahi: Lower edge flags
With the common geometry shader based lowering added for zink. Fixes edge flag
related piglits.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
f4a648c607 asahi: Unroll GS/XFB primitive restart on the GPU
..and fix bugs versus the CPU unroll while we're at it. CPU based unrolling is
invalid in Vulkan, but this slow-as-dogs GPU unroll is ok.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
15957219ad agx: rework libagx linking a bit
for correctness with generic ptrs, avoids splat with the next patch.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
4a4c6d1bc6 agx: Avoid scratch mem with tri strip w/ adjacency
with restart unroll kernel where nir fails to optimize this away without a
little help from us.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
7f9ef5b176 agx: fix VARYING_SLOT_COL0 getting flatshaded
it's a bit mask.

didn't fix the piglit i was debugging :-(

but did fix the shadow glitching out in neverball.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
6437578435 asahi: add xml for flatshading fans
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
403a20a9f2 asahi: rework cf binding xml
for flat shading of fans.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
2fec6bf951 asahi: fix tri fan enum
from tracing macos. fixes piglits:

 spec@!opengl 1.1@gl-1.1-drawarrays-vertex-count 100000 varray gl_triangle_fan
 spec@!opengl 1.1@gl-1.1-drawarrays-vertex-count 100000 vbo gl_triangle_fan
 spec@!opengl 1.4@triangle-rasterization-overdraw

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
6ae72a2f2a asahi: Support L/A/I formats for texture buffers
mesa/st doesn't know how to emulate them. Fixes
arb_texture_buffer_object-formats.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
5b33c74626 agxdecode: fix stack smash with border colour
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
a8857028bb asahi: add static assert
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
2be37d1c96 asahi: double depth bias
fixes gl-1.4-polygon-offset, other drivers do this too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
3af825ed96 asahi: move heap alloc to first use
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
0fa7252d8a asahi: Implement multidraw indirect
GS only for now (inserting a passthru GS if needed). This should be optimized
later, but it's ~correct.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
5987e47a29 asahi: rework GS input assembly
in prep for tessellation (which will share the IA lowering), and for multidraw
indirect (which greatly complicates IA lowering with geom/tess).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
a816350d95 asahi: force GS for indirect prim gen query
removes one more indirect cpu fallback (invalid in vulkan)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00