Commit Graph

165789 Commits

Author SHA1 Message Date
Patrick Lerda
99cb7a1705 radeonsi: set proper drm_amdgpu_cs_chunk_fence alignment
The 'struct drm_amdgpu_cs_chunk_fence' is processed as
'struct drm_amdgpu_cs_chunk_data' which is a union.
This change ensures the proper alignment for this structure
to be processed as 'struct drm_amdgpu_cs_chunk_data'.

The presence of __u64 as one member of
'struct drm_amdgpu_cs_chunk_data' makes the
whole structure expected to be 64-bit aligned.

This is a minor issue detected by the gcc sanitizer (ubsan), for instance at the libdrm library:
../amdgpu/amdgpu_cs.c:937:26: runtime error: member access within misaligned address 0x63100001484c for type 'struct drm_amdgpu_cs_chunk_data', which requires 8 byte alignment
0x63100001484c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
                ^

Fixes: ae7e4d7619 ("amd: rename ring_type --> amd_ip_type and match the kernel enum values")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22920>
(cherry picked from commit acdd6a2a6c)
2023-05-19 09:15:10 -07:00
Matthieu Bouron
649c2f5bd0 lavapipe: honor dst base array layer when resolving color attachments
CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22924>
(cherry picked from commit 57afa7c0b1)
2023-05-19 09:15:09 -07:00
Mike Blumenkrantz
335a71d687 glsl/lower_samplers_as_deref: apply bindings for unused samplers
if a sampler is never used (no derefs) then its binding will never be
applied here, leaving it with binding=0. this will clobber the real binding=0
sampler in driver backends, leading to errors, so try to iterate using
the same criteria as above and apply bindings in the same way

fixes #8974

cc: mesa-stable

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22902>
(cherry picked from commit ccbfcf3933)
2023-05-19 09:15:07 -07:00
Qiang Yu
60ea1c9036 ac/nir/cull: fix line position w culling
Fixes: db0e9d3cab ("ac/nir/ngg: support line culling")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8950
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22867>
(cherry picked from commit 1ba2460e61)
2023-05-19 09:15:06 -07:00
Mike Blumenkrantz
8e5873161f zink: flush INDIRECT_BUFFER mem barrier for compute
this is usable in gfx and compute, so don't desync

Fixes: 3674839d11 ("zink: batch mem barrier hooks")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
(cherry picked from commit 4b7245284d)
2023-05-19 09:15:04 -07:00
Mike Blumenkrantz
c7ceec871f zink: unbind the ssbo slot being iterated, not the index of the buffer
this otherwise breaks ssbo binding

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
(cherry picked from commit 5149b2a938)
2023-05-19 09:15:01 -07:00
Mike Blumenkrantz
818dffc733 zink: use an intermediate variable for binding ssbo slots
this makes the bug more obvious

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
(cherry picked from commit 2f0749f8fd)
2023-05-19 09:14:59 -07:00
Mike Blumenkrantz
4c3dd94cd1 zink: stringify unsupported prim restart log error
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22760>
(cherry picked from commit 95df5f2e8c)
2023-05-19 09:14:54 -07:00
Mike Blumenkrantz
c2435ea929 zink: allow vk 1.2 timelineSemaphore feature if extension isn't supported
this is a weird case but whatever

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22760>
(cherry picked from commit e205a4839b)
2023-05-19 09:14:53 -07:00
Mike Blumenkrantz
080aa11fbc zink: don't init mutable resource bit for swapchain images
these are either already mutable (for srgb) or invalid usage

fixes #8970

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22876>
(cherry picked from commit d2c63624c1)
2023-05-19 09:14:52 -07:00
Connor Abbott
95636d3e48 tu: Don't override depth for GMEM
Otherwise accesses to non-0 views of input attachments may be considered
out-of-bounds and return 0. This should've been removed when enabling
multiview for GMEM, not sure how it was missed.

Fixes: def56b531c ("tu: Support GMEM with layered rendering and multiview")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
(cherry picked from commit f6902bf425)
2023-05-19 09:14:50 -07:00
Konstantin Seurer
dbafe97b7a nir/lower_fp16_casts: Fix SSA dominance
Fixes: 01dfd65 ("nir: port fp16 casting code from dxil")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22804>
(cherry picked from commit 5503a08583)
2023-05-19 09:14:47 -07:00
Gert Wollny
68da75ebf9 r600/sfn: fix cube to array lowering for LOD
Makes piglits related to texturequerylod and samplercubearray pass.

Fixes: 79ca456b48 ("r600/sfn: rewrite NIR backend")
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22883>
(cherry picked from commit 1ae09f3eff)
2023-05-19 09:14:45 -07:00
Tapani Pälli
cdbd62c4a1 isl: fix layout for comparing surf and view properties
These asserts were checking isl_format_layout against itself, change
to compare surface format layout against view format layout.

Fixes: 628bfaf1c6 ("intel/isl: Add some sanity checks for compressed surfaces")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22790>
(cherry picked from commit c35d430460)
2023-05-18 14:13:04 -07:00
Lionel Landwerlin
479a915d88 intel/fs: fix scheduling of HALT instructions
With the following test :

dEQP-VK.spirv_assembly.instruction.terminate_invocation.terminate.no_out_of_bounds_load

There is a :

shader_start:
   ...                                 <- no control flow
   g0 = some_alu
   g1 = fbl
   g2 = broadcast g3, g1
   g4 = get_buffer_size g2
   ...                                 <- no control flow
   halt                                <- on some lanes
   g5 = send <surface>, g4

eliminate_find_live_channel will remove the fbl/broadcast because it
assumes lane0 is active at get_buffer_size :

shader_start:
   ...                                 <- no control flow
   g0 = some_alu
   g4 = get_buffer_size g0
   ...                                 <- no control flow
   halt                                <- on some lanes
   g5 = send <surface>, g4

But then the instruction scheduler will move the get_buffer_size after
the halt :

shader_start:
   ...                                 <- no control flow
   halt                                <- on some lanes
   g0 = some_alu
   g4 = get_buffer_size g0
   g5 = send <surface>, g4

get_buffer_size pulls the surface index from lane0 in g0 which could
have been turned off by the halt and we end up accessing an invalid
surface handle.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20765>
(cherry picked from commit 9471ffa70a)
2023-05-18 14:13:03 -07:00
Timur Kristóf
61b376097c aco: Disallow constant propagation on SOPP and fixed operands.
Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22690>
(cherry picked from commit 38447b3f63)
2023-05-18 14:13:03 -07:00
David Heidelberg
26ca82ce3d panvk: clear dangling pointers
Fixes:
```
[829/1646] Compiling C object src/panfrost/vulkan/libpanvk_v6.a.p/panvk_vX_meta_clear.c.o
In function 'panvk_meta_clear_zs_img',
    inlined from 'panvk_v6_CmdClearDepthStencilImage' at ../src/panfrost/vulkan/panvk_vX_meta_clear.c:457:7:
../src/panfrost/vulkan/panvk_vX_meta_clear.c:415:26: warning: storing the address of local variable 'view' in '((struct pan_fb_info *)((char *)commandBuffer + 144))[23].zs.view.zs' [-Wdangling-pointer=]
  415 |       fbinfo->zs.view.zs = &view;
      |       ~~~~~~~~~~~~~~~~~~~^~~~~~~
../src/panfrost/vulkan/panvk_vX_meta_clear.c: In function 'panvk_v6_CmdClearDepthStencilImage':
../src/panfrost/vulkan/panvk_vX_meta_clear.c:393:26: note: 'view' declared here
  393 |    struct pan_image_view view = {
      |                          ^~~~
../src/panfrost/vulkan/panvk_vX_meta_clear.c:393:26: note: 'commandBuffer' declared here
[844/1646] Compiling C object src/panfrost/vulkan/libpanvk_v7.a.p/panvk_vX_meta_clear.c.o
In function 'panvk_meta_clear_zs_img',
    inlined from 'panvk_v7_CmdClearDepthStencilImage' at ../src/panfrost/vulkan/panvk_vX_meta_clear.c:457:7:
../src/panfrost/vulkan/panvk_vX_meta_clear.c:415:26: warning: storing the address of local variable 'view' in '((struct pan_fb_info *)((char *)commandBuffer + 144))[23].zs.view.zs' [-Wdangling-pointer=]
  415 |       fbinfo->zs.view.zs = &view;
      |       ~~~~~~~~~~~~~~~~~~~^~~~~~~
../src/panfrost/vulkan/panvk_vX_meta_clear.c: In function 'panvk_v7_CmdClearDepthStencilImage':
../src/panfrost/vulkan/panvk_vX_meta_clear.c:393:26: note: 'view' declared here
  393 |    struct pan_image_view view = {
      |                          ^~~~
../src/panfrost/vulkan/panvk_vX_meta_clear.c:393:26: note: 'commandBuffer' declared here
```

