mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-01 12:56:25 +02:00
Implement Load/Store Local/Shared and Atomic shared using new instructions (#5241)
* Implement Load/Store Local/Shared and Atomic shared using new instructions * Remove now unused code * Fix base offset register overwrite * Fix missing storage buffer set index when generating GLSL for Vulkan * Shader cache version bump * Remove more unused code * Some PR feedback
This commit is contained in:
parent
32d21ddf17
commit
f92921a6d1
30 changed files with 475 additions and 567 deletions
|
@ -124,7 +124,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
private TextureDescriptor[] _cachedTextureDescriptors;
|
||||
private TextureDescriptor[] _cachedImageDescriptors;
|
||||
|
||||
public ShaderConfig(ShaderStage stage, IGpuAccessor gpuAccessor, TranslationOptions options)
|
||||
public ShaderConfig(ShaderStage stage, IGpuAccessor gpuAccessor, TranslationOptions options, int localMemorySize)
|
||||
{
|
||||
Stage = stage;
|
||||
GpuAccessor = gpuAccessor;
|
||||
|
@ -143,7 +143,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
_usedTextures = new Dictionary<TextureInfo, TextureMeta>();
|
||||
_usedImages = new Dictionary<TextureInfo, TextureMeta>();
|
||||
|
||||
ResourceManager = new ResourceManager(stage, gpuAccessor, new ShaderProperties());
|
||||
ResourceManager = new ResourceManager(stage, gpuAccessor, new ShaderProperties(), localMemorySize);
|
||||
|
||||
if (!gpuAccessor.QueryHostSupportsTransformFeedback() && gpuAccessor.QueryTransformFeedbackEnabled())
|
||||
{
|
||||
|
@ -176,14 +176,17 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
OutputTopology outputTopology,
|
||||
int maxOutputVertices,
|
||||
IGpuAccessor gpuAccessor,
|
||||
TranslationOptions options) : this(stage, gpuAccessor, options)
|
||||
TranslationOptions options) : this(stage, gpuAccessor, options, 0)
|
||||
{
|
||||
ThreadsPerInputPrimitive = 1;
|
||||
OutputTopology = outputTopology;
|
||||
MaxOutputVertices = maxOutputVertices;
|
||||
}
|
||||
|
||||
public ShaderConfig(ShaderHeader header, IGpuAccessor gpuAccessor, TranslationOptions options) : this(header.Stage, gpuAccessor, options)
|
||||
public ShaderConfig(
|
||||
ShaderHeader header,
|
||||
IGpuAccessor gpuAccessor,
|
||||
TranslationOptions options) : this(header.Stage, gpuAccessor, options, GetLocalMemorySize(header))
|
||||
{
|
||||
GpPassthrough = header.Stage == ShaderStage.Geometry && header.GpPassthrough;
|
||||
ThreadsPerInputPrimitive = header.ThreadsPerInputPrimitive;
|
||||
|
@ -197,6 +200,11 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
LastInVertexPipeline = header.Stage < ShaderStage.Fragment;
|
||||
}
|
||||
|
||||
private static int GetLocalMemorySize(ShaderHeader header)
|
||||
{
|
||||
return header.ShaderLocalMemoryLowSize + header.ShaderLocalMemoryHighSize + (header.ShaderLocalMemoryCrsSize / ThreadsPerWarp);
|
||||
}
|
||||
|
||||
private void EnsureTransformFeedbackInitialized()
|
||||
{
|
||||
if (HasTransformFeedbackOutputs() && _transformFeedbackOutputs == null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue