Alyssa Rosenzweig
db32b4a064
asahi: Sync some names with Project Zero
...
This should clarify a few things I didn't get independently
investigating the interface. Of coruse, I got other pieces... the sum of
the parts is better :-)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:10:57 -04:00
Alyssa Rosenzweig
6e59474ced
asahi: Identify partial render pipeline
...
Needed if a partial render is incurred from overflowing the parameter
buffer (too much geometry).
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:09:04 -04:00
Alyssa Rosenzweig
65500b19df
asahi: Implement polygon offset
...
This is pretty simple now that the hardware is understood. The hardware
interfaces parallels that of scissors, so the scissor path is reused
with minor modifications to accommodate the new functionality.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:09:04 -04:00
Alyssa Rosenzweig
666f307d41
asahi: Add a depth bias structure
...
This is simple and corresponds directly to the Metal inputs. However,
the alignment is a bit tricky, so let's add formal XML for it.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:09:04 -04:00
Alyssa Rosenzweig
cb760a00c2
asahi: Identify depth bias enable bit
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:09:04 -04:00
Alyssa Rosenzweig
7a0c220401
asahi: Identify "set depth bias index" field
...
Grouped together with the "set scissor index" field, which is natural.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:09:04 -04:00
Alyssa Rosenzweig
ff84c07b21
asahi: Identify depth bias array
...
"Inspired" by PowerVR code, by comparison.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:09:04 -04:00
Alyssa Rosenzweig
a39fb009d2
asahi: Note unknown field
...
...used internally with visibility tests, together with a weird
vertex/compute-like shader used to zero the visibility buffer.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:09:04 -04:00
Alyssa Rosenzweig
baa54da7d6
asahi: Relax Draw "command" check
...
Other values in the lower byte seen with multiple draws and
visibility testing.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:09:04 -04:00
Alyssa Rosenzweig
d8541d52d2
asahi: Add XML used for visibility tests
...
Aka occlusion queries. There is an annoying limitation in the hardware
(reflected in Metal) that only a single buffer may be bound per render
pass, with the per-draw settings merely specifying an offset.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:09:04 -04:00
Alyssa Rosenzweig
46a7c10349
asahi: Dump "unknown 4a" structure
...
A few fields are known at least, let's decode them correctly instead of
falling back to a hex dump.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:09:04 -04:00
Alyssa Rosenzweig
a5e6a5e585
asahi: Identify more depth pipeline fields
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-22 17:09:00 -04:00
Alyssa Rosenzweig
6aadd72bd4
asahi: Account for every byte of the cmdbuf
...
This adds the remaining XML. I don't know how much of this is correct,
but it nominally accounts for every byte. So there shouldn't be more
surprises in the command buffer after this.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-21 22:01:33 -04:00
Alyssa Rosenzweig
c61e660323
asahi: Handle 3rd deflake address
...
Context switching is so broken. Just trying to get closer. Adding some
XML here to see if we're missing something else obvious.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-21 22:01:33 -04:00
Alyssa Rosenzweig
3be0314e5a
asahi: Flush on partial clears
...
Not the fastest thing, but should be conformant. (Panfrost to this day
has this effective behaviour...)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-21 22:01:33 -04:00
Alyssa Rosenzweig
95a18d1c1c
asahi: Pass depth/stencil clear values to firmware
...
These need to be format-packed, but as we only support Z32F_S8 right
now, that's trivial.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-21 22:01:32 -04:00
Alyssa Rosenzweig
43f6c08a3b
asahi: Handle uncompressed Z32F depth buffers
...
This uses a subset of the depth/stencil infrastructure we built out to
support writing back tiled, uncompressed Z32F depth buffers to memory.
Texturing from this format is already supported.
This gets glmark2 -bshadow working.
v2: Fix partial renders
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-21 22:01:32 -04:00
Alyssa Rosenzweig
c955dd726e
asahi: Don't store to unbound render targets
...
Otherwise we have a state leak with depth-only attachments, as in
glmark2 -bshadow.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-21 22:01:32 -04:00
Alyssa Rosenzweig
a0fc622be5
asahi: Validate depth/stencil formats
...
Don't go advertising formats we don't actually support.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-21 22:01:32 -04:00
Alyssa Rosenzweig
e6c809d767
asahi: Use z24_in_z32f lowering
...
Thanks Dave!
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-21 22:01:32 -04:00
Alyssa Rosenzweig
0ea174f38c
asahi: Run lower_blend for all fragment shaders
...
Unify the paths so that colour masks are respected even when regular
blending is off (or when logic ops are used!) Fixes
dEQP-GLES2.functional.color_clear.masked_rgb
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512 >
2022-05-21 22:01:32 -04:00
Mike Blumenkrantz
aa32b96c51
turnip: fix assert for max xfb outputs
...
this is a counter, not an index, so use <=
cc: mesa-stable
Reviewed-by: Hyunjun Ko <zzoon@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16620 >
2022-05-21 16:48:54 +00:00
Chia-I Wu
2a8e6a4d1a
turnip: disable UBWC for SNORM formats
...
In copy_format, we treat snorm as unorm to avoid clamping. But snorm
and unorm are UBWC incompatible for special values such as all 0's or
all 1's. Disable UBWC for snorm.
For reference, I dumped the first byte of an UBWC blocks and it was
color UNORM SNORM
all black 0x01 0x31
all white 0x0d 0x11
@flto clarified that bit 4 is unset for fast clear encoded blocks. It
looks like fast clear is not used for SNORM.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6480
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16534 >
2022-05-21 15:27:42 +00:00
Jeffrey Knockel
d7dc27645e
egl: dereference XCB drawable pointers
...
eglCreatePlatformWindowSurface[EXT] and
eglCreatePlatformPixmapSurface[EXT] should be passed (xcb_window_t *)
and (xcb_pixmap_t *), so we must dereference these types before using
them as drawables. We already do something similar with X11 drawable
pointers.
Signed-off-by: Jeffrey Knockel <jeff@jeffreyknockel.com >
Reviewed-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16269 >
2022-05-21 14:42:06 +00:00
Karol Herbst
cd8c083ab5
clc: disable opaque pointers until they are supported
...
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16479 >
2022-05-21 12:26:37 +00:00
Karol Herbst
b6ed3c6ea2
clc: fix compiler features_macro CTS Test
...
Even with that alone we can't pass the test, as LLVM enables some
extensions based on the SPIR target we choose.
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16479 >
2022-05-21 12:26:37 +00:00
Karol Herbst
bcc2df4890
clc: speed up compilation by not relying on opencl-c.h
...
This depends on LLVM change: https://reviews.llvm.org/D125401
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16479 >
2022-05-21 12:26:37 +00:00
Karol Herbst
e5a052f75f
clc: drop parsingComplete check
...
This relies too much on the properties of the SPIRV-LLVM-Translator and is
required to load SPIR-Vs found in the OpenCL CTS.
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16479 >
2022-05-21 12:26:37 +00:00
Karol Herbst
c0cf7f578a
clc: parse localSize and localSizeHint
...
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16479 >
2022-05-21 12:26:37 +00:00
Chia-I Wu
e8eb6d13a5
turnip: fix tu6_pack_border_color for z24
...
The value should be at the bottom 24 bits, not at the top.
dEQP-VK.pipeline.sampler.* still passes. This fixes most of
dEQP-GLES31.functional.texture_border_clamp.formats.*depth* on angle.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16570 >
2022-05-21 00:54:28 +00:00
Icecream95
2f2ddfa0ac
panfrost: Move patched_s out of the pan_blitter_views struct
...
The struct is returned from a function, so in debug builds the address
may change after returning, and pointers to patched_s will be broken.
Pass the pointer to the patched stencil view as a parameter to
pan_preload_get_views to avoid this.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16343 >
2022-05-20 23:17:07 +00:00
Icecream95
f1f39fa645
panfrost: Increase the limit for blend shader variants
...
Qt uses blend constants to set text colour, this will allow more
colours onscreen before thrashing happens.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16343 >
2022-05-20 23:17:07 +00:00
Icecream95
80404c8b64
panfrost: Copy blend constant into variant even when reusing it
...
Otherwise future lookups will match searches for the old constant.
Fixes: bbff09b952 ("panfrost: Move the blend shader cache at the device level")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6355
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16343 >
2022-05-20 23:17:07 +00:00
Mike Blumenkrantz
c81cd989c8
zink: use dynamic rendering (most of the time)
...
this is a simplified version of the renderpass infrastructure which
tracks rendering info on the context and updates it incrementally to
try and reduce cpu overhead
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
b25b8027e5
zink: split out scissor flagging from framebuffer updating
...
this is kinda similar but not actually the same thing
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
91a9676a0c
zink: lift some renderpass mechanics up a level in the api
...
(should be) no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
ec3a7323da
zink: track whether there's any transient attachments bound
...
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
b2a33d364e
zink: break out zs rt attrib analysis into util function
...
(should be) no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
728fa3606a
zink: break out color rt attrib analysis into util function
...
(should be) no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
4769b4e610
zink: fix indentation
...
no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
69efe357b3
zink: pass rt attrib to zink_render_pass_attachment_get_barrier_info()
...
no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
079b95fc6a
zink: remove renderpass state flag for swapchain
...
this is redundant and can be merged onto the rt attrib
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
e107fa386b
zink: break up swapchain renderpass update to util function
...
no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
190ccf3324
zink: break out sample location updating to separate function
...
no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
3ef8cdbab2
zink: use local variable for getting rt barrier info
...
no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
37f9b8ef9b
zink: remove fb rebind check during renderpass begin
...
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
3d145ec7f1
zink: use global image rebind counter for dmabuf export
...
this is a bit less flimsy and handles more than just framebuffer rebinds
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
b181080d9f
zink: move renderpass handling to zink_render_pass.c
...
no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
4457a9388a
zink: use zink_batch_no_rp to end renderpasses
...
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz
3e1cd9f623
zink: always use zink_batch_rp to init renderpass
...
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476 >
2022-05-20 16:42:21 +00:00