shader: Implement ImageGradient
This commit is contained in:
parent
be3e94ae55
commit
d5bfc63088
8 changed files with 84 additions and 2 deletions
|
@ -370,12 +370,20 @@ void VisitUsages(Info& info, IR::Inst& inst) {
|
|||
case IR::Opcode::BindlessImageSampleDrefExplicitLod:
|
||||
case IR::Opcode::BindlessImageGather:
|
||||
case IR::Opcode::BindlessImageGatherDref:
|
||||
case IR::Opcode::BindlessImageFetch:
|
||||
case IR::Opcode::BindlessImageQueryDimensions:
|
||||
case IR::Opcode::BindlessImageQueryLod:
|
||||
case IR::Opcode::BindlessImageGradient:
|
||||
case IR::Opcode::BoundImageSampleImplicitLod:
|
||||
case IR::Opcode::BoundImageSampleExplicitLod:
|
||||
case IR::Opcode::BoundImageSampleDrefImplicitLod:
|
||||
case IR::Opcode::BoundImageSampleDrefExplicitLod:
|
||||
case IR::Opcode::BoundImageGather:
|
||||
case IR::Opcode::BoundImageGatherDref:
|
||||
case IR::Opcode::BoundImageFetch:
|
||||
case IR::Opcode::BoundImageQueryDimensions:
|
||||
case IR::Opcode::BoundImageQueryLod:
|
||||
case IR::Opcode::BoundImageGradient:
|
||||
case IR::Opcode::ImageSampleImplicitLod:
|
||||
case IR::Opcode::ImageSampleExplicitLod:
|
||||
case IR::Opcode::ImageSampleDrefImplicitLod:
|
||||
|
@ -384,7 +392,8 @@ void VisitUsages(Info& info, IR::Inst& inst) {
|
|||
case IR::Opcode::ImageGatherDref:
|
||||
case IR::Opcode::ImageFetch:
|
||||
case IR::Opcode::ImageQueryDimensions:
|
||||
case IR::Opcode::ImageQueryLod: {
|
||||
case IR::Opcode::ImageQueryLod:
|
||||
case IR::Opcode::ImageGradient: {
|
||||
const TextureType type{inst.Flags<IR::TextureInstInfo>().type};
|
||||
info.uses_sampled_1d |= type == TextureType::Color1D || type == TextureType::ColorArray1D ||
|
||||
type == TextureType::Shadow1D || type == TextureType::ShadowArray1D;
|
||||
|
|
|
@ -60,6 +60,9 @@ IR::Opcode IndexedInstruction(const IR::Inst& inst) {
|
|||
case IR::Opcode::BoundImageQueryLod:
|
||||
case IR::Opcode::BindlessImageQueryLod:
|
||||
return IR::Opcode::ImageQueryLod;
|
||||
case IR::Opcode::BoundImageGradient:
|
||||
case IR::Opcode::BindlessImageGradient:
|
||||
return IR::Opcode::ImageGradient;
|
||||
default:
|
||||
return IR::Opcode::Void;
|
||||
}
|
||||
|
@ -76,6 +79,7 @@ bool IsBindless(const IR::Inst& inst) {
|
|||
case IR::Opcode::BindlessImageFetch:
|
||||
case IR::Opcode::BindlessImageQueryDimensions:
|
||||
case IR::Opcode::BindlessImageQueryLod:
|
||||
case IR::Opcode::BindlessImageGradient:
|
||||
return true;
|
||||
case IR::Opcode::BoundImageSampleImplicitLod:
|
||||
case IR::Opcode::BoundImageSampleExplicitLod:
|
||||
|
@ -86,6 +90,7 @@ bool IsBindless(const IR::Inst& inst) {
|
|||
case IR::Opcode::BoundImageFetch:
|
||||
case IR::Opcode::BoundImageQueryDimensions:
|
||||
case IR::Opcode::BoundImageQueryLod:
|
||||
case IR::Opcode::BoundImageGradient:
|
||||
return false;
|
||||
default:
|
||||
throw InvalidArgument("Invalid opcode {}", inst.Opcode());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue