shader: Implement SampleMask
This commit is contained in:
parent
95815a3883
commit
80940b1706
11 changed files with 22 additions and 2 deletions
|
@ -343,6 +343,10 @@ void IREmitter::SetFragColor(u32 index, u32 component, const F32& value) {
|
|||
Inst(Opcode::SetFragColor, Imm32(index), Imm32(component), value);
|
||||
}
|
||||
|
||||
void IREmitter::SetSampleMask(const U32& value) {
|
||||
Inst(Opcode::SetSampleMask, value);
|
||||
}
|
||||
|
||||
void IREmitter::SetFragDepth(const F32& value) {
|
||||
Inst(Opcode::SetFragDepth, value);
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@ public:
|
|||
void SetPatch(Patch patch, const F32& value);
|
||||
|
||||
void SetFragColor(u32 index, u32 component, const F32& value);
|
||||
void SetSampleMask(const U32& value);
|
||||
void SetFragDepth(const F32& value);
|
||||
|
||||
[[nodiscard]] U32 WorkgroupIdX();
|
||||
|
|
|
@ -75,6 +75,7 @@ bool Inst::MayHaveSideEffects() const noexcept {
|
|||
case Opcode::SetAttributeIndexed:
|
||||
case Opcode::SetPatch:
|
||||
case Opcode::SetFragColor:
|
||||
case Opcode::SetSampleMask:
|
||||
case Opcode::SetFragDepth:
|
||||
case Opcode::WriteGlobalU8:
|
||||
case Opcode::WriteGlobalS8:
|
||||
|
|
|
@ -51,6 +51,7 @@ OPCODE(SetAttributeIndexed, Void, U32,
|
|||
OPCODE(GetPatch, F32, Patch, )
|
||||
OPCODE(SetPatch, Void, Patch, F32, )
|
||||
OPCODE(SetFragColor, Void, U32, U32, F32, )
|
||||
OPCODE(SetSampleMask, Void, U32, )
|
||||
OPCODE(SetFragDepth, Void, F32, )
|
||||
OPCODE(GetZFlag, U1, Void, )
|
||||
OPCODE(GetSFlag, U1, Void, )
|
||||
|
|
|
@ -22,7 +22,7 @@ void ExitFragment(TranslatorVisitor& v) {
|
|||
}
|
||||
}
|
||||
if (sph.ps.omap.sample_mask != 0) {
|
||||
throw NotImplementedException("Sample mask");
|
||||
v.ir.SetSampleMask(v.X(src_reg));
|
||||
}
|
||||
if (sph.ps.omap.depth != 0) {
|
||||
v.ir.SetFragDepth(v.F(src_reg + 1));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue