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
				
			
		|  | @ -278,13 +278,21 @@ namespace Ryujinx.Graphics.Shader.Instructions | |||
| 
 | ||||
|         private static int FixedFuncToUserAttribute(ShaderConfig config, int attr, bool isOutput) | ||||
|         { | ||||
|             if (attr >= AttributeConsts.FrontColorDiffuseR && attr < AttributeConsts.ClipDistance0) | ||||
|             bool supportsLayerFromVertexOrTess = config.GpuAccessor.QueryHostSupportsLayerVertexTessellation(); | ||||
|             int fixedStartAttr = supportsLayerFromVertexOrTess ? 0 : 1; | ||||
| 
 | ||||
|             if (attr == AttributeConsts.Layer && config.Stage != ShaderStage.Geometry && !supportsLayerFromVertexOrTess) | ||||
|             { | ||||
|                 attr = FixedFuncToUserAttribute(config, attr, AttributeConsts.FrontColorDiffuseR, 0, isOutput); | ||||
|                 attr = FixedFuncToUserAttribute(config, attr, AttributeConsts.Layer, 0, isOutput); | ||||
|                 config.SetLayerOutputAttribute(attr); | ||||
|             } | ||||
|             else if (attr >= AttributeConsts.FrontColorDiffuseR && attr < AttributeConsts.ClipDistance0) | ||||
|             { | ||||
|                 attr = FixedFuncToUserAttribute(config, attr, AttributeConsts.FrontColorDiffuseR, fixedStartAttr, isOutput); | ||||
|             } | ||||
|             else if (attr >= AttributeConsts.TexCoordBase && attr < AttributeConsts.TexCoordEnd) | ||||
|             { | ||||
|                 attr = FixedFuncToUserAttribute(config, attr, AttributeConsts.TexCoordBase, 4, isOutput); | ||||
|                 attr = FixedFuncToUserAttribute(config, attr, AttributeConsts.TexCoordBase, fixedStartAttr + 4, isOutput); | ||||
|             } | ||||
| 
 | ||||
|             return attr; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 gdkchan
						gdkchan