Initial support for image stores, support texture sample on compute
This commit is contained in:
parent
717ace6f6e
commit
1b7d955195
44 changed files with 1053 additions and 497 deletions
|
@ -51,6 +51,19 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
|||
sources[index] = context.GetOperandUse(operation.GetSource(index));
|
||||
}
|
||||
|
||||
int componentMask = 1 << operation.ComponentIndex;
|
||||
|
||||
AstTextureOperation GetAstTextureOperation(TextureOperation texOp)
|
||||
{
|
||||
return new AstTextureOperation(
|
||||
inst,
|
||||
texOp.Type,
|
||||
texOp.Flags,
|
||||
texOp.Handle,
|
||||
componentMask,
|
||||
sources);
|
||||
}
|
||||
|
||||
if (operation.Dest != null)
|
||||
{
|
||||
AstOperand dest = context.GetOperandDef(operation.Dest);
|
||||
|
@ -108,21 +121,20 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
|||
dest.VarType = InstructionInfo.GetDestVarType(inst);
|
||||
}
|
||||
|
||||
int componentMask = 1 << operation.ComponentIndex;
|
||||
|
||||
IAstNode source;
|
||||
|
||||
if (operation is TextureOperation texOp)
|
||||
{
|
||||
AstTextureOperation astTexOp = new AstTextureOperation(
|
||||
inst,
|
||||
texOp.Target,
|
||||
texOp.Flags,
|
||||
texOp.Handle,
|
||||
componentMask,
|
||||
sources);
|
||||
AstTextureOperation astTexOp = GetAstTextureOperation(texOp);
|
||||
|
||||
context.Info.Samplers.Add(astTexOp);
|
||||
if (texOp.Inst == Instruction.ImageLoad)
|
||||
{
|
||||
context.Info.Images.Add(astTexOp);
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Info.Samplers.Add(astTexOp);
|
||||
}
|
||||
|
||||
source = astTexOp;
|
||||
}
|
||||
|
@ -143,6 +155,14 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
|||
{
|
||||
context.AddNode(new AstComment(((CommentNode)operation).Comment));
|
||||
}
|
||||
else if (operation is TextureOperation texOp)
|
||||
{
|
||||
AstTextureOperation astTexOp = GetAstTextureOperation(texOp);
|
||||
|
||||
context.Info.Images.Add(astTexOp);
|
||||
|
||||
context.AddNode(astTexOp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (inst == Instruction.StoreStorage)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue