spirv: Replace Constant/ConstantComposite with Const helper

This commit is contained in:
ameerj
2021-04-18 20:47:31 -04:00
parent 2999028976
commit 5b8afed871
12 changed files with 100 additions and 111 deletions

View File

@ -117,7 +117,7 @@ Id EmitFPLog2(EmitContext& ctx, Id value) {
}
Id EmitFPRecip32(EmitContext& ctx, Id value) {
return ctx.OpFDiv(ctx.F32[1], ctx.Constant(ctx.F32[1], 1.0f), value);
return ctx.OpFDiv(ctx.F32[1], ctx.Const(1.0f), value);
}
Id EmitFPRecip64(EmitContext& ctx, Id value) {
@ -143,8 +143,8 @@ Id EmitFPSaturate16(EmitContext& ctx, Id value) {
}
Id EmitFPSaturate32(EmitContext& ctx, Id value) {
const Id zero{ctx.Constant(ctx.F32[1], f32{0.0})};
const Id one{ctx.Constant(ctx.F32[1], f32{1.0})};
const Id zero{ctx.Const(f32{0.0})};
const Id one{ctx.Const(f32{1.0})};
return Clamp(ctx, ctx.F32[1], value, zero, one);
}