mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 09:55:45 +00:00
spirv: Workaround image unsigned offset bug
Workaround bug on Nvidia's OpenGL SPIR-V compiler when using unsigned texture offsets.
This commit is contained in:
parent
4a76786740
commit
59668831b7
2 changed files with 26 additions and 9 deletions
|
@ -104,7 +104,7 @@ private:
|
|||
return;
|
||||
}
|
||||
if (offset.IsImmediate()) {
|
||||
Add(spv::ImageOperandsMask::ConstOffset, ctx.Const(offset.U32()));
|
||||
Add(spv::ImageOperandsMask::ConstOffset, ctx.SConst(offset.U32()));
|
||||
return;
|
||||
}
|
||||
IR::Inst* const inst{offset.InstRecursive()};
|
||||
|
@ -112,16 +112,16 @@ private:
|
|||
switch (inst->GetOpcode()) {
|
||||
case IR::Opcode::CompositeConstructU32x2:
|
||||
Add(spv::ImageOperandsMask::ConstOffset,
|
||||
ctx.Const(inst->Arg(0).U32(), inst->Arg(1).U32()));
|
||||
ctx.SConst(inst->Arg(0).U32(), inst->Arg(1).U32()));
|
||||
return;
|
||||
case IR::Opcode::CompositeConstructU32x3:
|
||||
Add(spv::ImageOperandsMask::ConstOffset,
|
||||
ctx.Const(inst->Arg(0).U32(), inst->Arg(1).U32(), inst->Arg(2).U32()));
|
||||
ctx.SConst(inst->Arg(0).U32(), inst->Arg(1).U32(), inst->Arg(2).U32()));
|
||||
return;
|
||||
case IR::Opcode::CompositeConstructU32x4:
|
||||
Add(spv::ImageOperandsMask::ConstOffset,
|
||||
ctx.Const(inst->Arg(0).U32(), inst->Arg(1).U32(), inst->Arg(2).U32(),
|
||||
inst->Arg(3).U32()));
|
||||
ctx.SConst(inst->Arg(0).U32(), inst->Arg(1).U32(), inst->Arg(2).U32(),
|
||||
inst->Arg(3).U32()));
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue