shader: Implement TXQ and fix FragDepth

This commit is contained in:
ReinUsesLisp 2021-03-26 18:45:38 -03:00 committed by ameerj
parent d9c5bd9509
commit 17063d16a3
15 changed files with 264 additions and 21 deletions

View file

@ -1493,6 +1493,12 @@ Value IREmitter::ImageFetch(const Value& handle, const Value& coords, const Valu
return Inst(op, Flags{info}, handle, coords, offset, lod, multisampling);
}
Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod) {
const Opcode op{handle.IsImmediate() ? Opcode::BoundImageQueryDimensions
: Opcode::BindlessImageQueryDimensions};
return Inst(op, handle, lod);
}
U1 IREmitter::VoteAll(const U1& value) {
return Inst<U1>(Opcode::VoteAll, value);
}

View file

@ -239,6 +239,7 @@ public:
const F32& dref, const F32& lod,
const Value& offset, const F32& lod_clamp,
TextureInstInfo info);
[[nodiscard]] Value ImageQueryDimension(const Value& handle, const IR::U32& lod);
[[nodiscard]] Value ImageGather(const Value& handle, const Value& coords, const Value& offset,
const Value& offset2, TextureInstInfo info);

View file

@ -356,6 +356,7 @@ OPCODE(BindlessImageSampleDrefExplicitLod, F32, U32,
OPCODE(BindlessImageGather, F32x4, U32, Opaque, Opaque, Opaque, )
OPCODE(BindlessImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, )
OPCODE(BindlessImageFetch, F32x4, U32, Opaque, U32, U32, )
OPCODE(BindlessImageQueryDimensions, U32x4, U32, U32, )
OPCODE(BoundImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
OPCODE(BoundImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
@ -364,6 +365,7 @@ OPCODE(BoundImageSampleDrefExplicitLod, F32, U32,
OPCODE(BoundImageGather, F32x4, U32, Opaque, Opaque, Opaque, )
OPCODE(BoundImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, )
OPCODE(BoundImageFetch, F32x4, U32, Opaque, U32, U32, )
OPCODE(BoundImageQueryDimensions, U32x4, U32, U32, )
OPCODE(ImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
OPCODE(ImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
@ -372,6 +374,7 @@ OPCODE(ImageSampleDrefExplicitLod, F32, U32,
OPCODE(ImageGather, F32x4, U32, Opaque, Opaque, Opaque, )
OPCODE(ImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, )
OPCODE(ImageFetch, F32x4, U32, Opaque, U32, U32, )
OPCODE(ImageQueryDimensions, U32x4, U32, U32, )
// Warp operations
OPCODE(VoteAll, U1, U1, )