Commit Graph

154867 Commits

Author SHA1 Message Date
Mike Blumenkrantz 3ec74cd1c7 mesa: improve relocation problem message
make it easier to immediately know what the problem is

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16851>
2022-06-04 03:58:21 +00:00
Timothy Arceri 87aaa0f915 glsl: remove now unused lower_const_arrays_to_uniforms()
We now use a NIR version instead.

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770>
2022-06-04 03:13:36 +00:00
Timothy Arceri c573260c9b glsl: switch to NIR based implementation of lower_const_arrays_to_uniforms()
Shader-db results iris (BDW):

total instructions in shared programs: 17523543 -> 17513909 (-0.05%)
instructions in affected programs: 218091 -> 208457 (-4.42%)
helped: 69
HURT: 327
helped stats (abs) min: 2 max: 2919 x̄: 160.84 x̃: 12
helped stats (rel) min: 0.21% max: 96.88% x̄: 14.87% x̃: 6.40%
HURT stats (abs)   min: 1 max: 47 x̄: 4.48 x̃: 1
HURT stats (rel)   min: 0.10% max: 22.02% x̄: 3.33% x̃: 0.18%
95% mean confidence interval for instructions value: -45.02 -3.63
95% mean confidence interval for instructions %-change: -1.16% 1.47%
Inconclusive result (%-change mean confidence interval includes 0).

total loops in shared programs: 4875 -> 4868 (-0.14%)
loops in affected programs: 7 -> 0
helped: 7
HURT: 0
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
95% mean confidence interval for loops value: -1.00 -1.00
95% mean confidence interval for loops %-change: -100.00% -100.00%
Loops are helped.

total cycles in shared programs: 858032406 -> 857984712 (<.01%)
cycles in affected programs: 22940290 -> 22892596 (-0.21%)
helped: 155
HURT: 312
helped stats (abs) min: 1 max: 49696 x̄: 1697.70 x̃: 62
helped stats (rel) min: <.01% max: 70.84% x̄: 5.60% x̃: 0.82%
HURT stats (abs)   min: 1 max: 19640 x̄: 690.54 x̃: 100
HURT stats (rel)   min: <.01% max: 217.23% x̄: 33.57% x̃: 0.92%
95% mean confidence interval for cycles value: -436.09 231.84
95% mean confidence interval for cycles %-change: 15.39% 25.75%
Inconclusive result (value mean confidence interval includes 0).

total spills in shared programs: 16289 -> 15205 (-6.65%)
spills in affected programs: 2753 -> 1669 (-39.38%)
helped: 9
HURT: 1

total fills in shared programs: 20347 -> 20324 (-0.11%)
fills in affected programs: 1642 -> 1619 (-1.40%)
helped: 9
HURT: 1

total sends in shared programs: 972151 -> 971960 (-0.02%)
sends in affected programs: 1910 -> 1719 (-10.00%)
helped: 25
HURT: 20
helped stats (abs) min: 1 max: 50 x̄: 9.00 x̃: 2
helped stats (rel) min: 0.87% max: 53.76% x̄: 13.89% x̃: 6.25%
HURT stats (abs)   min: 1 max: 8 x̄: 1.70 x̃: 1
HURT stats (rel)   min: 8.33% max: 200.00% x̄: 52.36% x̃: 33.33%
95% mean confidence interval for sends value: -8.19 -0.29
95% mean confidence interval for sends %-change: -1.07% 32.18%
Inconclusive result (%-change mean confidence interval includes 0).

LOST:   3
GAINED: 27

Note a small number of tests fail on lima and r300 after this patch.
However since we are doing the correct thing here and they only
fail due to a slight increase in instruction count pushing them
over their instruction count limit, we are defering that issue
to a different bug report for further discussion.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6540

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770>
2022-06-04 03:13:36 +00:00
Timothy Arceri 1805ee8d7b glsl: move gl_nir_link_opts() call out of the st code
Calling this directly in the linker code allows us to place it between
the varying linker and uniform linker calls which allows for better
optimisation/removal of uniforms.

Also in a later patch it allows us to insert a new nir based
lower_const_arrays_to_uniforms() call after the gl_nir_link_opts()
call. This is important because it allows the linking opts to
move constant arrays to later stages if possible before
lower_const_arrays_to_uniforms() turns them into uniforms.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6541

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770>
2022-06-04 03:13:36 +00:00
Timothy Arceri a14e2733ce glsl: move common link time optimisation calls to linker code
In the following patch we will move the users of this function to
this file too and make it static again.

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770>
2022-06-04 03:13:36 +00:00
Timothy Arceri 64dbc3f03a glsl/nir: allow the nir linker to remove dead uniforms we created
Some backends lower constant arrays to uniforms in GLSL IR. These
create so called hidden uniforms. Since we know these are added
per stage it is safe to remove them if we detect they are dead.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770>
2022-06-04 03:13:36 +00:00
Timothy Arceri 4488b577a1 glsl/nir: skip adding hidden uniforms to the remap tables
The remap tables are used with the GL API so there is no need to
add hidden uniforms to them. Also when we switch to lowering some
constant arrays to uniforms in NIR in a following patch there
will no longer be enough room in the tables as we assign their
size in the GLSL IR linker not the NIR linker currently.

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770>
2022-06-04 03:13:36 +00:00
Timothy Arceri 44d6068c5b nir: add nir based version of the lower_const_arrays_to_uniforms pass
Doing this in NIR should give better results, but also allows us to
stop calling more GLSL IR optimisations passes.

v2: Skip 8bit and 16bit type that would require further processing
    I believe this is an existing bug in the GLSL IR pass also.

v3: rebuild constant initialisers as we want to call this pass
    after nir has already lowered them and performed optimisations.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770>
2022-06-04 03:13:36 +00:00
Georg Lehmann f3c3b8cf2a zink: Use VK_USE_64_BIT_PTR_DEFINES to check for 64bit platforms.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6605

Cc: mesa-stable

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16853>
2022-06-04 02:43:06 +00:00
Mike Blumenkrantz b0fe621459 zink: add back kms handling
removing this broke the ability to create system compositors

rework it a bit though so that kms handles are stored and destroyed
when the bo is freed

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16815>
2022-06-04 01:27:53 +00:00
Mike Blumenkrantz b4ef984ef3 Revert "zink: remove drm_fd"
This reverts commit c5960f64b1.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16815>
2022-06-04 01:27:53 +00:00
Mike Blumenkrantz b17aa29793 zink: handle aux plane imports
basically do nothing here and it magically works

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16822>
2022-06-04 01:05:43 +00:00
Mike Blumenkrantz d5d7279d38 zink: rename a variable
no functional changes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16822>
2022-06-04 01:05:43 +00:00
Mike Blumenkrantz 08116638fd zink: represent plane offsets using offset from plane 0 vs size of plane
this is a bit easier to keep track of

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16822>
2022-06-04 01:05:43 +00:00
Mike Blumenkrantz c57fa8b390 zink: fix dmabuf plane layout struct scoping
this struct needs to exist for all the scopes it's used in

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16822>
2022-06-04 01:05:43 +00:00
Adam Jackson 974606eb9d zink: Print the VkResult if vkCreateInstance fails
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16854>
2022-06-04 00:19:19 +00:00
Mike Blumenkrantz 4dd8c143a9 ci: disable unit tests
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16863>
2022-06-03 23:02:22 +00:00
Alyssa Rosenzweig ed4bd8738d panfrost/ci: Mark draw_buffers_indexed.* as flakes
These keep flaking. Icecream95 observes the issue relates to AFBC in the
discussion of the flake in issue 6604. Until the root cause can be identified
and fixed, mark the tests as known flakes for CI.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16855>
2022-06-03 21:05:22 +00:00
Mike Blumenkrantz b6a8014217 kopper: use get_drawable_info path for non-x11 drawables
wayland surfaces need to take this path to get resizing right

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16814>
2022-06-03 18:22:22 +00:00
Mike Blumenkrantz 20ba759694 egl/wayland: skip buffer creation on zink
this happens through wsi, so don't create resources that aren't used

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16814>
2022-06-03 18:22:22 +00:00
Mike Blumenkrantz f67bd8adfa egl/wayland: manually swap backbuffer when using zink
this would usually occur through dri2_wl_swrast_commit_backbuffer(),
but zink triggers this functionality using vulkan wsi, which fails to
perform these updates as expected

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16814>
2022-06-03 18:22:22 +00:00
SureshGuttula 5d0f922834 Revert "radeon: hardcode uvd/vce encoder not_referenced value to false"
This reverts commit 96b276b327.

This patch enable SVC encoding support on VCE/UVD.

Signed-off-by: Suresh Guttula <suresh.guttula@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16768>
2022-06-03 17:46:28 +00:00
Yonggang Luo ca700dcb0a microsoft/clc: Fixes compiling of microsoft clc with mingw
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16767>
2022-06-03 16:33:00 +00:00
Yonggang Luo 1720672e33 dzn: Fixes compiling error by include `<unknwn.h>`
In mingw's `<unknwn.h>`, it's defeind __REQUIRED_RPCNDR_H_VERSION__ to 475,
so that gcc/mingw won't raise compiling error that because directx/d3d12.h
define __REQUIRED_RPCNDR_H_VERSION__ to 500, but the maximal supported __REQUIRED_RPCNDR_H_VERSION__ in mingw
are 475.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16767>
2022-06-03 16:33:00 +00:00
Yonggang Luo 0445bfdc1b dzn: Fixes compiling error when build with msys2/mingw
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16767>
2022-06-03 16:33:00 +00:00
Yonggang Luo 6f61b1e1da d3d12/wgl/test: Fixes wgl_tests.cpp for d3d12 with mingw
wgl needs dxguids/dxguids.h for correct GUID

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16767>
2022-06-03 16:33:00 +00:00
Yonggang Luo e26f58e001 d3d12: `#include <windows.h>` instead `#include <Windows.h>` for building under linux with mingw
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16767>
2022-06-03 16:33:00 +00:00
Yonggang Luo 64b10ade2b d3d12: Fixes compiling error by include `<unknwn.h>`
In mingw's `<unknwn.h>`, it's defeind __REQUIRED_RPCNDR_H_VERSION__ to 475,
so that gcc/mingw won't raise compiling error that because directx/d3d12.h
define __REQUIRED_RPCNDR_H_VERSION__ to 500, but the maximal supported __REQUIRED_RPCNDR_H_VERSION__ in mingw
are 475.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16767>
2022-06-03 16:33:00 +00:00
Yonggang Luo d493e2ef7d d3d12: Move shared code that include d3d12 headers into d3d12_common.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16767>
2022-06-03 16:33:00 +00:00
Yonggang Luo b4f701f962 d3d12: Fixes d3d12 compiling errors in `D3D12ResourceState.h` for mingw
```
In file included from ../../src/gallium/drivers/d3d12/D3D12ResourceState.cpp:24:
../../src/gallium/drivers/d3d12/D3D12ResourceState.h:51:45: error: call to non-'constexpr' function 'D3D12_RESOURCE_STATES operator|(D3D12_RESOURCE_STATES, D3D12_RESOURCE_STATES)'
   45 | D3D12_RESOURCE_STATE_RENDER_TARGET          |
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   46 | D3D12_RESOURCE_STATE_UNORDERED_ACCESS       |
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   47 | D3D12_RESOURCE_STATE_DEPTH_WRITE            |
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   48 | D3D12_RESOURCE_STATE_STREAM_OUT             |
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   49 | D3D12_RESOURCE_STATE_COPY_DEST              |
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   50 | D3D12_RESOURCE_STATE_RESOLVE_DEST           |
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   51 | D3D12_RESOURCE_STATE_VIDEO_DECODE_WRITE     |
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   52 | D3D12_RESOURCE_STATE_VIDEO_PROCESS_WRITE;
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/CI-Tools/msys64/mingw64/include/minwindef.h:163,
                 from C:/CI-Tools/msys64/mingw64/include/windef.h:9,
                 from C:/CI-Tools/msys64/mingw64/include/windows.h:69,
                 from C:/CI-Tools/msys64/mingw64/include/rpc.h:16,
                 from ../../subprojects/DirectX-Headers-1.0/include/directx/d3d12.h:26,
                 from ../../src/gallium/drivers/d3d12/D3D12ResourceState.h:33,
                 from ../../src/gallium/drivers/d3d12/D3D12ResourceState.cpp:24:
../../subprojects/DirectX-Headers-1.0/include/directx/d3d12.h:2865:1: note: 'D3D12_RESOURCE_STATES operator|(D3D12_RESOURCE_STATES, D3D12_RESOURCE_STATES)' declared here
 2865 | DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_STATES );
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16767>
2022-06-03 16:33:00 +00:00
Mike Blumenkrantz 50bc8efe18 zink: disable compute pbos on turnip
this saves ~15 minutes in cts somehow

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16548>
2022-06-03 15:48:45 +00:00
Jesse Natalie 3cd320c5fa meson: Use a C99 STDC_VERSION for flex
Fixes: 8575d0e8 ("meson: modernize win_flex stdint.h logic")
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16839>
2022-06-03 15:13:10 +00:00
Konstantin Seurer ae19e9c292 radv: Some acceleration structure cleanups
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16782>
2022-06-03 13:28:37 +00:00
Konstantin Seurer 5c5021de27 radv: Add and use radv_cp_dma_wait_for_stages
Adds a small helper for handling cp dma sync. This
Also adds the missing handling for some stage
flags in write_event.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16782>
2022-06-03 13:28:37 +00:00
Hoe Hao Cheng 687fd67557 zink/codegen: do not automatically consider extensions promoted
...until an entry is added to VERSIONS in zink_device_info.py.

Now that we stop obtaining feature structs of promoted extensions when the VK
impl is new enough, it's possible for things to break when someone updates
vk.xml, and extensions get promoted but the codegen is not updated to include
e.g. info->feats13 and info->props13 (or newer) in zink_device_info

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16265>
2022-06-03 13:06:34 +00:00
Hoe Hao Cheng 07565e8852 zink/codegen: do not include compilation structs with extension structs
(compilation structs refer to VkPhysicalDeviceVulkanXYFeatures/Properties, as
they consist of all features added by extensions promoted in VK X.Y)

The spec prohibits this, so instead we map the fields in the compilation
structs onto the fields in extension structs.

Some extensions' feature/properties structs are not promoted, and the spec
allows including both compilation structs and extension structs in such cases.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16265>
2022-06-03 13:06:34 +00:00
Hoe Hao Cheng 0d344e96c0 zink/codegen: remember the fields in feats/props structs of extensions
this will be useful in the next commit, where we reapply fields from one struct
to another.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16265>
2022-06-03 13:06:34 +00:00
Pierre-Eric Pelloux-Prayer b51e40ebde st/mesa: use mutex in st_get_texture_sampler_view_from_stobj
st_texture_release_all_sampler_views uses the validate_mutex,
but st_get_texture_sampler_view_from_stobj didn't.

Since they both modify stObj->view we could have threadA in
st_get_texture_sampler_view_from_stobj with a non-NULL sv,
so expecting sv->view to be non-NULL, while threadB was in
st_texture_release_all_sampler_views clearing sv->view.

It's also needed to protect st_sampler_view::private_refcount,
which is supposed to be used from the owning context thread,
but can also be used by any context in st_texture_release_all_sampler_views.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6088
Fixes: ef5d427413 ("st/mesa: add a mechanism to bypass atomics when binding sampler views")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16779>
2022-06-03 14:10:28 +02:00
Tapani Pälli d07ec3f038 anv: use anv_cmd_dirty_mask_t type for dynamic state
We were using both uint32_t and anv_cmd_dirty_mask_t, this is
a cleanup making type usage consistent. Commit also changes type of
the mask to be enum anv_cmd_dirty_bits.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16849>
2022-06-03 14:11:04 +03:00
Boris Brezillon 2feef505c1 microsoft/spirv_to_dxil: Fix the push_constant UBO size calculation
Right now, we just consider the size of the accessed portion of the
push constant array, but it doesn't necessarily reflect the size
of the UBO we should declare.

Fixes: de1e941c59 ("microsoft/spirv_to_dxil: Lower push constant loads to UBO loads")
Reviewed-by: Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16703>
2022-06-03 10:43:18 +00:00
Boris Brezillon 6783a88455 microsoft/spirv_to_dxil: Fix push_constants type declaration
We're not declaring an array of bytes but an array of uint32. Let's
fix the element_count we pass to glsl_array_type().

Fixes: de1e941c59 ("microsoft/spirv_to_dxil: Lower push constant loads to UBO loads")
Reviewed-by: Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16703>
2022-06-03 10:43:17 +00:00
Daniel Schürmann b56fcefa0f nir/opt_vectorize: refactor src rewriting to avoid unnecessary mov instructions
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15647>
2022-06-03 08:53:18 +00:00
Samuel Pitoiset fe9f1d064a radv: enable radv_zero_vram for Hammerting
This native Vulkan game is broken, it has TON of Vulkan validation
errors and hangs without RADV_DEBUG=zerovram. Also tested with PRO
and AMDVLK.

The application name is also not really descriptive but the executable
name 'boot.exe' is worst.

https://github.com/ValveSoftware/Proton/issues/4347#issuecomment-1141415515

Cc: mesa-stable
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/16832>
2022-06-03 08:29:58 +00:00
Danylo Piliaiev eb5f4c2f6b spirv: Workaround for RelaxedPrecision on OpLogical* in 3DMark
Per spec RelaxedPrecision cannot be applied to bool types, however
3DMark Wild Life does it:

OpDecorate %171 RelaxedPrecision
...
%171 = OpLogicalAnd %bool %169 %170

Fixes crash in 3DMark Wild Life on Android.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16746>
2022-06-03 07:50:53 +00:00
Erik Faye-Lund c21dfe3348 meson: add back -Werror=vla to msvc compat flags
Back when STATIC_ASSERT was prepared for use in common code, the
-Werror=vla flag was removed from the MSVC compat flags. But now we're
using C++11 / C11 static asserts instead, so we can add it back again.

This should help us noticing some breakages before they happen.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>
2022-06-03 07:14:43 +00:00
Erik Faye-Lund 45fb815a75 util: implement STATIC_ASSERT using c++11 / c11 primitives
Since we now require C11 and C++14, we can use the standard
static_asserts from the standard library instead of rolling our own
compiler-specific versions.

To avoid needing scopes around usage in switch cases, keep the
while-wrapping from before. This means it still can't be used outside of
functions, but that should be fine; we should probably just use
static_assert directly in those cases anyway.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>
2022-06-03 07:14:43 +00:00
Erik Faye-Lund f1023571e8 util: use static_assert directly
For some reason, Clang doesn't love the STATIC_ASSERT implementation
we're about switch to in this *one* particular case. Other cases seems
to work fine, so let's just use static_assert directly here.

It lets us give a better error string anyway, so yay.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>
2022-06-03 07:14:43 +00:00
Erik Faye-Lund 873ec432b3 broadcom/compiler: use macro for power-of-two check
This will allow the use of static_assert here instead of our
compiler-specific implementation.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>
2022-06-03 07:14:43 +00:00
Erik Faye-Lund 2a134347cb intel/compiler: use macro for power-of-two check
This will allow the use of static_assert here instead of our
compiler-specific implementation.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>
2022-06-03 07:14:43 +00:00
Erik Faye-Lund 9ecb6f8820 util: add IS_POT macro
This macro kinda complements util_is_power_of_two_*, but is implemented
as a macro. This means that it can expand to a constant integral
expression, and thus be used in static_assert.

Because we don't really need the added complexity, this doesn't handle
zero correctly. But that's OK, because the call-sites will.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>
2022-06-03 07:14:43 +00:00