Cc: mesa-stable

Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22829>
(cherry picked from commit 2b4ce498ee)
2023-05-18 14:13:02 -07:00
Erik Faye-Lund
30cd858a7d llvmpipe: fixup refactor copypasta
I accidentally set this state based on the wrong state when refactoring,
whoops!

Fixes: a1846e3926 ("llvmpipe: merge all rasterizer-bind functions")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22832>
(cherry picked from commit 360feea99c)
2023-05-18 14:13:01 -07:00
Luna Nova
a2e6a1f0db device_select_layer: pick a default device before applying DRI_PRIME
This ensures DRI_PRIME works if there are multiple CPU devices available

Suggested by @pepp

Fixes: afa1fba1 ("vulkan/device_select: don't pick a cpu driver as the default")

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19101>
(cherry picked from commit 571ce2e481)
2023-05-18 14:13:01 -07:00
Luna Nova
f220932fd6 device_select_layer: apply DRI_PRIME even if default device is > 1 to match opengl behavior
This fixes DRI_PRIME=1 doing nothing if the GPU order is [dGPU, dGPU,
iGPU, cpu] (or more GPUs than that) and the iGPU is the default GPU.

Fixes: afa1fba1 ("vulkan/device_select: don't pick a cpu driver as the default")

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19101>
(cherry picked from commit f958a45a71)
2023-05-18 14:13:00 -07:00
Luna Nova
c5c6f96ab0 device_select_layer: fix inverted strcmp in device_select_find_dri_prime_tag_default (v1)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7498
Fixes: 9bc5b2d169 ("vulkan: add initial device selection layer. (v6.1)")

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19101>
(cherry picked from commit 7fcda2b4e3)
2023-05-18 14:12:59 -07:00
Mike Blumenkrantz
7278e4442c cso: unbind fb state when unbinding the context
this avoids leaking/ballooning references

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22673>
(cherry picked from commit c686c98a79)
2023-05-18 14:12:59 -07:00
Mike Blumenkrantz
d1b81dafbf zink: set depth dynamic state values unconditionally
spec requires the state values to be set if the dynamic state is
enabled regardless of whether they will take effect

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22827>
(cherry picked from commit d5ceb4770b)
2023-05-18 14:12:58 -07:00
Dylan Baker
c75b1348ec .pick_status.json: Updates notes for a77c88f1e8 2023-05-18 10:04:20 -07:00
Yiwei Zhang
82d8d9151d radv: respect VK_QUERY_RESULT_WAIT_BIT in GetQueryPoolResults
The flag was ignored for VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT and
VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT.

Cc: mesa-stable

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22781>
(cherry picked from commit 34cc37910f)
2023-05-18 10:03:55 -07:00
Friedrich Vock
3a59a680c2 radv: Always call si_emit_cache_flush before writing timestamps
In case of barriers with TOP_OF_PIPE as dst stage, writing timestamps
immediately would be invalid.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22823>
(cherry picked from commit 284e604872)
2023-05-18 10:03:28 -07:00
Patrick Lerda
1f9a82bec5 r600: fix refcnt imbalance related to atomic_buffer_state
Indeed, these references are not freed.

For instance, this issue is triggered on an evergreen card with
"piglit/bin/shader_runner tests/spec/arb_shader_atomic_counter_ops/execution/all_touch_test.shader_test -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: 06993e4ee3 ("r600: add support for hw atomic counters. (v3)")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22798>
(cherry picked from commit 4ca8be82d5)
2023-05-18 10:03:03 -07:00
Emma Anholt
22adaf8684 vulkan: Actually increment the count of objects in GetPipelineCacheData.
Otherwise a load of the cache won't load any of the objects in it!

Fixes: 591da98779 ("vulkan: Add a common VkPipelineCache implementation")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22700>
(cherry picked from commit c93b179d76)
2023-05-18 10:03:02 -07:00
Emma Anholt
78b2fd157d vulkan: Handle alignment failure in the pipeline cache.
On malloc failure, or more likely a passed in pDataSize < pipeline cache
data size, we should return incomplete.  Otherwise,
vk_pipeline_cache_object_serialize will assertion fail about the start not
being aligned.

Closes: #8868
Fixes: 591da98779 ("vulkan: Add a common VkPipelineCache implementation")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22700>
(cherry picked from commit bc257928d7)
2023-05-18 10:03:02 -07:00
Patrick Lerda
885e2fef7c crocus: fix refcnt imbalance related to crocus_create_surface()
Indeed, the objects are not freed when the function returns NULL.

"psurf->texture = tex;" is redundant with
"pipe_resource_reference(&psurf->texture, tex);".

For instance, this issue is triggered with
"piglit/bin/ext_texture_array-compressed teximage pbo -fbo -auto"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: f3630548f1 ("crocus: initial gallium driver for Intel gfx 4-7")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22799>
(cherry picked from commit d615dfca40)
2023-05-18 10:03:02 -07:00
Mike Blumenkrantz
04270550a7 zink: only unset a generated tcs if the bound tcs is the generated one
this could otherwise unbind a non-generated tcs if the tes had at some
point generated a tcs

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22801>
(cherry picked from commit 27d6a98638)
2023-05-18 10:03:02 -07:00
Karol Herbst
15c6d3381c nvc0: do not randomly emit fences.
We track fences in a global list and have a per context "current" fence
which we randomly attach things to. If we take such a fence and emit it
without also creating a new fence for future tasks we can get out of sync
leading to random failures.

Some of our queries could trigger such cases and even though this issues
appears to be triggered by the MT rework, I'm convinced that this was only
made more visible by those fixes and we had this bug lurking for quite a
while.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7429
Fixes: df0a4d02f2 ("nvc0: make state handling race free")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Acked-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22722>
(cherry picked from commit 37c6c5c624)
2023-05-18 10:03:02 -07:00
Erik Faye-Lund
2fc6efddd1 nir: fix constant-folding of 64-bit fpow
We need to do full pow if 64-bit, and we can do fpow() otherwise. Not
the other way around.

Fixes: 9076c4e289 ("nir: update opcode definitions for different bit sizes")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22774>
(cherry picked from commit 955797d015)
2023-05-18 10:03:02 -07:00
Ruijing Dong
a6739ce185 radeonsi/vcn: correct cropping for hevc case
reason:

corect cropping calculation error.

If no cropping from the external, then it will
need to calculate cropping size internally, the
padding size on left and top should be zero.

Cc: mesa-stable
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7171
Reviewed-by: Thong Thai <thong.thai@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22758>
(cherry picked from commit b07f575a91)
2023-05-17 18:36:47 -07:00
Lone_Wolf
9eb964ca1b clc: Add clang frontendhlsl module to fix build of microsoft-clc with llvm 16+
Cc: mesa-stable

Reviewed-by: Jesse Natalie  <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22741>
(cherry picked from commit a1b46b5e66)
2023-05-17 18:36:46 -07:00
Lone_Wolf
6737012fbf clc: Add clangASTMatchers to fix static llvm build of microsoft-clc with LLVM 16+
Cc: mesa-stable

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22741>
(cherry picked from commit d09a7132d8)
2023-05-17 18:36:46 -07:00
Lone_Wolf
9743eeabc7 compiler/clc: Fix embedded clang headers (microsoft-clc) for LLVM 16+
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>

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

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22741>
(cherry picked from commit f53e5efad7)
2023-05-17 18:36:45 -07:00
Lionel Landwerlin
78a37a4b87 intel/fs: fix per vertex input clamping
Only apply the clamp in multi patch mode (where the input vertices
vary between [1, 32]).

The clamp NIR pass operates on lowered intrinsics so we need to call
it after the inputs have been lowered.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e25e17dd0c ("intel/fs: clamp per vertex input accesses to patchControlPoints")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8912
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22701>
(cherry picked from commit 7ddc31c672)
2023-05-17 18:36:44 -07:00
Mike Blumenkrantz
1eeccdefc9 draw: fix robust ubo size calc
if the size of the constant buffer + stride overflows UINT32_MAX,
DIV_ROUND_UP will return 0, which is, in some sense, extremely robust,
but for general functionality it's not actually very robust

cc: mesa-stable

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22720>
(cherry picked from commit 79b3828e82)
2023-05-17 18:36:44 -07:00
Thong Thai
feace931e4 tgsi: use locale independent float and double parsing
The atof and strtod functions use the locale of the user when
determining if a decimal is a comma, ',' or a period, '.'. Thanks to
@fzwoch for helping find the cause of a shader-related issue.

Cc: mesa-stable

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5760
Signed-off-by: Thong Thai <thong.thai@amd.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22699>
(cherry picked from commit 9c4e3c9020)
2023-05-17 18:36:43 -07:00
Thong Thai
966bd8fb0b util: check and initialize locale before using it
Cc: mesa-stable

Signed-off-by: Thong Thai <thong.thai@amd.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22699>
(cherry picked from commit 27eafdcbd5)
2023-05-17 18:36:43 -07:00
Thong Thai
26e3bf39f7 mesa/main: rework locale setup/teardown
Cc: mesa-stable

