Mike Blumenkrantz
4283441cd6
zink: handle non-const offsets for txf/tg4 ops
...
required for gl_spirv handling and tg4
Fixes: b77f43f253
("zink: use ConstOffset for nir_tex_src_offset")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8333 >
2021-01-05 12:16:02 -05:00
James Jones
80cfc5350c
gallium/dri: Use per-screen DRI extension list
...
Some DRI extension features are enabled/disabled
based on capabilities of the gallium pipe_screen
associated with the DRI screen. Additionally, the
list of extensions enabled also varied based on
features requested by the screen creator. However,
prior to this change the extension list and
extension definition structures within it were
global variables, meaning the last screen
initialized ended up defining the DRI capabilities
of all screens.
This change instead stores a copy of the
extensions which vary per screen, as well as a
copy of the extension list itself in the gallium
DRI screen structure, allowing them to vary per
screen.
Closes: https://gitlab.freedesktop.org/drm/nouveau/issues/9
Signed-off-by: James Jones <jajones@nvidia.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7175 >
2021-01-05 16:11:12 +00:00
James Jones
7d4c184ff9
gallium/dri: Factor out DRI extension setup code
...
Share the DRI extension setup code between
dri2_init_screen and dri_kms_init_screen. There's
currently very little difference, and the sharing
will make a subsequent change to refactor this
code to use per-screen extension lists easier.
Signed-off-by: James Jones <jajones@nvidia.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7175 >
2021-01-05 16:11:11 +00:00
Erik Faye-Lund
b77f43f253
zink: use ConstOffset for nir_tex_src_offset
...
Quote from the OpenGL Shading Language spec, version 4.40, section 8.9.2
"Texel Lookup Functions":
> The offset value must be a constant expression.
So, until we start consuming SPIR-V shaders, it seems we don't need to
deal with non-constant offsets.
This means we can avoid lowering this away in some cases.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8327 >
2021-01-05 15:48:17 +00:00
Erik Faye-Lund
918cb23693
zink: do not reserve or pack fragment outputs
...
These are completely unrelated to other shader IO variables, so they
don't need this logic.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7986 >
2021-01-05 15:42:15 +00:00
Erik Faye-Lund
f06f4a595e
zink: do not use reservations for stream-out
...
reservations are accumulated for all shader-stages in a program without
resetting it. But stream-out is completely orthogonal to all other
inputs and outputs, so they don't matter for this stuff at all.
So let's drop considering reservations here, and simply count how many
generic outputs we have here instead.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7986 >
2021-01-05 15:42:15 +00:00
Erik Faye-Lund
b49cea2e9a
zink: destroy device and instance
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8099 >
2021-01-05 15:36:35 +00:00
Erik Faye-Lund
bc1593a9cd
zink: destroy transfer-helper
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8099 >
2021-01-05 15:36:35 +00:00
Erik Faye-Lund
81be8c7049
zink: free sets and hash-tables in context
...
Up until now, we've simply leaked all of these. Let's try to do better.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8099 >
2021-01-05 15:36:35 +00:00
Erik Faye-Lund
07d5d911dd
zink: dot leak dummy_buffer
...
Fixes: 8736ffae2e
("zink: replace unset buffer with a dummy-buffer")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8099 >
2021-01-05 15:36:35 +00:00
Erik Faye-Lund
a118da0371
zink: do not leak vertex element state
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8099 >
2021-01-05 15:36:35 +00:00
Erik Faye-Lund
f70490bf42
zink: release batch memory
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8099 >
2021-01-05 15:36:35 +00:00
Erik Faye-Lund
5d44a973b5
zink: destroy blitter before destroying batches
...
Destroying the blitter frees samplers, which pushes the sampler-handles
onto the batches' zombie-sampler lists. So if we want to properly clean
these zombie-samplers up, we need to first get them onto the list so
we'll know about them in time.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8099 >
2021-01-05 15:36:35 +00:00
Erik Faye-Lund
820d272a21
zink: factor out zink_batch_release-helper
...
This will be useful for making sure everything has gotten cleaned up
properly.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8099 >
2021-01-05 15:36:35 +00:00
Erik Faye-Lund
cd7d8eade2
zink: do not open-code CALLOC_STRUCT
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8099 >
2021-01-05 15:36:35 +00:00
Mike Blumenkrantz
5342dbe96d
features: mark off GL 4.1 for zink
...
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8329 >
2021-01-05 08:58:28 -05:00
Mike Blumenkrantz
c211f466cc
zink: GLSL 410
...
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8329 >
2021-01-05 08:58:27 -05:00
Mike Blumenkrantz
3f640e56c4
features: mark off GL 4.0 for zink
...
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8329 >
2021-01-05 08:58:25 -05:00
Mike Blumenkrantz
ae9d6c5620
zink: GLSL 4.00
...
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8329 >
2021-01-05 08:58:24 -05:00
Mike Blumenkrantz
22be7b9674
zink: handle arrays of ubos
...
with the nir pass removing all dynamic indexing, all that's needed here
is generating extra binding points for each array member, as everything else
is already handled
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8314 >
2021-01-05 08:37:03 -05:00
Mike Blumenkrantz
dbba989907
zink: run nir_lower_dynamic_bo_access
...
this fixes up most cases of dynamic bo loading
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8314 >
2021-01-05 08:37:03 -05:00
Mike Blumenkrantz
35e346f428
zink: handle vertex streams
...
we already support all this, it's just a matter of slapping on some Stream
decoration flex tape
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8204 >
2021-01-05 13:30:34 +00:00
Mike Blumenkrantz
68242767d2
zink: enable PIPE_CAP_START_INSTANCE
...
and add feature
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8313 >
2021-01-05 13:24:14 +00:00
Mike Blumenkrantz
351b6c667e
zink: always load (gl_InstanceID - gl_BaseInstance) when loading gl_InstanceID
...
gl's values here always begin at 0, while vk begins with the firstInstance param
used in the current draw command
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8313 >
2021-01-05 13:24:14 +00:00
Samuel Pitoiset
4bb92d9145
radv: enable TC-compat HTILE in GENERAL on GFX10+
...
GFX10+ supports compressed writes to HTILE, so it should just work
to skip decompressions when transitioning from/to GENERAL.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8039 >
2021-01-05 12:10:11 +00:00
Samuel Pitoiset
326c7312bf
radv: only load the DS fast clear values for compressed rendering
...
Otherwise it's useless because we are unlikely to perform a
fast depth stencil clear.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8039 >
2021-01-05 12:10:11 +00:00
Samuel Pitoiset
76e33d528b
radv: clean up radv_layout_is_htile_compressed()
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8039 >
2021-01-05 12:10:11 +00:00
Samuel Pitoiset
f4f096805b
radv: fix TC-compat HTILE images with DST_OPTIMAL on the compute queue
...
This is probably rare but can happen if someone performs a depth-stencil
copy on the compute queue. This might work (untested by CTS) but it
looks more conservative to decompress before perfoming the operation.
Found by inspection.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8039 >
2021-01-05 12:10:11 +00:00
Samuel Pitoiset
1c539b6484
radv: add radv_htile_get_initial_value() and document the HTILE dword
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8039 >
2021-01-05 12:10:11 +00:00
Samuel Pitoiset
3038c88661
radv: fix potential HTILE issues for TC-compat images on GFX8
...
We can only use the entire HTILE buffer if TILE_STENCIL_DISABLE is
TRUE. On GFX8+, this is only true if the depth image has no stencil
and if it's not TC-compatible because of the ZRANGE_PRECISION issue.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8039 >
2021-01-05 12:10:11 +00:00
Samuel Pitoiset
f7f6e9ad56
radv: always clear the SR0/SR1 bits of the HTILE buffer
...
To make sure the stencil compare state is properly initialized and
cleared when the driver performs a fast depth clear.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8039 >
2021-01-05 12:10:11 +00:00
Pierre-Eric Pelloux-Prayer
5c3b471c9f
mesa/st: fix redundant initialization
...
https://gitlab.freedesktop.org/mesa/mesa/-/issues/3966
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846 >
2021-01-05 11:29:12 +00:00
Pierre-Eric Pelloux-Prayer
094ab8bc12
radeonsi: fix redundant initializations
...
See https://gitlab.freedesktop.org/mesa/mesa/-/issues/3966
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846 >
2021-01-05 11:29:11 +00:00
Pierre-Eric Pelloux-Prayer
b1c7a65815
gallium/vl: merge identical h264/h265 enums
...
Use h2645 notations for shared enums to reduce duplication and
fix a clang warning.
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846 >
2021-01-05 11:29:11 +00:00
Pierre-Eric Pelloux-Prayer
8d347742fe
tesselator: remove unused variable
...
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846 >
2021-01-05 11:29:11 +00:00
Pierre-Eric Pelloux-Prayer
d0767fc045
amd/addrlib: use cpp.has_argument() to filter compiler arguments
...
Acked-by: Michel Dänzer <mdaenzer@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846 >
2021-01-05 11:29:11 +00:00
Pierre-Eric Pelloux-Prayer
6679a34394
vdpau: fix invalid enum usage
...
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846 >
2021-01-05 11:29:11 +00:00
Pierre-Eric Pelloux-Prayer
cd1ac36ddd
vdpau: fix -Wabsolute-value warning
...
vdpau specifies that top-left is x0/y0, bottom-right is x1/y1 and that x0/y0 are
inclusive while x1/y1 are exclusive.
This commit remove the abs() usage and instead verifies that the VdpRects passed
by the user matche the documentation. When they don't they're treated as empty
rectangles.
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846 >
2021-01-05 11:29:11 +00:00
Rhys Perry
c5973ede01
ac/nir: use llvm.readcyclecounter for LLVM9+
...
Unlike llvm.amdgcn.s.memtime, this works on GFX10.3
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4033
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8306 >
2021-01-05 10:27:00 +00:00
Eric Anholt
c0bcde8b45
gallium/tgsi_exec: Remove unused MaxGeometryShaderOutputs.
...
Just an indirection from the value you should be grepping for (the one
that controls the allocation of the output buffer).
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8283 >
2021-01-05 09:54:49 +00:00
Eric Anholt
d31c30007b
gallium/tgsi_exec: Clean up storage of the pixel kill mask.
...
We need one dword per exec, rather than one per channel, since it's the
bitmask of channels killed. Removes the remainder of the
TGSI_EXEC_NUM_TEMP_EXTRAS!
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8283 >
2021-01-05 09:54:49 +00:00
Eric Anholt
6fb9365a07
gallium/tgsi_exec: Drop the unused scratch temp regs.
...
I suspect this was used back in the SSE2 backend days. Definitely dead
now.
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8283 >
2021-01-05 09:54:49 +00:00
Eric Anholt
c27cbfd9ed
gallium/tgsi_exec: Stop doing the weird allocation of the Addrs array.
...
Saves an indirection on referencing the address regs, and also my sanity.
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8283 >
2021-01-05 09:54:49 +00:00
Eric Anholt
af135bb8af
gallium/tgsi_exec: Simplify GS output vertex count tracking.
...
We had this strange 5-dword-per-stream storage for the single dword
current vertex count, due to copy and paste. We can make much cleaner
code by just having a 4-element array in the machine.
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8283 >
2021-01-05 09:54:49 +00:00
Samuel Pitoiset
831d9d406a
radv: remove unused radv_image::aspects
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8324 >
2021-01-05 09:46:01 +00:00
Samuel Pitoiset
58c68bac39
radv: fix clearing images with vkCmdClear{Color,DepthStencil}Image()
...
The image aspects field is actually never set and we should use the
range aspect anyways.
Fixes: 1a7b7b17ad
("radv: avoid oob read during clear")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8324 >
2021-01-05 09:46:01 +00:00
Pierre-Eric Pelloux-Prayer
4c751ad67a
vbo/dlist: use a shared index buffer
...
Draws can be merged by u_threaded if they share the same IB.
This improves performance in SPECviewperf13 snx-03: tests fps
are improved by a 1.2x - 2.0x factor.
v2: reworked error handling
Reviewed-by: Marek Olšák <marek.olsak@amd.com > (v2)
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com > (v2)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8111 >
2021-01-05 09:51:56 +01:00
Marek Olšák
a0314083be
mesa: fix a second bug in merging light state parameters with unpacked uniforms
...
The memcpy size should be packed even if the allocated parameter size
is padded to 4 components.
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8017 >
2021-01-05 03:47:16 +00:00
Marek Olšák
45acf9b49a
mesa: fix a bug in merging light state parameters with unpacked uniforms
...
This code is not enabled yet.
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8017 >
2021-01-05 03:47:16 +00:00
Marek Olšák
4db8b171a5
mesa: add STATIC_ASSERTs to the STATE_LIGHT_ATTRIBS case
...
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8017 >
2021-01-05 03:47:16 +00:00