platform/upstream/mesa.git
2 years agod3d12: Lower load_sample_pos to load_sample_pos_at_id
Jesse Natalie [Thu, 13 Jan 2022 19:17:17 +0000 (11:17 -0800)]
d3d12: Lower load_sample_pos to load_sample_pos_at_id

D3D doesn't have an intrinsic for loading the current sample's
position, only for loading a specific sample's intrinsic. Fortunately,
we can also just get the current sample. So do that.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agod3d12: Sample mask output needs to be uint-typed
Jesse Natalie [Thu, 13 Jan 2022 17:44:26 +0000 (09:44 -0800)]
d3d12: Sample mask output needs to be uint-typed

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Lower helper invocations
Jesse Natalie [Wed, 19 Jan 2022 22:19:23 +0000 (14:19 -0800)]
microsoft/compiler: Lower helper invocations

DXIL adds this in SM6.6, so when we get around to being able to
emit SM6.6, we can conditionally turn this off and support emitting
the new intrinsic. Until then, this is easy.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Handle msb/lsb/bfrev
Jesse Natalie [Mon, 17 Jan 2022 21:54:25 +0000 (13:54 -0800)]
microsoft/compiler: Handle msb/lsb/bfrev

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Use ibfe/ubfe for bitfield extract instead of lowering to shifts
Jesse Natalie [Mon, 17 Jan 2022 21:38:36 +0000 (13:38 -0800)]
microsoft/compiler: Use ibfe/ubfe for bitfield extract instead of lowering to shifts

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Handle bitfield_insert
Jesse Natalie [Mon, 17 Jan 2022 21:20:53 +0000 (13:20 -0800)]
microsoft/compiler: Handle bitfield_insert

This *almost* matches what GLSL wants, except for the handling of
large widths. You can see this in the lowering algorithm:
   (('bitfield_insert', 'base', 'insert', 'offset', 'bits'),
    ('bcsel', ('ult', 31, 'bits'), 'insert',
              ('bfi', ('bfm', 'bits', 'offset'), 'insert', 'base')),
    'options->lower_bitfield_insert'),

DXIL's 'bfi' instruction is an inseparable pairing of NIR's 'bfi(bfm(...), ...)',
so we just apply the additional bcsel in the backend.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Emit samplers as array types
Jesse Natalie [Mon, 17 Jan 2022 15:49:22 +0000 (07:49 -0800)]
microsoft/compiler: Emit samplers as array types

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Handle load_invocation_id for GS and HS
Jesse Natalie [Mon, 3 Jan 2022 12:58:17 +0000 (04:58 -0800)]
microsoft/compiler: Handle load_invocation_id for GS and HS

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Handle tex texture/sampler offset srcs
Jesse Natalie [Sat, 15 Jan 2022 01:33:05 +0000 (17:33 -0800)]
microsoft/compiler: Handle tex texture/sampler offset srcs

Note that these offsets are 0-based, so to make them binding IDs we
need to explicitly add the base ID to them.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Handle input coverage
Jesse Natalie [Sat, 15 Jan 2022 00:16:31 +0000 (16:16 -0800)]
microsoft/compiler: Handle input coverage

Note that GL requires input coverage for sample execution mode to
be only the single bit corresponding to the executing sample, so
rearrange things to understand during shader emitting if we're
executing per-sample to emit the right coverage value.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Handle textureGatherCmp
Jesse Natalie [Fri, 14 Jan 2022 22:40:18 +0000 (14:40 -0800)]
microsoft/compiler: Handle textureGatherCmp

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Handle 'pull model' explicit interpolation intrinsics
Jesse Natalie [Fri, 14 Jan 2022 22:23:17 +0000 (14:23 -0800)]
microsoft/compiler: Handle 'pull model' explicit interpolation intrinsics

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Always have at least one GS active stream
Jesse Natalie [Sun, 21 Nov 2021 00:50:00 +0000 (16:50 -0800)]
microsoft/compiler: Always have at least one GS active stream

DXIL validation will fail if there's no stream that has a valid
primitive topology, which is what happens in the case of no
active streams.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Handle load_sample_pos_at_id
Jesse Natalie [Thu, 13 Jan 2022 19:16:52 +0000 (11:16 -0800)]
microsoft/compiler: Handle load_sample_pos_at_id

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agomicrosoft/compiler: Handle variables declared per-sample
Jesse Natalie [Thu, 13 Jan 2022 17:36:01 +0000 (09:36 -0800)]
microsoft/compiler: Handle variables declared per-sample

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>

2 years agoci/windows: Use 2 container stages
Jesse Natalie [Thu, 20 Jan 2022 13:50:02 +0000 (05:50 -0800)]
ci/windows: Use 2 container stages

The first container stage ("build") is for dependencies of the build.
These are infrequently-changing things like Visual Studio, LLVM, git,
and also meson. The second container stage ("test") currently depends
on the first, and adds test dependencies like piglit.

This lets us rev piglit without having to rebuild LLVM.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14637>

2 years agomesa: OpenGL ES 1.1 is not optional
Ian Romanick [Wed, 15 Dec 2021 01:55:21 +0000 (17:55 -0800)]
mesa: OpenGL ES 1.1 is not optional

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>

2 years agomesa: OpenGL 1.4 feature GL_EXT_point_parameters is not optional
Ian Romanick [Wed, 15 Dec 2021 01:51:56 +0000 (17:51 -0800)]
mesa: OpenGL 1.4 feature GL_EXT_point_parameters is not optional

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>

2 years agomesa: OpenGL 1.4 feature GL_EXT_blend_minmax is not optional
Ian Romanick [Wed, 15 Dec 2021 01:47:55 +0000 (17:47 -0800)]
mesa: OpenGL 1.4 feature GL_EXT_blend_minmax is not optional

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>

2 years agomesa: OpenGL 1.4 feature GL_EXT_blend_func_separate is not optional
Ian Romanick [Wed, 15 Dec 2021 01:45:24 +0000 (17:45 -0800)]
mesa: OpenGL 1.4 feature GL_EXT_blend_func_separate is not optional

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>

2 years agomesa: OpenGL 1.4 feature GL_EXT_blend_color is not optional
Ian Romanick [Wed, 15 Dec 2021 01:43:04 +0000 (17:43 -0800)]
mesa: OpenGL 1.4 feature GL_EXT_blend_color is not optional

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>

2 years agomesa: OpenGL 1.4 feature GL_ARB_texture_env_crossbar is not optional
Ian Romanick [Wed, 15 Dec 2021 01:41:31 +0000 (17:41 -0800)]
mesa: OpenGL 1.4 feature GL_ARB_texture_env_crossbar is not optional

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>

2 years agomesa: OpenGL 1.4 feature GL_ARB_depth_texture is not optional
Ian Romanick [Wed, 15 Dec 2021 01:32:30 +0000 (17:32 -0800)]
mesa: OpenGL 1.4 feature GL_ARB_depth_texture is not optional

Cheatsheet:

_mesa_has_ARB_depth_texture() becomes (true && ctx->Extensions.Version
>= _mesa_extension_table[...].version[ctx->API]).  The last value is 0
when ctx->API is API_OPENGL_COMPAT and ~0 otherwise.  The whole function
effectively becomes (ctx->API == API_OPENGL_COMPAT).

_mesa_has_OES_depth_texture() becomes (true && ctx->Extensions.Version
>= _mesa_extension_table[...].version[ctx->API]).  The last value is 0
when ctx->API is API_OPENGLES2 and ~0 otherwise.  The whole function
effectively becomes (ctx->API == API_OPENGLES2).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>

2 years agoturnip: Update the msm_kgsl.h header with the sanitized 4.19 version
Jordan Crouse [Fri, 21 Jan 2022 18:26:12 +0000 (18:26 +0000)]
turnip: Update the msm_kgsl.h header with the sanitized 4.19 version

The current msm_kgsl.h header in the tree isn't sanitized and the kernel
specific macros will confuse a compiler. Copy in the sanitized version of
the header from the 4.19 kernel tree which also adds a few new API bits
that are currently unused but may be useful some day.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14651>

2 years agotu/blit: Don't set CLAMPENABLE in sampler for 3d path
Connor Abbott [Wed, 19 Jan 2022 10:24:13 +0000 (11:24 +0100)]
tu/blit: Don't set CLAMPENABLE in sampler for 3d path

This was copied from the blob before we understood what it did, and it
has questionable utility: there's nothing in the GL, Vulkan, or D3D11
specs that require the result be clamped to the underlying range to
account for imprecision. And it doesn't make sense at all for cubic
filtering, because the result can legitimately be outside the range in
some scenarios. Just remove it.

This fixes a bunch of tests added in vulkan CTS 1.2.8 to test blitting
from compressed textures, which use random inputs and therefore are more
likely to hit the out-of-range condition. For example,
dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.etc2_r8g8b8a8_unorm_block.r8g8b8a8_snorm.general_general_cubic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14613>

2 years agofreedreno/a6xx: Name texture descriptor bit
Connor Abbott [Tue, 18 Jan 2022 17:46:49 +0000 (18:46 +0100)]
freedreno/a6xx: Name texture descriptor bit

This appears to do the same thing as CLAMPENABLE on a3xx. That is, it
clamps the result to [0, 1] for unorm formats and [-1, 1] for snorm
formats *after* filtering. In particular it's now more easily observable
with cubic filtering, because cubic filtering can produce values outside
the original range. Presumably this only matters with linear filtering
due to rounding errors when computing the weighted average.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14613>

2 years agointel/isl: Allow creating MCS in Tile4 memory
Nanley Chery [Thu, 8 Nov 2018 00:39:54 +0000 (16:39 -0800)]
intel/isl: Allow creating MCS in Tile4 memory

This enables MCS support on XeHP, now that MCS can be created with a
tiling supported by that platform.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14464>

2 years agointel/gen125.xml: Increase Auxiliary Surface Pitch
Nanley Chery [Mon, 29 Mar 2021 18:01:51 +0000 (11:01 -0700)]
intel/gen125.xml: Increase Auxiliary Surface Pitch

See Bspec 43862.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14464>