Signed-off-by: Thong Thai <thong.thai@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22699>
(cherry picked from commit 7373f25c09)
2023-05-17 18:36:42 -07:00
Dylan Baker
e09ee7f0a9 .pick_status.json: Updates notes for 9fb9ae5ac6 2023-05-17 18:36:35 -07:00
Rhys Perry
6ef747f1d1 aco: don't move exec writes around exec writes
Not sure if this is possible, but we should avoid it anyway.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22714>
(cherry picked from commit d0caa50dcd)
2023-05-17 18:35:51 -07:00
Jose Fonseca
1542ce3803 wgl: Fix unintentional assignment on assert.
Spotted by Nanley Chery.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4427
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22706>
(cherry picked from commit 9105e771af)
2023-05-17 18:35:51 -07:00
Axel Davy
920da004d5 frontend/nine: Fix num_textures count
util_last_bit already included the +1

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11865?commit_id=9205a45da50ebc6159169ba42b02d8475b09bfd7
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8894

cc: mesa-stable

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22645>
(cherry picked from commit ad1e64551d)
2023-05-17 13:08:07 -07:00
Rhys Perry
5875d9ad30 aco: don't move exec reads around exec writes
Fixes flickering and blocky plants in Jedi: Fallen Order.

Also fixes flickering squares in The Last of Us Part 1.

fossil-db (navi21):
Totals from 92 (0.07% of 135636) affected shaders:
Instrs: 35324 -> 35354 (+0.08%); split: -0.03%, +0.11%
CodeSize: 189568 -> 189668 (+0.05%); split: -0.03%, +0.08%
Latency: 345305 -> 346529 (+0.35%); split: -0.02%, +0.37%
InvThroughput: 78632 -> 78625 (-0.01%)
SClause: 1955 -> 1972 (+0.87%); split: -0.61%, +1.48%
Copies: 1311 -> 1304 (-0.53%); split: -0.69%, +0.15%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8883
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8878
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22696>
(cherry picked from commit 5e20fbd424)
2023-05-17 11:29:57 -07:00
Charmaine Lee
435c4f16cb svga: set PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY for VGPU10 device
Instead of forcing vertex buffer stride to be 4 byte aligned only,
DX10 actually allows the stride to be non 4-byte aligned but the
alignment of an element must be the nearest power of 2 greater or equal to the
width of the element's format, or 4, whichever is less.  So the requirement is
better met with PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY which if set to
TRUE, the sum of vertex element offset + vertex buffer offset + vertex buffer
stride must be aligned to the vertex attributes component size.
Note: PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY cannot be set
with other alignment-requiring CAPs, so we have to return 0 for all the
other alignement CAPs.

This avoids some unnecessary software vertex translate fallback.

cc: mesa-stable

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22689>
(cherry picked from commit c661f38342)
2023-05-17 11:29:55 -07:00
Patrick Lerda
6dd2a7ac02 aux/draw: fix memory leak related to ureg_get_tokens()
Indeed, the function nir_to_tgsi() returns an ureg_get_tokens() allocated
object which is assigned locally. The ureg_get_tokens() allocated object
should be freed.

For instance, this issue is triggered with a llvm enabled lima,
"piglit/bin/gl-1.0-rendermode-feedback -auto -fbo":
Direct leak of 512 byte(s) in 1 object(s) allocated from:
    #0 0x7faeaa4500 in __interceptor_realloc (/usr/lib64/libasan.so.6+0xa4500)
    #1 0x7fa4a88f1c in tokens_expand ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:239
    #2 0x7fa4a88f1c in get_tokens ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:262
    #3 0x7fa4a900f4 in copy_instructions ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2079
    #4 0x7fa4a900f4 in ureg_finalize ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2129
    #5 0x7fa4a91dfc in ureg_get_tokens ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2206
    #6 0x7fa4b20a2c in nir_to_tgsi_options ../src/gallium/auxiliary/nir/nir_to_tgsi.c:4011
    #7 0x7fa4a0c914 in draw_create_vertex_shader ../src/gallium/auxiliary/draw/draw_vs.c:77

Fixes: b5e782f5f4 ("aux/draw: use nir_to_tgsi for draw shader in llvm path")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21924>
(cherry picked from commit 6a8e6716ac)
2023-05-17 11:29:55 -07:00
M Henning
ba474aff62 nouveau/codegen: Check nir_dest_num_components
instead of reaching into a union and pulling out garbage when
the dest is a reg

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8863
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22674>
(cherry picked from commit d49c7b9582)
2023-05-17 11:29:46 -07:00