mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-23 14:54:00 +00:00
Ensure a valid shared memory size is used
This commit is contained in:
parent
66d91cbc6c
commit
ad3bc2531b
@ -20,9 +20,12 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
|||||||
|
|
||||||
ulong shaderGpuVa = shaderBaseAddress.Pack() + (uint)dispatchParams.ShaderOffset;
|
ulong shaderGpuVa = shaderBaseAddress.Pack() + (uint)dispatchParams.ShaderOffset;
|
||||||
|
|
||||||
|
// Note: A size of 0 is also invalid, the size must be at least 1.
|
||||||
|
int sharedMemorySize = Math.Clamp(dispatchParams.SharedMemorySize & 0xffff, 1, _context.Capabilities.MaximumComputeSharedMemorySize);
|
||||||
|
|
||||||
ComputeShader cs = _shaderCache.GetComputeShader(
|
ComputeShader cs = _shaderCache.GetComputeShader(
|
||||||
shaderGpuVa,
|
shaderGpuVa,
|
||||||
dispatchParams.SharedMemorySize & 0xffff,
|
sharedMemorySize,
|
||||||
dispatchParams.UnpackBlockSizeX(),
|
dispatchParams.UnpackBlockSizeX(),
|
||||||
dispatchParams.UnpackBlockSizeY(),
|
dispatchParams.UnpackBlockSizeY(),
|
||||||
dispatchParams.UnpackBlockSizeZ());
|
dispatchParams.UnpackBlockSizeZ());
|
||||||
|
Loading…
Reference in New Issue
Block a user