Commit Graph

144314 Commits

Author SHA1 Message Date
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
Connor Abbott 82c3dc220e ir3: Make instruction IP 32 bits
a6xx supports shaders with more than 64k dwords, or at least the shader
size register has increased in size, and the matching name is gone so
there's no reason to be clever here. This doesn't fix anything at the
moment.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12487>
2021-08-31 20:33:49 +00:00
Connor Abbott 9fd1616842 ir3: Remove ir3_instr::name
Unused since the switch to new RA.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12487>
2021-08-31 20:33:49 +00:00
Emma Anholt 600bdde2c1 nir_to_tgsi: Use explicit sizes of NIR variables for UBO declarations.
This fixes duplicate CB0 declarations, missing interface array
declarations, and too-low sizes of UBOs containing multiple nir_variables.

Closes: #4810
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12175>
2021-08-31 20:12:16 +00:00
Emma Anholt 33182c555f nir/nir_lower_uniforms_to_ubo: Set the explicit stride of the UBO 0 uniform.
Normal UBOs have explicit strides on them, make our lowered one behave the
same.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12175>
2021-08-31 20:12:16 +00:00
Emma Anholt 01759d3fb2 nir: Set .driver_location for GLSL UBO/SSBOs when we lower to block indices.
Without this, there's no way to match the UBO nir_variable declarations to
the load_ubo intrinsics referencing their data.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12175>
2021-08-31 20:12:16 +00:00
Ian Romanick f2c69f8306 anv: Enable KHR_shader_integer_dot_product
For now, only mark the 4x8BitPacked variants as accelerated.

Applications are unlikely to use the "add with saturate" opcodes from
VK_INTEL_shader_integer_functions2, so, technically, all of the
AccumulatingSaturating variants "[provide] a performance advantage over
user-provided code composed from elementary instructions..." on all
Intel platforms.  If we encounter an application that cares, we can do
things differently then.  Ditto for the non-packed 8Bit, 4-element
vector variants.

v2: Don't memset props as this also zeros sType and pNext.  Noticed by
Georg Lehmann in !12617.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12624>
2021-08-31 19:57:21 +00:00
Mike Blumenkrantz 24b8fc38c3 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:30 +00:00
Mike Blumenkrantz 88c3904289 docs: mark off ES 3.2 for zink
blammo

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:30 +00:00
Mike Blumenkrantz 1bbab34660 zink: enable fbfetch pipe cap
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz 3b04a3c797 zink: add a renderpass flag for input attachment layout handling
this has special requirements

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz 8fb1dff797 zink: update push descriptor set anytime fbfetch changes
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz 48676b64a0 zink: add an input attachment to the gfx push set layout to handle fbfetch
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz 8529c64fb7 zink: fix lazy descriptor deinit
this used to be the right conditional, but it's not anymore

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz 08050b7e98 zink: add an input attachment to the gfx push set layout to handle fbfetch
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz 052f85ea1b zink: flag color attachment images as input attachments at creation
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz d31b7dcefd zink: track fbfetch info on context, update as needed
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz 45a1d43439 zink: refactor descriptor layout/template creation a little
make the push sets more flexible

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz 8fb7875291 zink: add a compiler pass to translate fbfetch -> input attachments
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz c9edf964b0 zink: emit fbfetch variables as ntv input attachments
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz 73456393d8 zink: add input attachment thingy for spirv builder
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz 25fe797104 zink: move alphaToOne warning to a dynamic warning
stop spamming these if they aren't even being used

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12647>
2021-08-31 19:32:26 +00:00