language feature: Extension Members: Graphics related, enums

This commit is contained in:
GreemDev
2025-07-02 02:04:47 -05:00
parent e23213d290
commit ac98ade572
24 changed files with 250 additions and 248 deletions

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

@@ -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

@@ -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;