shader: Add IsTextureScaled opcode
This commit is contained in:
parent
74efa57c1b
commit
c15332c44f
10 changed files with 34 additions and 0 deletions
|
@ -608,6 +608,14 @@ void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Re
|
|||
ctx.Add("STOREIM.{} {},{},{},{};", format, image, color, coord, type);
|
||||
}
|
||||
|
||||
void EmitIsTextureScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& index) {
|
||||
if (!index.IsImmediate()) {
|
||||
throw NotImplementedException("Non-constant texture rescaling");
|
||||
}
|
||||
UNIMPLEMENTED();
|
||||
ctx.Add("MOV.S {}.x,-1;", inst);
|
||||
}
|
||||
|
||||
void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coord,
|
||||
ScalarU32 value) {
|
||||
ImageAtomic(ctx, inst, index, coord, value, "ADD.U32");
|
||||
|
|
|
@ -556,6 +556,7 @@ void EmitImageGradient(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
|
|||
void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coord);
|
||||
void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coord,
|
||||
Register color);
|
||||
void EmitIsTextureScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& index);
|
||||
void EmitBindlessImageAtomicIAdd32(EmitContext&);
|
||||
void EmitBindlessImageAtomicSMin32(EmitContext&);
|
||||
void EmitBindlessImageAtomicUMin32(EmitContext&);
|
||||
|
|
|
@ -612,6 +612,14 @@ void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value
|
|||
value);
|
||||
}
|
||||
|
||||
void EmitIsTextureScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& index) {
|
||||
if (!index.IsImmediate()) {
|
||||
throw NotImplementedException("Non-constant texture rescaling");
|
||||
}
|
||||
UNIMPLEMENTED();
|
||||
ctx.AddU1("{}=true;", inst);
|
||||
}
|
||||
|
||||
void EmitBindlessImageSampleImplicitLod(EmitContext&) {
|
||||
NotImplemented();
|
||||
}
|
||||
|
|
|
@ -630,6 +630,8 @@ void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
|
|||
std::string_view coords);
|
||||
void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
|
||||
std::string_view coords, std::string_view color);
|
||||
void EmitIsTextureScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& index);
|
||||
void EmitIsImageScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& index);
|
||||
void EmitBindlessImageAtomicIAdd32(EmitContext&);
|
||||
void EmitBindlessImageAtomicSMin32(EmitContext&);
|
||||
void EmitBindlessImageAtomicUMin32(EmitContext&);
|
||||
|
|
|
@ -470,4 +470,8 @@ void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id
|
|||
ctx.OpImageWrite(Image(ctx, index, info), coords, color);
|
||||
}
|
||||
|
||||
Id EmitIsTextureScaled([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] const IR::Value& index) {
|
||||
return ctx.false_value;
|
||||
}
|
||||
|
||||
} // namespace Shader::Backend::SPIRV
|
||||
|
|
|
@ -513,6 +513,7 @@ Id EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, I
|
|||
Id derivates, Id offset, Id lod_clamp);
|
||||
Id EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords);
|
||||
void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id color);
|
||||
Id EmitIsTextureScaled(EmitContext& ctx, const IR::Value& index);
|
||||
Id EmitBindlessImageAtomicIAdd32(EmitContext&);
|
||||
Id EmitBindlessImageAtomicSMin32(EmitContext&);
|
||||
Id EmitBindlessImageAtomicUMin32(EmitContext&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue