Ensure shader local and shared memory sizes are not zero (#5321)
This commit is contained in:
parent
f92921a6d1
commit
f9a538bb0f
6 changed files with 88 additions and 18 deletions
|
@ -149,6 +149,17 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
|
||||
public ShaderProgram Translate(TranslatorContext other = null)
|
||||
{
|
||||
bool usesLocalMemory = _config.UsedFeatures.HasFlag(FeatureFlags.LocalMemory);
|
||||
|
||||
_config.ResourceManager.SetCurrentLocalMemory(_config.LocalMemorySize, usesLocalMemory);
|
||||
|
||||
if (_config.Stage == ShaderStage.Compute)
|
||||
{
|
||||
bool usesSharedMemory = _config.UsedFeatures.HasFlag(FeatureFlags.SharedMemory);
|
||||
|
||||
_config.ResourceManager.SetCurrentSharedMemory(GpuAccessor.QueryComputeSharedMemorySize(), usesSharedMemory);
|
||||
}
|
||||
|
||||
FunctionCode[] code = EmitShader(_program, _config, initializeOutputs: other == null, out _);
|
||||
|
||||
if (other != null)
|
||||
|
@ -157,6 +168,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
|
||||
// We need to share the resource manager since both shaders accesses the same constant buffers.
|
||||
other._config.ResourceManager = _config.ResourceManager;
|
||||
other._config.ResourceManager.SetCurrentLocalMemory(other._config.LocalMemorySize, other._config.UsedFeatures.HasFlag(FeatureFlags.LocalMemory));
|
||||
|
||||
FunctionCode[] otherCode = EmitShader(other._program, other._config, initializeOutputs: true, out int aStart);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue