Move gl_Layer from vertex to geometry if GPU does not support it on vertex (#3866)
* Move gl_Layer from vertex to geometry if GPU does not support it on vertex * Shader cache version bump * PR feedback
This commit is contained in:
parent
7373ec5792
commit
2e43d01d36
13 changed files with 190 additions and 17 deletions
|
@ -356,6 +356,8 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
|||
CachedShaderStage[] shaders = new CachedShaderStage[Constants.ShaderStages + 1];
|
||||
List<ShaderSource> shaderSources = new List<ShaderSource>();
|
||||
|
||||
TranslatorContext previousStage = null;
|
||||
|
||||
for (int stageIndex = 0; stageIndex < Constants.ShaderStages; stageIndex++)
|
||||
{
|
||||
TranslatorContext currentStage = translatorContexts[stageIndex + 1];
|
||||
|
@ -392,6 +394,16 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
|||
{
|
||||
shaderSources.Add(CreateShaderSource(program));
|
||||
}
|
||||
|
||||
previousStage = currentStage;
|
||||
}
|
||||
else if (
|
||||
previousStage != null &&
|
||||
previousStage.LayerOutputWritten &&
|
||||
stageIndex == 3 &&
|
||||
!_context.Capabilities.SupportsLayerVertexTessellation)
|
||||
{
|
||||
shaderSources.Add(CreateShaderSource(previousStage.GenerateGeometryPassthrough()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue