shader: Implement fine derivates constant propagation

This commit is contained in:
FernandoS27 2021-04-17 11:56:45 +02:00 committed by ameerj
parent f18a6dd1bd
commit 04c459fc8d
9 changed files with 101 additions and 0 deletions

View file

@ -1925,4 +1925,12 @@ F32 IREmitter::FSwizzleAdd(const F32& a, const F32& b, const U32& swizzle, FpCon
return Inst<F32>(Opcode::FSwizzleAdd, Flags{control}, a, b, swizzle);
}
F32 IREmitter::DPdxFine(const F32& a) {
return Inst<F32>(Opcode::DPdxFine, a);
}
F32 IREmitter::DPdyFine(const F32& a) {
return Inst<F32>(Opcode::DPdyFine, a);
}
} // namespace Shader::IR

View file

@ -353,6 +353,10 @@ public:
[[nodiscard]] F32 FSwizzleAdd(const F32& a, const F32& b, const U32& swizzle,
FpControl control = {});
[[nodiscard]] F32 DPdxFine(const F32& a);
[[nodiscard]] F32 DPdyFine(const F32& a);
private:
IR::Block::iterator insertion_point;

View file

@ -511,3 +511,5 @@ OPCODE(ShuffleUp, U32, U32,
OPCODE(ShuffleDown, U32, U32, U32, U32, U32, )
OPCODE(ShuffleButterfly, U32, U32, U32, U32, U32, )
OPCODE(FSwizzleAdd, F32, F32, F32, U32, )
OPCODE(DPdxFine, F32, F32, )
OPCODE(DPdyFine, F32, F32, )