Compute LDS beyond the device's shared-memory limit lives in a storage
buffer, and its 64-bit atomics took a lock in that buffer. AMD's Windows
driver compiles the lock's acquire and release to s_barrier, which inside
the divergent lock loop pairs with the program's own barriers, so the
device-memory case of agc_driver_lds_lock_budget read half its sum.
With shaderBufferInt64Atomics the device-memory LDS now uses a 64-bit view
of the buffer instead: 64-bit atomics are compare-exchange loops on it and
32-bit atomics stay native, so no lock is taken. Without the feature the
lock is kept. The per-workgroup slice is rounded up to an even dword count
so that the 64-bit view stays aligned.
scePthreadJoin checked whether the thread was detached before whether it
was the calling thread. So a detached thread joining itself got EINVAL
instead of EDEADLK, and so did the main thread, which scePthreadSelf
adopts as detached. FreeBSD's join checks the calling thread right after
the null check and before it looks at the detach state. The self check
now comes first; the null, detached and already-joined answers are
unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Homebrew built with the ps5-payload-dev SDK imports by symbol name and
names its system libraries with .sprx, while the libraries in libs/
are .prx files that export NIDs. Quake from the websrv launcher
stopped with 457 unresolved imports such as strlen and malloc.
An import without a module that no searched library exports under its
name is now looked up again under the NID of that name. A dependency
named with .sprx, .suprx or .debug_prx loads the .prx library of the
same stem, and libkernel_web also loads libkernel.prx, as
libSceLibcInternal already loads libc.prx.
sigprocmask and _sigprocmask threw std::invalid_argument for a how other
than SIG_BLOCK, SIG_UNBLOCK or SIG_SETMASK, which ends the title. FreeBSD
returns -1 with EINVAL and leaves the old mask uncopied, and ignores how
when set is null; pthread_sigmask here already returns EINVAL. The check
now comes first, before the previous mask is written.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The two anisotropic rows of agc_driver_image_sample_reduction sampled
a two-level texture at explicit LOD 0.25 and 0.75 through a point mip
filter, and expected only the nearest level in the min or max. Vulkan
leaves the anisotropic filtering scheme to the implementation, and
only recommends that it consider mipmapMode, minLod and maxLod. On an
RTX 4090 (NVIDIA 616.92) the min row returns 5, a level-1 texel, where
level 0's bilinear minimum is 17, so the test fails on main there.
The rows now use no mip filter, which the decoder turns into a host
sampler with minLod and maxLod 0, so they read level 0 only, as the
RDNA2 measurements without derivatives did (gfx1030 with no mip filter
over a single-level texture, gfx1035 with image_sample_lz). They still
throw if the min or max reduction with anisotropy is refused again.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
DecodeSrgbTexel looked up the 256 table constants and stored the whole
table into its Private array at every decode site. The constants are
interned, but once a module has more than the declaration cache's 512
entries, each of those lookups that misses walks every slot before it
reaches the map. The table is now built on first use as the Private
array's initializer, as the buffer format table already is, and later
sites only index it.
The sRGB image load test checks that the recompiled module holds one
table, initializes one variable with it and never stores it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The depth remap mode, scale and offset change the pipeline a draw creates, so the
pipeline journal's recipe carries them. The file format is bumped and the State
layout guard follows the new size.
Since #4048 enabled robustBufferAccess2, AMD's Windows driver draws
nothing in agc_driver_layered_volume_draw and agc_driver_layered_volume_vertex,
and the selected loads make the high half of agc_driver_subvector_loop's
wave64 skip its loop. Until the cause is found, that driver does not get
the feature, and its loads keep their selections.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ApplyDepthRemap gives the Vulkan viewport the console's clamp bounds
clipped to [0, 1]. A zero-to-one viewport maps the shader's z/w linearly
onto [minDepth, maxDepth], so with bounds narrower than [0, 1] the remap
rescaled the depth into them instead of clamping it there; only bounds
of [0, 1] or wider (Minecraft's [-1, 1]) came out right. Scale and offset
are now divided by the clamp range and the offset moved by its minimum,
so the viewport and the depth clamp together give scale * z/w + offset
clamped to the bounds.
agc_driver_depth_range_remap_draw draws through the remap path and,
when the device has VK_EXT_depth_range_unrestricted, through the
unrestricted path, then checks the stored depth with probe draws and
that the two clip distances cut at the near and far planes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only the remap mode changes what the vertex shader compiles to. Scale and
offset are specialization constants that each materialization takes from
its own request, so they no longer split the compiled variant per depth
transform. The result memo hashes them with the snapshot instead, so one
prepared vertex shader does not hand the module specialized for one
transform to a draw with another. sameVertexInfo repeated its first
comparison without paClVsOutCntl; the repeat is dropped.
A test pins the version 27 layout (the remap fields are the last bytes
of a vertex request), a version 25 replay, truncation and trailing-data
refusal, and that scale and offset leave the cache key alone while the
mode does not. agc_depth_range_remap materializes one prepared vertex
shader with two transforms and checks that each gets its own module.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Without VK_EXT_depth_range_unrestricted a viewport depth range outside
[0, 1] threw. Minecraft (PPSA17221) draws its world with scale 1 and
offset 0 in negative-one-to-one clip space, so its depth is the raw z/w
clamped by PA_SC_VPORT_ZMIN/ZMAX. On such a device the vertex shader now
scales clip z so z/w is the console's depth, the pipeline clamps depth at
the console's bounds, and two clip distances restore the near and far
planes that depth clamping removes. Mode, scale and offset travel as
pipeline specialization constants from the draw's vertex stage info, in
both the per-draw and the registration-module path; mesh and tessellation
draws with such a range still throw.
The console's depth clamp bounds are clipped to [0, 1]: exact for a
normalized depth target or none, and reported once for a tested or
written float depth target, where a depth below 0 is stored as 0
(Minecraft clamps its float depth target to [-1, 1]). The shader
validator accepts the remap's two extra clip distances next to the one
a program may already export.
Co-Authored-By: Claude Fable 5.1 <[email protected]>