2 years agoRevert "intel/isl: Don't reconfigure aux surfaces for MCS"
Nanley Chery [Wed, 8 Dec 2021 01:40:15 +0000 (20:40 -0500)]
Revert "intel/isl: Don't reconfigure aux surfaces for MCS"

This reverts commit 2f0fbe06e65c5ae6c3e9ab3943a4a7d01ae9dc2f.

We don't handle the reconfiguration of existing HiZ surfaces, nor do we
do so for CCS surfaces. This code path is unused, so we remove it.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14464>

2 years agointel/isl: Strengthen MCS SINT format restriction
Nanley Chery [Wed, 8 Dec 2021 02:23:35 +0000 (21:23 -0500)]
intel/isl: Strengthen MCS SINT format restriction

The gfx7 MCS restriction for SINT formats actually applies to
multisampling in general. Place the stronger restriction in the format
support check and assert this in isl_surf_get_mcs_surf.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14464>

2 years agointel/isl: Don't check pitch in isl_surf_get_mcs_surf
Nanley Chery [Wed, 8 Dec 2021 01:37:25 +0000 (20:37 -0500)]
intel/isl: Don't check pitch in isl_surf_get_mcs_surf

The pitch check for 16x multisampled surfaces should already be covered
by the pitch_in_range check in isl_calc_row_pitch.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14464>

2 years agoradv: optimize CPU overhead of si_cp_dma_prefetch() slightly
Samuel Pitoiset [Wed, 19 Jan 2022 12:40:06 +0000 (13:40 +0100)]
radv: optimize CPU overhead of si_cp_dma_prefetch() slightly

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5008
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/14618>

2 years agowsi/x11: Avoid a class of deadlocks in the WSI queue thread
Adam Jackson [Wed, 27 Oct 2021 21:49:23 +0000 (17:49 -0400)]
wsi/x11: Avoid a class of deadlocks in the WSI queue thread

Here are two facts, each mildly unpleasant, quite nasty taken together:

- xcb_wait_for_special_event retries its poll() if the fd woke up but
  no matching event arrived, without verifying that the special event
  queue is still registered.
- Present gives no in-band notification of window destruction.

Now if the window is destroyed before the swapchain we're in trouble.
Our WSI thread might be stuck in xcb_wait_for_special_event as we're
awaiting a completion that won't come (the pixmap was being presented as
the window, and then the window was destroyed, so no more events can
happen on that window).

The solution is to use xcb_poll_for_special_event, which is
non-blocking, and handle the appropriate edge cases. If we've run the
event queue but we still don't have an image to acquire, we poke the X
server with a request that gently verifies that the window exists,
allowing the thread to exit gracefully in the above case.  We detect
when we're busy-looping, and poll on the X connection for up to 1ms in
response to avoid burning the CPU.

Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13564>

2 years agoRevert "nir/algebraic: distribute fmul(fadd(a, b), c) when b and c are constants"
Bas Nieuwenhuizen [Thu, 13 Jan 2022 11:51:52 +0000 (12:51 +0100)]
Revert "nir/algebraic: distribute fmul(fadd(a, b), c) when b and c are constants"

This reverts commit a1af902531122464b0f4eb66a7c4bf207a8a69f1.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5423
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14532>

2 years agoRevert "zink: handle vertex buffer offset overflows"
Charles Baker [Thu, 13 Jan 2022 07:19:33 +0000 (20:19 +1300)]
Revert "zink: handle vertex buffer offset overflows"

This reverts commit 9823b970fb51db21ac6ce29753eba82dc25f3072.

From VkPhysicalDeviceLimits [1]:

> maxVertexInputAttributeOffset is the maximum vertex input attribute
offset that can be added to the vertex input binding stride. The offset
member of the VkVertexInputAttributeDescription structure must be
less than or equal to this limit.

The maxVertexInputAttributeOffset is a limit on the offset of a vertex
attribute within a vertex rather than a limit on offsets for vertex
buffer bindings.  The code to bind temporary buffers can be removed.

[1] https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceLimits.html

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14572>

2 years agoradv: use 8x4 workgroups for wave32 RT
Rhys Perry [Wed, 8 Dec 2021 12:31:21 +0000 (12:31 +0000)]
radv: use 8x4 workgroups for wave32 RT

Beginning of Quake II RTX, 50% resolution scale, RX 6800: 54 -> 56 FPS.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14011>

2 years agoradv: use wave32 for raytracing
Rhys Perry [Thu, 2 Dec 2021 16:12:23 +0000 (16:12 +0000)]
radv: use wave32 for raytracing

Beginning of Quake II RTX, 50% resolution scale, RX 6800: 48 -> 54 FPS.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14011>

2 years agoradv: fix raytracing with wave32
Rhys Perry [Thu, 2 Dec 2021 16:08:47 +0000 (16:08 +0000)]
radv: fix raytracing with wave32

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5452
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14011>

2 years agozink: Set vertex binding stride without dynamic state extensions
Charles Baker [Thu, 9 Dec 2021 20:22:28 +0000 (09:22 +1300)]
zink: Set vertex binding stride without dynamic state extensions

EXT_vertex_input_dynamic_state

When both EXT_vertex_input_dynamic_state and EXT_extended_dynamic_state
are not available stride is never set and nothing is rasterized as all
triangles are degenerate.

This fix copies stride into the VkVertexInputBindingDescription array
when the graphics pipeline is created when those extensions aren't
available.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14549>

2 years agozink: Avoid redundant cast to uint on PackHalf2x16 result
Charles Baker [Fri, 14 Jan 2022 02:07:56 +0000 (15:07 +1300)]
zink: Avoid redundant cast to uint on PackHalf2x16 result

For example the previous code generates the following sequence of
SPIR-V instructions ending with a redundant cast to uint:

  %2018 = OpExtInst %uint %1 PackHalf2x16 %2017
  %2019 = OpBitcast %uint %2018

The new code generates:

  %2018 = OpExtInst %uint %1 PackHalf2x16 %2017

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14568>

2 years agozink: Output PackHalf2x16 to uint not float
Charles Baker [Thu, 9 Dec 2021 20:22:28 +0000 (09:22 +1300)]
zink: Output PackHalf2x16 to uint not float

Fixes InconsistentSpirv validation errors reporting that PackHalf2x16
outputs uint rather than float.

For example the previous code generates the following SPIR-V with
PackHalf2x16 output as a float:

  %2018 = OpExtInst %float %1 PackHalf2x16 %2017
  %2019 = OpBitcast %uint %2018

The new code generates:

  %2018 = OpExtInst %uint %1 PackHalf2x16 %2017
  %2019 = OpBitcast %uint %2018

cc: mesa-stable

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14568>

2 years agoac/nir: use shorter builder names
Rhys Perry [Thu, 6 Jan 2022 19:07:37 +0000 (19:07 +0000)]
ac/nir: use shorter builder names

This makes a lot of lines shorter.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>

2 years agoac/nir: avoid providing an align_mul to intrinsic builders
Rhys Perry [Fri, 7 Jan 2022 16:06:11 +0000 (16:06 +0000)]
ac/nir: avoid providing an align_mul to intrinsic builders

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>

2 years agoac/nir: avoid providing a write_mask to intrinsic builders
Rhys Perry [Fri, 7 Jan 2022 16:05:27 +0000 (16:05 +0000)]
ac/nir: avoid providing a write_mask to intrinsic builders

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>

2 years agoradv: avoid providing an align_offset to intrinsic builders
Rhys Perry [Thu, 6 Jan 2022 19:03:00 +0000 (19:03 +0000)]
radv: avoid providing an align_offset to intrinsic builders

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>

2 years agoradv: avoid providing an align_mul to intrinsic builders
Rhys Perry [Fri, 7 Jan 2022 16:06:04 +0000 (16:06 +0000)]
radv: avoid providing an align_mul to intrinsic builders

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>

2 years agoradv: avoid providing a write_mask to intrinsic builders
Rhys Perry [Fri, 7 Jan 2022 16:05:20 +0000 (16:05 +0000)]
radv: avoid providing a write_mask to intrinsic builders

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>

2 years agonir/builder: assume scalar alignment if not provided
Rhys Perry [Thu, 6 Jan 2022 18:04:21 +0000 (18:04 +0000)]
nir/builder: assume scalar alignment if not provided

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>

2 years agonir/builder: set write mask if not provided
Rhys Perry [Thu, 6 Jan 2022 17:52:15 +0000 (17:52 +0000)]
nir/builder: set write mask if not provided

Zero isn't really a valid write mask. If it's provided, use a full write
mask.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>

2 years agov3dv: check correct format when load/storing on a depth/stencil buffer
Alejandro Piñeiro [Wed, 19 Jan 2022 13:24:59 +0000 (14:24 +0100)]
v3dv: check correct format when load/storing on a depth/stencil buffer

When we create a image view with D24S8 format we made a reformatting
to RGBA8UI if the aspect selected is just STENCIL. But when
configuring the stores we select the aspects based on the attachment
format. Quoting from cmd_buffer_render_pass_emit_stores:

      /* From the Vulkan spec, VkImageSubresourceRange:
       *
       *   "When an image view of a depth/stencil image is used as a
       *   depth/stencil framebuffer attachment, the aspectMask is ignored
       *   and both depth and stencil image subresources are used."
       *
       * So we ignore the aspects from the subresource range of the image
       * view for the depth/stencil attachment, but we still need to restrict
       * the to aspects compatible with the render pass and the image.
       */
      const VkImageAspectFlags aspects =
         vk_format_aspects(ds_attachment->desc.format);

So we could ending trying to store on a Z+Stencil buffer, using a
RGBA8UI format.

So far this only affected some tests when using the simulator
(assert). Those were working on the real hw, but probably would fail
on other situations, so lets use the original image format on that
case.

v2 (Iago)
   * Improve comment grammar
   * Do the same on load too (not just store)

v3 (Iago)
    * Re-word comments.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14635>

2 years agov3dv: remove unused v3dv_descriptor_map_get_texture_format
Alejandro Piñeiro [Wed, 19 Jan 2022 12:08:35 +0000 (13:08 +0100)]
v3dv: remove unused v3dv_descriptor_map_get_texture_format

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14635>

