mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-28 03:23:05 +00:00
Partial TextureQuerySamples
This commit is contained in:
parent
ce5f383f5d
commit
81b1ae4bcf
2 changed files with 20 additions and 1 deletions
|
@ -138,7 +138,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
||||||
case Instruction.TextureSample:
|
case Instruction.TextureSample:
|
||||||
return TextureSample(context, operation);
|
return TextureSample(context, operation);
|
||||||
case Instruction.TextureQuerySamples:
|
case Instruction.TextureQuerySamples:
|
||||||
return "|| TEXTURE QUERY SIZE ||";
|
return TextureQuerySamples(context, operation);
|
||||||
case Instruction.TextureQuerySize:
|
case Instruction.TextureQuerySize:
|
||||||
return TextureQuerySize(context, operation);
|
return TextureQuerySize(context, operation);
|
||||||
case Instruction.VectorExtract:
|
case Instruction.VectorExtract:
|
||||||
|
|
|
@ -269,6 +269,25 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
||||||
return swizzle;
|
return swizzle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string TextureQuerySamples(CodeGenContext context, AstOperation operation)
|
||||||
|
{
|
||||||
|
AstTextureOperation texOp = (AstTextureOperation)operation;
|
||||||
|
|
||||||
|
bool isBindless = (texOp.Flags & TextureFlags.Bindless) != 0;
|
||||||
|
|
||||||
|
// TODO: Bindless texture support. For now we just return 0.
|
||||||
|
if (isBindless)
|
||||||
|
{
|
||||||
|
return NumberFormatter.FormatInt(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
string textureName = "texture";
|
||||||
|
string texCall = textureName + ".";
|
||||||
|
texCall += $"get_num_samples()";
|
||||||
|
|
||||||
|
return texCall;
|
||||||
|
}
|
||||||
|
|
||||||
public static string TextureQuerySize(CodeGenContext context, AstOperation operation)
|
public static string TextureQuerySize(CodeGenContext context, AstOperation operation)
|
||||||
{
|
{
|
||||||
AstTextureOperation texOp = (AstTextureOperation)operation;
|
AstTextureOperation texOp = (AstTextureOperation)operation;
|
||||||
|
|
Loading…
Reference in a new issue