See merge request ryubing/ryujinx!214
This commit is contained in:
GreemDev
2025-11-11 12:55:36 -06:00
parent 49c70efdd5
commit 6b814fb973
171 changed files with 6011 additions and 6335 deletions

View File

@@ -135,7 +135,7 @@ namespace Ryujinx.Graphics.Shader.Translation
}
else if (TranslatorContext.Stage == ShaderStage.Geometry)
{
int inputVertices = TranslatorContext.Definitions.InputTopology.ToInputVertices();
int inputVertices = TranslatorContext.Definitions.InputTopology.InputVertexCount;
Operand baseVertex = this.IMultiply(outputVertexOffset, Const(inputVertices));
@@ -404,7 +404,7 @@ namespace Ryujinx.Graphics.Shader.Translation
else
{
inputStart = 0;
inputEnd = topology.ToInputVerticesNoAdjacency();
inputEnd = topology.InputVertexCountNoAdjacency;
inputStep = 1;
}

View File

@@ -39,8 +39,8 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
// Set any destination variables to zero.
string typeName = texOp.Inst.IsImage()
? texOp.Type.ToGlslImageType(texOp.Format.GetComponentType())
: texOp.Type.ToGlslTextureType();
? texOp.Type.GetGlslImageTypeName(texOp.Format.GetComponentType())
: texOp.Type.GlslTextureTypeName;
gpuAccessor.Log($"Failed to find handle source for bindless access of type \"{typeName}\".");

View File

@@ -133,7 +133,7 @@ namespace Ryujinx.Graphics.Shader.Translation
}
else if (stage == ShaderStage.Geometry)
{
LocalTopologyRemapMemoryId = AddMemoryDefinition("local_topology_remap", AggregateType.Array | AggregateType.U32, inputTopology.ToInputVertices());
LocalTopologyRemapMemoryId = AddMemoryDefinition("local_topology_remap", AggregateType.Array | AggregateType.U32, inputTopology.InputVertexCount);
LocalGeometryOutputVertexCountMemoryId = AddMemoryDefinition("local_geometry_output_vertex", AggregateType.U32);
LocalGeometryOutputIndexCountMemoryId = AddMemoryDefinition("local_geometry_output_index", AggregateType.U32);
@@ -273,7 +273,7 @@ namespace Ryujinx.Graphics.Shader.Translation
bool coherent,
bool separate)
{
int dimensions = type == SamplerType.None ? 0 : type.GetDimensions();
int dimensions = type == SamplerType.None ? 0 : type.Dimensions;
Dictionary<TextureInfo, TextureMeta> dict = isImage ? _usedImages : _usedTextures;
TextureUsageFlags usageFlags = TextureUsageFlags.None;
@@ -282,7 +282,7 @@ namespace Ryujinx.Graphics.Shader.Translation
{
usageFlags |= TextureUsageFlags.NeedsScaleValue;
bool canScale = _stage.SupportsRenderScale() && arrayLength == 1 && !write && dimensions == 2;
bool canScale = _stage.SupportsRenderScale && arrayLength == 1 && !write && dimensions == 2;
if (!canScale)
{
@@ -355,7 +355,7 @@ namespace Ryujinx.Graphics.Shader.Translation
if (arrayLength != 1 && type != SamplerType.None)
{
prefix += type.ToShortSamplerType();
prefix += type.ShortTypeName;
}
if (isImage)
@@ -432,9 +432,9 @@ namespace Ryujinx.Graphics.Shader.Translation
if (found)
{
selectedMeta.UsageFlags |= TextureUsageFlags.NeedsScaleValue;
int dimensions = type.GetDimensions();
bool canScale = _stage.SupportsRenderScale() && selectedInfo.ArrayLength == 1 && dimensions == 2;
int dimensions = type.Dimensions;
bool canScale = _stage.SupportsRenderScale && selectedInfo.ArrayLength == 1 && dimensions == 2;
if (!canScale)
{

View File

@@ -157,7 +157,7 @@ namespace Ryujinx.Graphics.Shader.Translation
GpPassthrough = gpPassthrough;
ThreadsPerInputPrimitive = threadsPerInputPrimitive;
OutputTopology = outputTopology;
MaxOutputVertices = gpPassthrough ? graphicsState.Topology.ToInputVerticesNoAdjacency() : maxOutputVertices;
MaxOutputVertices = gpPassthrough ? graphicsState.Topology.InputVertexCountNoAdjacency : maxOutputVertices;
ImapTypes = imapTypes;
OmapTargets = omapTargets;
OmapSampleMask = omapSampleMask;
@@ -293,7 +293,7 @@ namespace Ryujinx.Graphics.Shader.Translation
public AggregateType GetFragmentOutputColorType(int location)
{
return AggregateType.Vector4 | _graphicsState.FragmentOutputTypes[location].ToAggregateType();
return AggregateType.Vector4 | _graphicsState.FragmentOutputTypes[location].Aggregate;
}
public AggregateType GetUserDefinedType(int location, bool isOutput)
@@ -307,7 +307,7 @@ namespace Ryujinx.Graphics.Shader.Translation
if (Stage == ShaderStage.Vertex && !isOutput)
{
type |= _graphicsState.AttributeTypes[location].ToAggregateType(SupportsScaledVertexFormats);
type |= _graphicsState.AttributeTypes[location].AsAggregate(SupportsScaledVertexFormats);
}
else
{

View File

@@ -53,7 +53,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Transforms
(intCoords || isImage) &&
!isBindless &&
!isIndexed &&
stage.SupportsRenderScale() &&
stage.SupportsRenderScale &&
TypeSupportsScale(texOp.Type))
{
int functionId = hfm.GetOrCreateFunctionId(HelperFunctionName.TexelFetchScale);
@@ -61,7 +61,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Transforms
? resourceManager.GetTextureDescriptors(includeArrays: false).Length + resourceManager.FindImageDescriptorIndex(texOp.Binding)
: resourceManager.FindTextureDescriptorIndex(texOp.Binding);
int coordsCount = texOp.Type.GetDimensions();
int coordsCount = texOp.Type.Dimensions;
int coordsIndex = isBindless ? 1 : 0;
for (int index = 0; index < coordsCount; index++)
@@ -103,7 +103,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Transforms
texOp.Index < 2 &&
!isBindless &&
!isIndexed &&
stage.SupportsRenderScale() &&
stage.SupportsRenderScale &&
TypeSupportsScale(texOp.Type))
{
int functionId = hfm.GetOrCreateFunctionId(HelperFunctionName.TextureSizeUnscale);
@@ -168,7 +168,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Transforms
return node;
}
int coordsCount = texOp.Type.GetDimensions();
int coordsCount = texOp.Type.Dimensions;
int normCoordsCount = (texOp.Type & SamplerType.Mask) == SamplerType.TextureCube ? 2 : coordsCount;
@@ -226,7 +226,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Transforms
bool isIndexed = resourceManager.IsArrayOfTexturesOrImages(texOp.Binding, isImage: false);
int coordsCount = texOp.Type.GetDimensions();
int coordsCount = texOp.Type.Dimensions;
int coordsIndex = isBindless || isIndexed ? 1 : 0;
int normCoordsCount = (texOp.Type & SamplerType.Mask) == SamplerType.TextureCube ? 2 : coordsCount;
@@ -315,7 +315,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Transforms
bool isMultisample = (texOp.Type & SamplerType.Multisample) != 0;
bool isShadow = (texOp.Type & SamplerType.Shadow) != 0;
int coordsCount = texOp.Type.GetDimensions();
int coordsCount = texOp.Type.Dimensions;
int offsetsCount;