1
0
Fork 0
forked from suyu/suyu

spirv/convert: Catch more broken signed operations on Nvidia OpenGL

BitCast U32 to S32 before converting to float on drivers with broken
signed operations.
This commit is contained in:
ReinUsesLisp 2021-06-11 00:18:24 -03:00 committed by ameerj
parent cd8427367e
commit 8554a644df

View file

@ -205,6 +205,9 @@ Id EmitConvertF32S16(EmitContext& ctx, Id value) {
} }
Id EmitConvertF32S32(EmitContext& ctx, Id value) { Id EmitConvertF32S32(EmitContext& ctx, Id value) {
if (ctx.profile.has_broken_signed_operations) {
value = ctx.OpBitcast(ctx.S32[1], value);
}
return ctx.OpConvertSToF(ctx.F32[1], value); return ctx.OpConvertSToF(ctx.F32[1], value);
} }
@ -237,6 +240,9 @@ Id EmitConvertF64S16(EmitContext& ctx, Id value) {
} }
Id EmitConvertF64S32(EmitContext& ctx, Id value) { Id EmitConvertF64S32(EmitContext& ctx, Id value) {
if (ctx.profile.has_broken_signed_operations) {
value = ctx.OpBitcast(ctx.S32[1], value);
}
return ctx.OpConvertSToF(ctx.F64[1], value); return ctx.OpConvertSToF(ctx.F64[1], value);
} }