2 years agov3dv: signal fence when all submitted jobs complete execution
Melissa Wen [Thu, 16 Dec 2021 10:47:18 +0000 (10:47 +0000)]
v3dv: signal fence when all submitted jobs complete execution

We track last submitted jobs by queue type. After all cmd buffer
batches have been submitted, we emit a noop job that waits all jobs
submitted to each GPU queue complete and signals the fence.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agov3dv: process signal semaphores in the very last job
Melissa Wen [Thu, 16 Dec 2021 22:43:49 +0000 (22:43 +0000)]
v3dv: process signal semaphores in the very last job

With multiple semaphores support, we can use a GPU job to handle
multiple signal semaphores in the end of a cmd buffer batch. It
means, the last job in the last cmd buffer will be in change of
signalling semaphores as long as it meets some conditions:
1 - A GPU-job signals semaphores whenever we only have submitted
jobs for the same queue (there is no syncobj created for any
other type). Otherwise, we emit a noop job that waits on the
completion of all jobs submitted and then signals semaphores.
2 - A CPU-job is never in charge of signalling semaphores. We
process it first and emit a noop job that depends on all jobs
previously submitted to signal semaphores.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agov3dv: handle wait semaphores in the first job by queue
Melissa Wen [Mon, 3 Jan 2022 13:55:37 +0000 (12:55 -0100)]
v3dv: handle wait semaphores in the first job by queue

With multiple semaphore support, we can improve the way we handle
wait semaphores considering different job types and cmd buffer
batch scenarios, that means:

- A GPU job depends on wait semaphores whenever it is the first job
submitted to a queue in this command buffer batch (the `first` flag
for the job's queue type is set).
- For the first CPU job, if there are wait semaphores, we should
wait for the CPU and GPU being idle to process the job.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agov3dv: track submitted jobs by GPU queue type
Melissa Wen [Tue, 14 Dec 2021 14:40:34 +0000 (13:40 -0100)]
v3dv: track submitted jobs by GPU queue type

The order in which a GPU job is scheduled is guaranteed within the
same queue type (CL, TFU, CSD), but the order of completion of jobs
from different queues cannot be guaranteed. Since we have multiple
semaphores support now, we can track the completion of the last job
submitted to each queue and therefore better determine when gpu is
idle. We do it using an array of syncobj (last_job_syncs) for each
GPU queue (CL, TFU, CSD). With this, job serialization also become
more accurate. We also keep tracking the very last job submitted
(last_job_sync became an element of the last_job_syncs array as
V3DV_QUEUE_ANY) for the case we don't have multisync support.
To help in handling wait semaphores, we set a flag per queue to
indicate we are starting a new cmd buffer batch and a job submitted
to this queue will be the first.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agov3dv: enable GPU jobs to signal multiple semaphores
Melissa Wen [Thu, 11 Nov 2021 13:54:30 +0000 (12:54 -0100)]
v3dv: enable GPU jobs to signal multiple semaphores

In addition to keep a copy of wait semaphores, extend
v3dv_submit_info_semaphores to hold a copy of signal semaphores too.
With a copy of wait and signal semaphores, we can enable GPU jobs to
handle more than one wait and signal semaphores.

By now, we don't change the way as we signalling semaphores when all
jobs complete, i.e., we still use the master thread to signal
semaphores. In this context, no GPU job is actually in charge of
signalling, but the support for multiple signal semaphores is done
here.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agov3dv: enable multiple semaphores for csd job
Melissa Wen [Mon, 4 Oct 2021 14:53:51 +0000 (15:53 +0100)]
v3dv: enable multiple semaphores for csd job

Whenever v3d kernel-driver supports multisync extension, use it to
allow add multiple semaphores as csd job dependency.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agov3dv: enable multiple semaphores for tfu job
Melissa Wen [Mon, 4 Oct 2021 13:36:12 +0000 (14:36 +0100)]
v3dv: enable multiple semaphores for tfu job

Whenever v3d kernel-driver supports multisync extension, use it to
enable more than one semaphores in a tfu job.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agov3dv: enable multiple semaphores on cl submission
Melissa Wen [Mon, 4 Oct 2021 13:31:55 +0000 (14:31 +0100)]
v3dv: enable multiple semaphores on cl submission

Whenever v3d kernel-driver supports multisync extension, use it to
enable more than one semaphores in cl submission. In CL, we have two
kind of job (bin and render), therefore, we need also to determine
the stage to sync, that means to add job dependencies/wait
semaphores.

Also, as we currently process all signal semaphores of a cmd buffer
batch together in the submit master thread (when the last wait
thread completes), there isn't now a situation in which GPU jobs
need to handle signal VkSemaphores.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agov3dv: check multiple semaphores capability
Melissa Wen [Mon, 4 Oct 2021 11:53:17 +0000 (12:53 +0100)]
v3dv: check multiple semaphores capability

Check if kernel-driver supports multisync extension

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agodrm-uapi/v3d: extend interface for multiple semaphores support
Melissa Wen [Mon, 4 Oct 2021 11:22:38 +0000 (12:22 +0100)]
drm-uapi/v3d: extend interface for multiple semaphores support

Extends command submission ioctls to support multiple semaphores through
generic ioctl extension design. In this approach, a multisync extension
subclasses a generic ioctl extension struct (base) and enables more than
one wait and signal semaphores. Multisync extension also uses v3d_queue
to specify the wait_stage, i.e. which job should sync before start (wait
semaphores).

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agov3dv: store wait semaphores in event_wait_cpu_job_info
Melissa Wen [Mon, 8 Nov 2021 20:10:45 +0000 (19:10 -0100)]
v3dv: store wait semaphores in event_wait_cpu_job_info

Instead of a boolean (sem_wait) in v3dv_event_wait_cpu_job_info,
that is used to determine wait condition for jobs put in a wait
thread, copy the wait semaphores data and store it as struct
v3dv_submit_info_semaphores. In the following patches we enable
multiple semaphores in GPU jobs, and therefore we need this data
to add wait semaphores as job dependencies for pending jobs
submitted from a wait thread.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agov3dv: wrap wait semaphores info in v3dv_submit_info_semaphores
Melissa Wen [Mon, 8 Nov 2021 15:50:52 +0000 (14:50 -0100)]
v3dv: wrap wait semaphores info in v3dv_submit_info_semaphores

Instead of pass pSubmit to queue_submit_cmd_buffer, create a struct
v3dv_submit_info_semaphores to wrap semaphores data from VkSubmitInfo.
In the next commit, this struct will help to handle wait condition for
jobs submitted in a wait event context, since we need to hold this
data when handle wait events and pass it to queue_submit_job() called
from wait threads. The main goal is to allow multiple wait semaphores
in a job submission. Later, this struct will be extended to include a
copy of signal semaphores too.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agov3dv: drop unused variable on handle_set_event_cpu_job
Melissa Wen [Wed, 13 Oct 2021 09:33:15 +0000 (10:33 +0100)]
v3dv: drop unused variable on handle_set_event_cpu_job

is_wait_thread is passed, but not actually used; and cpu_queue_handle_idle
is in charge to handle wait threads spawned before this one.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13178>

2 years agomesa: use less temporaries in build_lighting
Pierre-Eric Pelloux-Prayer [Tue, 18 Jan 2022 10:50:37 +0000 (11:50 +0100)]
mesa: use less temporaries in build_lighting

Preallocating temporaries can cause "out of temporaries" error.
Switch to on-demand allocation.

Growing temp_in_use would be an alternative, but some drivers
support less than 64 temps (see PIPE_SHADER_CAP_MAX_TEMPS) so
this wouldn't help them.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5777
Fixes: 272acbed0e2 ("mesa: merge STATE_LIGHTPROD parameters")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14590>

2 years agoradv: fix computing the number of color samples if no attachments
Samuel Pitoiset [Thu, 20 Jan 2022 22:49:08 +0000 (23:49 +0100)]
radv: fix computing the number of color samples if no attachments

When no color attachments, the rasterization samples should be used.

Fixes: 0222dace909 ("radv: Support VK_KHR_dynamic_rendering for pipeline creation.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5830
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/14642>

2 years agodriconf: enable vs_position_always_invariant for Dirt Rally
Pierre-Eric Pelloux-Prayer [Wed, 19 Jan 2022 11:10:49 +0000 (12:10 +0100)]
driconf: enable vs_position_always_invariant for Dirt Rally

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5648
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14614>

2 years agor300: properly initialize new_vs in r300_draw_init_vertex_shader
Pavel Ondračka [Wed, 19 Jan 2022 14:43:11 +0000 (15:43 +0100)]
r300: properly initialize new_vs in r300_draw_init_vertex_shader

Fixes the following valgrind warnings:
 Conditional jump or move depends on uninitialised value(s)
    at 0x5D1298C: draw_pt_so_emit_prepare (draw_pt_so_emit.c:95)
    by 0x5D89FD7: llvm_middle_end_prepare (draw_pt_fetch_shade_pipeline_llvm.c:319)
    by 0x5D13BFF: vsplit_prepare (draw_pt_vsplit.c:229)
    by 0x5D0D5D8: draw_pt_arrays.isra.0 (draw_pt.c:124)
    by 0x5D0DA08: draw_instances (draw_pt.c:484)
    by 0x5D0DEB9: draw_vbo (draw_pt.c:610)
    by 0x5E847D6: r300_swtcl_draw_vbo (r300_render.c:901)
    by 0x5D67125: u_vbuf_draw_vbo (u_vbuf.c:1470)
    by 0x5CFCAD3: cso_multi_draw (cso_context.c:1639)
    by 0x58FEC37: st_draw_gallium (st_draw.c:186)
    by 0x5A486BA: _mesa_draw_arrays.part.0 (draw.c:1323)
    by 0x48B4E27: stub_glDrawArrays (piglit-dispatch-gen.c:12421)
  Uninitialised value was created by a stack allocation
    at 0x5E90D3F: r300_draw_init_vertex_shader (r300_vs_draw.c:313)

 Conditional jump or move depends on uninitialised value(s)
    at 0x5D175D9: draw_create_vertex_shader (draw_vs.c:70)
    by 0x5E90E7A: r300_draw_init_vertex_shader (r300_vs_draw.c:366)
    by 0x5E8751F: r300_create_vs_state (r300_state.c:1950)
    by 0x594453B: st_create_common_variant (st_program.c:888)
    by 0x594720C: st_get_common_variant (st_program.c:973)
    by 0x59484B6: st_precompile_shader_variant (st_program.c:1994)
    by 0x59484B6: st_finalize_program (st_program.c:2056)
    by 0x58F0571: st_program_string_notify (st_cb_program.c:128)
    by 0x5928C9B: st_link_tgsi (st_glsl_to_tgsi.cpp:7514)
    by 0x5904B53: st_link_shader (st_glsl_to_ir.cpp:178)
    by 0x58D3E08: _mesa_glsl_link_shader (link_program.cpp:91)
    by 0x58865C7: link_program (shaderapi.c:1363)
    by 0x58865C7: link_program_error.part.0 (shaderapi.c:1474)
    by 0x48DBC5A: stub_glLinkProgram (piglit-dispatch-gen.c:34426)
  Uninitialised value was created by a stack allocation
    at 0x5E90D4F: r300_draw_init_vertex_shader (r300_vs_draw.c:313)

Based on Filip Gawin's
   r300: set new_vs.type to PIPE_SHADER_IR_TGSI

CC: mesa-stable
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14620>

2 years agomesa/st: move perf query test to st_context, drop files.
Dave Airlie [Tue, 21 Dec 2021 04:28:31 +0000 (14:28 +1000)]
mesa/st: move perf query test to st_context, drop files.

This removes the unused cb perf query files

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: drop lots of perfquery wrappers
Dave Airlie [Tue, 21 Dec 2021 04:27:07 +0000 (14:27 +1000)]
mesa/st: drop lots of perfquery wrappers

Just direct call into pipe driver.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: drop some bindless wrappers
Dave Airlie [Tue, 21 Dec 2021 03:51:50 +0000 (13:51 +1000)]
mesa/st: drop some bindless wrappers

Just call directly into pipe

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: move memory query into mesa.
Dave Airlie [Mon, 20 Dec 2021 04:14:45 +0000 (14:14 +1000)]
mesa/st: move memory query into mesa.

Drop the gl_memory_info type as it's equiv to the pipe one, and
internal

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: move shader completion into mesa
Dave Airlie [Mon, 20 Dec 2021 05:27:50 +0000 (15:27 +1000)]
mesa/st: move shader completion into mesa

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: inline st_max_shader_compiler_threads
Dave Airlie [Mon, 20 Dec 2021 05:21:44 +0000 (15:21 +1000)]
mesa/st: inline st_max_shader_compiler_threads

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/ctx: store screen pointer in ctx as well
Dave Airlie [Mon, 20 Dec 2021 05:24:03 +0000 (15:24 +1000)]
mesa/ctx: store screen pointer in ctx as well

This is actually useful to have.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: move evaluate depth values into mesa
Dave Airlie [Tue, 21 Dec 2021 05:44:35 +0000 (15:44 +1000)]
mesa/st: move evaluate depth values into mesa

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st/vdpau: direct call the vdpau functions.
Dave Airlie [Mon, 20 Dec 2021 04:37:08 +0000 (14:37 +1000)]
mesa/st/vdpau: direct call the vdpau functions.

This provides versions when vdpau is turned off, removes dd.h entries

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: drop release all sampler views wrapper
Dave Airlie [Tue, 21 Dec 2021 05:33:24 +0000 (15:33 +1000)]
mesa/st: drop release all sampler views wrapper

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: move st_TexParameter into mesa
Dave Airlie [Tue, 21 Dec 2021 05:29:54 +0000 (15:29 +1000)]
mesa/st: move st_TexParameter into mesa

Some places this just passes an always true pname, so just call
sampler view invalidate directly

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: drop useless tex parameter calls.
Dave Airlie [Tue, 21 Dec 2021 05:22:05 +0000 (15:22 +1000)]
mesa/st: drop useless tex parameter calls.

st_TexParameter never does anything for these

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/dd: drop GetProgramBinaryDriverSHA1
Dave Airlie [Mon, 20 Dec 2021 04:52:24 +0000 (14:52 +1000)]
mesa/dd: drop GetProgramBinaryDriverSHA1

Just call direct into state tracker

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: move pin l3 cache to direct check/call.
Dave Airlie [Mon, 20 Dec 2021 04:27:37 +0000 (14:27 +1000)]
mesa/st: move pin l3 cache to direct check/call.

Drop another dd.h entry

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: drop emit string marker device table entry.
Dave Airlie [Mon, 20 Dec 2021 04:25:21 +0000 (14:25 +1000)]
mesa/st: drop emit string marker device table entry.

Just check for the gallium callback instead

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: directly call the uuid get funcs.
Dave Airlie [Mon, 20 Dec 2021 04:19:37 +0000 (14:19 +1000)]
mesa/st: directly call the uuid get funcs.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: drop last user of st_Enable.
Dave Airlie [Mon, 20 Dec 2021 04:10:37 +0000 (14:10 +1000)]
mesa/st: drop last user of st_Enable.

Move the debug output piece into mesa

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: migrate debug callback code into mesa
Dave Airlie [Mon, 20 Dec 2021 04:09:14 +0000 (14:09 +1000)]
mesa/st: migrate debug callback code into mesa

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: remove st_context from debug callback
Dave Airlie [Mon, 20 Dec 2021 04:04:33 +0000 (14:04 +1000)]
mesa/st: remove st_context from debug callback

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agomesa/st: move intel blackhole noop enable to frontend
Dave Airlie [Mon, 20 Dec 2021 04:01:33 +0000 (14:01 +1000)]
mesa/st: move intel blackhole noop enable to frontend

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

2 years agozink: hook up planar image format creation
Mike Blumenkrantz [Thu, 18 Nov 2021 22:04:02 +0000 (17:04 -0500)]
zink: hook up planar image format creation

it'll explode if used for anything, but this is how it's done

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13865>

2 years agozink: link with vulkan utils
Mike Blumenkrantz [Thu, 18 Nov 2021 21:40:56 +0000 (16:40 -0500)]
zink: link with vulkan utils

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13865>

2 years agontt: Extend ntt_compile::addr_declared and ntt_compile::addr_reg
Ian Romanick [Mon, 10 Jan 2022 22:52:08 +0000 (14:52 -0800)]
ntt: Extend ntt_compile::addr_declared and ntt_compile::addr_reg

This was identified by Coverity.  4bb9c0a28a5 added uses of a third
address register, but the arrays for tracking address registers only
have two slots.

Add back a version of the assertion from before 4bb9c0a28a5 to help
prevent future problems.  I don't think any drivers that would hit
this path use NIR-to-TGSI yet, so it may be moot.

Reviewed-by: Matt Turner <mattst88@gmail.com>
CID: 1496942
CID: 1496944
Fixes: 4bb9c0a28a5 ("nir_to_tgsi: Use the same address reg mappings as GLSL-to-TGSI did.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14487>

2 years agonir/algebraic: optimize expressions using fmulz/ffmaz
Rhys Perry [Tue, 14 Sep 2021 17:02:01 +0000 (18:02 +0100)]
nir/algebraic: optimize expressions using fmulz/ffmaz

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>

2 years agonir: add some missing nir_alu_type_get_base_type
Rhys Perry [Fri, 15 Oct 2021 16:23:51 +0000 (17:23 +0100)]
nir: add some missing nir_alu_type_get_base_type

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>

2 years agonir/algebraic: optimize open-coded fmulz/ffmaz
Rhys Perry [Fri, 1 Oct 2021 10:27:00 +0000 (11:27 +0100)]
nir/algebraic: optimize open-coded fmulz/ffmaz

This pattern will be found in future versions of D3D9 DXVK.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>

2 years agonir/algebraic: add ignore_exact() wrapper
Rhys Perry [Fri, 15 Oct 2021 15:39:35 +0000 (16:39 +0100)]
nir/algebraic: add ignore_exact() wrapper

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>

2 years agoaco: create v_mac_legacy_f32/v_fmac_legacy_f32
Rhys Perry [Tue, 27 Apr 2021 11:11:37 +0000 (12:11 +0100)]
aco: create v_mac_legacy_f32/v_fmac_legacy_f32

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>

2 years agoaco: consider legacy multiplications in optimizer
Rhys Perry [Tue, 21 Sep 2021 16:03:05 +0000 (17:03 +0100)]
aco: consider legacy multiplications in optimizer

Optimize omod, -(a*b), b2f(a)*b, a*1, a*0 and create MAD/FMA.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>

2 years agoradv,aco,ac/llvm: implement fmulz and ffmaz
Rhys Perry [Tue, 27 Apr 2021 11:28:27 +0000 (12:28 +0100)]
radv,aco,ac/llvm: implement fmulz and ffmaz

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>

2 years agonir: add nir_op_fmulz and nir_op_ffmaz
Rhys Perry [Wed, 28 Apr 2021 16:48:54 +0000 (17:48 +0100)]
nir: add nir_op_fmulz and nir_op_ffmaz

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436>

2 years agointel/fs: Fix gl_FrontFacing optimization on Gfx12+
Ian Romanick [Wed, 19 Jan 2022 00:30:37 +0000 (16:30 -0800)]
intel/fs: Fix gl_FrontFacing optimization on Gfx12+

It's not obvious why the (gl_FrontFacing ? -1.0 : 1.0) case was handled
different for Gfx12+ than for previous generations, and it's not
correct.  It tries to negate the result as an integer, and it does this
before the mask operation that clears the other bits in the value.

When we eventually support dual-SIMD8 dispatch, the other front-facing
bit is in g1.6 at bit 15, so similar code should be possible there.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Fixes: c92fb60007f ("intel/fs/gen12: Implement gl_FrontFacing on gen12+.")
Closes: #5876
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14625>