This commit is contained in:
Gabriel A 2024-07-27 21:04:56 -03:00 committed by Isaac Marovitz
parent 29cca80d9f
commit 1b9377023a
5 changed files with 9 additions and 10 deletions

View file

@ -428,15 +428,14 @@ namespace Ryujinx.Graphics.Gpu.Shader
TranslatorContext lastInVertexPipeline = geometryToCompute ? translatorContexts[4] ?? currentStage : currentStage; TranslatorContext lastInVertexPipeline = geometryToCompute ? translatorContexts[4] ?? currentStage : currentStage;
program = lastInVertexPipeline.GenerateVertexPassthroughForCompute(); (program, ShaderProgramInfo vacInfo) = lastInVertexPipeline.GenerateVertexPassthroughForCompute();
infoBuilder.AddStageInfoVac(vacInfo);
} }
else else
{ {
geometryAsCompute = CreateHostVertexAsComputeProgram(program, currentStage, tfEnabled); geometryAsCompute = CreateHostVertexAsComputeProgram(program, currentStage, tfEnabled);
program = null; program = null;
} }
infoBuilder.AddStageInfoVac(currentStage.GetVertexAsComputeInfo());
} }
if (program != null) if (program != null)

View file

@ -444,8 +444,8 @@ namespace Ryujinx.Graphics.Gpu.Shader
{ {
ShaderInfoBuilder builder = new(context, tfEnabled, vertexAsCompute: true, computeLocalSize: ComputeSize.VtgAsCompute); ShaderInfoBuilder builder = new(context, tfEnabled, vertexAsCompute: true, computeLocalSize: ComputeSize.VtgAsCompute);
builder.AddStageInfo(info, vertexAsCompute: true);
builder.AddStageInfoVac(info2); builder.AddStageInfoVac(info2);
builder.AddStageInfo(info, vertexAsCompute: true);
return builder.Build(null, fromCache); return builder.Build(null, fromCache);
} }

View file

@ -573,7 +573,7 @@ namespace Ryujinx.Graphics.Shader.Translation
return descriptors.ToArray(); return descriptors.ToArray();
} }
public ShaderProgramInfo GetVertexAsComputeInfo() public ShaderProgramInfo GetVertexAsComputeInfo(bool isVertex = false)
{ {
var cbDescriptors = new BufferDescriptor[_vacConstantBuffers.Count]; var cbDescriptors = new BufferDescriptor[_vacConstantBuffers.Count];
int cbDescriptorIndex = 0; int cbDescriptorIndex = 0;
@ -630,7 +630,7 @@ namespace Ryujinx.Graphics.Shader.Translation
sbDescriptors, sbDescriptors,
tDescriptors, tDescriptors,
iDescriptors, iDescriptors,
ShaderStage.Compute, isVertex ? ShaderStage.Vertex : ShaderStage.Compute,
0, 0,
0, 0,
0, 0,

View file

@ -491,7 +491,7 @@ namespace Ryujinx.Graphics.Shader.Translation
_vertexOutput = vertexContext._program.GetIoUsage(); _vertexOutput = vertexContext._program.GetIoUsage();
} }
public ShaderProgram GenerateVertexPassthroughForCompute() public (ShaderProgram, ShaderProgramInfo) GenerateVertexPassthroughForCompute()
{ {
var attributeUsage = new AttributeUsage(GpuAccessor); var attributeUsage = new AttributeUsage(GpuAccessor);
var resourceManager = new ResourceManager(ShaderStage.Vertex, GpuAccessor); var resourceManager = new ResourceManager(ShaderStage.Vertex, GpuAccessor);
@ -571,14 +571,14 @@ namespace Ryujinx.Graphics.Shader.Translation
LastInVertexPipeline = true LastInVertexPipeline = true
}; };
return Generate( return (Generate(
new[] { function }, new[] { function },
attributeUsage, attributeUsage,
definitions, definitions,
definitions, definitions,
resourceManager, resourceManager,
FeatureFlags.None, FeatureFlags.None,
0); 0), resourceManager.GetVertexAsComputeInfo(isVertex: true));
} }
public ShaderProgram GenerateGeometryPassthrough() public ShaderProgram GenerateGeometryPassthrough()

View file

@ -116,7 +116,7 @@ namespace Ryujinx.ShaderTools
if (options.VertexPassthrough) if (options.VertexPassthrough)
{ {
program = translatorContext.GenerateVertexPassthroughForCompute(); (program, _) = translatorContext.GenerateVertexPassthroughForCompute();
} }
else else
{ {