Mike Blumenkrantz
802e43a6b5
gallium/cso: add unbind mask for cso restore
...
this code was duplicated in a bunch of places, so now there can just
be a bitmask passed to simplify and consolidate
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12571 >
2021-09-01 01:59:52 +00:00
Mike Blumenkrantz
7ac2edd555
aux/cso: always restore states in atom order
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12571 >
2021-09-01 01:59:52 +00:00
Mike Blumenkrantz
b7534fe82a
zink: destroy shader modules on program free to avoid leaking
...
it's irrelevant whether the shader pointer is valid, the shader cache
may still exist
Fixes: a92442225c ("zink: split up shader cache per-stage")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12650 >
2021-09-01 01:48:04 +00:00
Tomeu Vizoso
eb7eccc76f
lavapipe: Use generated command queue code
...
Most of the code that implements entry points for commands doesn't need
to be manually written. So just drop it.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com >
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12369 >
2021-09-01 01:05:22 +00:00
Tomeu Vizoso
997a6ca226
vulkan: Generate entrypoints that enqueue commands
...
For drivers such as Lavapipe that record the commands at the execution
stage.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com >
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12369 >
2021-09-01 01:05:22 +00:00
Tomeu Vizoso
a7b0946ef0
vulkan: Generate code to place commands in a queue
...
It can be used by lavapipe and also by drivers for GPUs with command
streams that require values related to the framebuffer, thus the command
stream emission for secondary buffers needs to be deferred until the
framebuffer is known (execution time).
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com >
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12369 >
2021-09-01 01:05:22 +00:00
Tomeu Vizoso
925a8fac17
vulkan: Read len attribute of parameters to functions
...
It will be needed for generating code that needs to know the size of
arrays.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com >
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12369 >
2021-09-01 01:05:22 +00:00
Tomeu Vizoso
77ad17d022
lavapipe: add xfails for whole of CTS
...
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com >
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12369 >
2021-09-01 01:05:22 +00:00
Marek Olšák
3362da2c53
ac/gpu_info: fix detection of smart access memory
...
chip_class was 0. Move the code after setting chip_class.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5282
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
e05ad2680c
radeonsi: set gfx10 registers better in si_emit_initial_compute_regs
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
deacef5d43
radeonsi: fix a memory leak in si_get_shader_binary_size
...
Fixes: bf8a1ca902 "radeonsi: use the new run-time linker for shaders"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5272
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
46cb3bb4d1
ac/debug: add an option to disable colors for printed IBs
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
6cb2f07e90
radeonsi: add si_print_current_ib function for debugging
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
f28552b804
radeonsi: don't use SQ_NON_EVENT before GE_PC_ALLOC for better perf on Navi1x
...
SQ_NON_EVENT was originally meant to fix a perf issue on Navi1x, but using
the event actually makes the perf worse.
This improves perf for viewperf/snx.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
9fb77745f5
radeonsi: inline si_need_gfx_cs_space
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
77a0411694
winsys/amdgpu: clean up amdgpu_cs_check_space
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
48632778b9
radeonsi: simplify si_need_gfx_cs_space
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
85742b28ef
radeonsi: inline remaining big functions in draw_vbo for better snx perf
...
This makes compilation slower, but the perf improvement is ~4%
with pipe_vertex_state.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
b15c413947
radeonsi: simplify memory usage checking by merging vram and gtt counters
...
no change in behavior
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
b92e109ac6
radeonsi: correctly use cs instead of gfx_cs in build pm4 helpers
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:58 +00:00
Marek Olšák
b29741906d
radeonsi: use memcmp and radeon_emit_array in radeon_opt_set_context_regn
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:57 +00:00
Marek Olšák
0aed2d0cd3
radeonsi: stop using AC_EXP_PARAM_UNDEFINED because it's not useful
...
Just use AC_EXP_PARAM_DEFAULT_VAL_0000 to keep things simple.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:57 +00:00
Marek Olšák
2027831aaa
radeonsi: inline si_get_alpha_test_func
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:57 +00:00
Marek Olšák
c005b2cd4b
radeonsi: move as_ls/es/ngg setting out of si_shader_selector_key
...
Do it when we bind shaders.
The advantages are:
- no need to memset the fields when any shader variant state is changed
(e.g. culling on/off)
- no need to recompute the fields every time that happens
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:57 +00:00
Marek Olšák
5a8a716168
radeonsi: move si_vgt_stages_key determination into si_update_vgt_shader_config
...
This simplifies si_update_shaders. It also makes it more obvious that
si_update_shaders could become a C++ template one day.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:57 +00:00
Marek Olšák
ec37db756e
radeonsi: remove stages_key parameter from si_shader_selector_key
...
no change in behavior
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:57 +00:00
Marek Olšák
08310f85ae
radeonsi: remove instancing support from the prim discard compute shader
...
It's not important for workstation apps on Vega.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:57 +00:00
Marek Olšák
9ec707ca37
radeonsi: remove unused depth_clamp_any
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656 >
2021-09-01 00:42:57 +00:00
Marek Olšák
6367d8036a
mesa: skip draw calls with unaligned indices
...
GL doesn't say which error we should report. dEQP expects no error and
no crash and allows skipping the call. Some drivers can crash.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5227
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12533 >
2021-08-31 23:54:51 +00:00
Marek Olšák
614f273ab4
mesa: fix gl_DrawID with indirect multi draws using user indirect buffer
...
The code lowered the draws to direct ones but disregarded gl_DrawID.
We need to pass the draw ID to the driver manually.
gl_DrawID is the 3rd parameter of DrawGallium here.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5274
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12533 >
2021-08-31 23:54:51 +00:00
Marek Olšák
1f80cd35cb
mesa: remove unused indices parameter from validate functions
...
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12533 >
2021-08-31 23:54:51 +00:00
Dave Airlie
07956bbcae
lavapipe: VK_KHR_depth_stencil_resolve support
...
This adds support for depth stencil resolves to lavapipe.
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12504 >
2021-08-31 23:26:45 +00:00
Dave Airlie
3235b695b2
u_blitter: add support for sample0 only resolves.
...
This adds support for sample0 only resolves to support lavapipe
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12504 >
2021-08-31 23:26:45 +00:00
Dave Airlie
4d747c0c89
gallium: add a sample0 only option to blitter.
...
Vulkan depth/stencil resolves can ask for just sample 0 instead
of averaging. Just add a flag to the state to allow it.
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12504 >
2021-08-31 23:26:45 +00:00
Dave Airlie
a5786a2e71
llvmpipe: adjust scissor planes for multisample.
...
For the inclusive x0/y0 planes, add a half pixel adjustment
For the exclusive x1/y1 planes, remove a half pixel adjustment
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12504 >
2021-08-31 23:26:45 +00:00
Dave Airlie
519f235459
llvmpipe/scissor: rewrite scissor planes interaction.
...
This just changes the calcs to be cleaner and easier to interpret.
Adjust the inclusive (x0/y0) by -1 like before, and then flip the
sign for the correct direction.
Add full pixel to the exclusive side after scaling, this is do
show that this value is incorrect and the next patch fixes that
taking multisample into account
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12504 >
2021-08-31 23:26:45 +00:00
Dave Airlie
22b5e61db9
llvmpipe: consolidate scissor plane code between line/tri
...
This code is pretty much the same in both, consolidate it.
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12504 >
2021-08-31 23:26:45 +00:00
Dave Airlie
291d0795a3
llvmpipe/fs: fix multisample depth/stencil fs writes.
...
The state wasn't storing the shader depth/stencil outputs
per-sample, so only the last sample emitted was being used
for the late depth test and stencil ref.
Noticed while trying to fix some vulkan depth stencil resolve
issues
Fixes: a0195240c4 ("llvmpipe: handle multisample early depth test/late depth write")
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12504 >
2021-08-31 23:26:45 +00:00
Marek Olšák
6c75e5e3c6
vbo: check more GL errors when drawing via glCallList
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12265 >
2021-08-31 22:53:45 +00:00
Marek Olšák
43041f2447
vbo: merge draws with GL_LINES regardless of line stippling
...
see the code comment
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12265 >
2021-08-31 22:53:45 +00:00
Marek Olšák
386e5371a7
util/cpu_detect: add/guess support for next Zen CPUs
...
so that we don't have to update this anymore
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12335 >
2021-08-31 22:29:21 +00:00
Marek Olšák
d7a36d8907
util/cpu_detect: print num_L3_caches and num_cpu_mask_bits
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12335 >
2021-08-31 22:29:21 +00:00
Quantum
e52aa1edff
main: allow all external textures for BindImageTexture
...
According to OES_EGL_image_external_essl3:
On p. 196 in the errors section for BindImageTexture, replace the
last error with the following:
"An INVALID_OPERATION error is generated if <texture> is neither the
name of an immutable texture object, nor the name of an external
texture object."
According to OES_EGL_image_external:
The command
void EGLImageTargetTexture2DOES(enum target, eglImageOES image);
with <target> set to TEXTURE_EXTERNAL_OES defines the currently bound
external texture object to be a target sibling of <image>.
...
If <target> is not TEXTURE_EXTERNAL_OES, the error INVALID_ENUM is
generated. (Note: if GL_OES_EGL_image is supported then <target> may
also be TEXTURE_2D).
Currently, mesa only allows GL_TEXTURE_EXTERNAL_OES textures to be bound
by glBindImageTexture. However, the language of the specification does not
appear to use "external" to refer to GL_TEXTURE_EXTERNAL_OES specifically,
since OES_EGL_image_external allows external eglImageOES to be attached
to GL_TEXTURE_2D in the presence of GL_OES_EGL_image. Thus, it should be
interpreted to refer to all types of external textures, including 2D
textures attached via glEGLImageTargetTexture2DOES.
Fixes: ed43dd62ac ("main: allow external textures for BindImageTexture")
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12383 >
2021-08-31 22:00:16 +00:00
Yiwei Zhang
4a2adb36ae
venus: set maxMipLevels to 1 for ahb images
...
Fixes: dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.*
Cc: 21.2.2 mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org >
Reviewed-by: Chia-I Wu <olvaffe@gmail.com >
Reviewed-by: Ryan Neph <ryanneph@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12639 >
2021-08-31 21:50:25 +00:00
Keith Packard
6440523077
iris: Map scanout buffers WC instead of WB [v2]
...
The scanout engine is not coherent with rendering, so make sure
scanout buffers are mapped WC. This ensures that CPU rendering as done
by the Xserver gets flushed to the frame buffer immediately instead of
waiting for some future time.
v2:
Also mark shared buffers to be allocated for scanout
in case they are being used for scanout elsewhere.
Signed-off-by: Keith Packard <keithp@keithp.com >
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5231
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12259 >
2021-08-31 21:05:18 +00:00
Chia-I Wu
86cb30baaf
venus: fix device group enumeration with unsupported devices
...
instance->physical_devices includes only supported devices, not all
devices. One example is that it does not include 1.0 devices. We need
to fix up VkPhysicalDeviceGroupProperties to exclude unsupported
devices.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com >
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org >
Reviewed-by: Ryan Neph <ryanneph@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12637 >
2021-08-31 20:54:06 +00:00
Chia-I Wu
a7ebcbbd6b
venus: pre-initialize device groups
...
We don't need to worry about how vkEnumeratePhysicalDeviceGroups is
called (props is NULL, props is non-NULL but count is 0, etc.) this way.
It also allows us to fix up VkPhysicalDeviceGroupProperties easily.
v2: let the for-loop increment (Yiwei)
Signed-off-by: Chia-I Wu <olvaffe@gmail.com >
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org > (v1)
Reviewed-by: Ryan Neph <ryanneph@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12637 >
2021-08-31 20:54:06 +00:00
Chia-I Wu
e2020484eb
venus: minor cleanup to physical device init loop
...
v2: let the for-loop increment (Yiwei)
Signed-off-by: Chia-I Wu <olvaffe@gmail.com >
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org > (v1)
Reviewed-by: Ryan Neph <ryanneph@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12637 >
2021-08-31 20:54:06 +00:00
Connor Abbott
88142d8a5a
ir3/ra: Fix type mismatch when comparing intervals
...
This was once a physreg, back in the very beginning of the new RA, but
now the caller passes an unsigned int.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5163
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12487 >
2021-08-31 20:33:49 +00:00
Connor Abbott
62a7acee93
ir3: Make ir3_register::name 32-bits
...
It was overflowing with
dEQP-VK.spirv_assembly.instruction.compute.spirv_ids_abuse.lots_ids.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12487 >
2021-08-31 20:33:49 +00:00