[shader_recompiler] Refactor some whitespaces
All checks were successful
eden-license / license-header (pull_request) Successful in 17s
All checks were successful
eden-license / license-header (pull_request) Successful in 17s
This commit is contained in:
parent
d6273f529b
commit
b47432d997
1 changed files with 17 additions and 14 deletions
|
@ -32,21 +32,21 @@ enum class Shift : u64 {
|
||||||
|
|
||||||
IR::U32 scaleIndex(IR::IREmitter& ir, IR::U32 index, Shift shift) {
|
IR::U32 scaleIndex(IR::IREmitter& ir, IR::U32 index, Shift shift) {
|
||||||
switch (shift) {
|
switch (shift) {
|
||||||
case Shift::Default: return index;
|
case Shift::Default: return index;
|
||||||
case Shift::U16: return ir.ShiftLeftLogical(index, ir.Imm32(1));
|
case Shift::U16: return ir.ShiftLeftLogical(index, ir.Imm32(1));
|
||||||
case Shift::B32: return ir.ShiftLeftLogical(index, ir.Imm32(2));
|
case Shift::B32: return ir.ShiftLeftLogical(index, ir.Imm32(2));
|
||||||
default: UNREACHABLE();
|
default: UNREACHABLE();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IR::U32 skewBytes(IR::IREmitter& ir, SZ sizeRead) {
|
IR::U32 skewBytes(IR::IREmitter& ir, SZ sizeRead) {
|
||||||
const IR::U32 lane = ir.LaneId();
|
const IR::U32 lane = ir.LaneId();
|
||||||
switch (sizeRead) {
|
switch (sizeRead) {
|
||||||
case SZ::U8: return lane;
|
case SZ::U8: return lane;
|
||||||
case SZ::U16: return ir.ShiftLeftLogical(lane, ir.Imm32(1));
|
case SZ::U16: return ir.ShiftLeftLogical(lane, ir.Imm32(1));
|
||||||
case SZ::U32:
|
case SZ::U32:
|
||||||
case SZ::F32: return ir.ShiftLeftLogical(lane, ir.Imm32(2));
|
case SZ::F32: return ir.ShiftLeftLogical(lane, ir.Imm32(2));
|
||||||
default: UNREACHABLE();
|
default: UNREACHABLE();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ void TranslatorVisitor::ISBERD(u64 insn) {
|
||||||
case SZ::U16: globalLoaded = ir.LoadGlobalU16(index64); break;
|
case SZ::U16: globalLoaded = ir.LoadGlobalU16(index64); break;
|
||||||
case SZ::U32:
|
case SZ::U32:
|
||||||
case SZ::F32: globalLoaded = ir.LoadGlobal32(index64); break;
|
case SZ::F32: globalLoaded = ir.LoadGlobal32(index64); break;
|
||||||
default: UNREACHABLE();
|
default: UNREACHABLE();
|
||||||
}
|
}
|
||||||
X(isberd.dest_reg.Value(), globalLoaded);
|
X(isberd.dest_reg.Value(), globalLoaded);
|
||||||
|
|
||||||
|
@ -102,10 +102,13 @@ void TranslatorVisitor::ISBERD(u64 insn) {
|
||||||
|
|
||||||
IR::F32 float_index{};
|
IR::F32 float_index{};
|
||||||
switch (isberd.mode.Value()) {
|
switch (isberd.mode.Value()) {
|
||||||
case Mode::Patch: float_index = ir.GetPatch(index.Patch()); break;
|
case Mode::Patch: float_index = ir.GetPatch(index.Patch());
|
||||||
case Mode::Prim: float_index = ir.GetAttribute(index.Attribute()); break;
|
break;
|
||||||
case Mode::Attr: float_index = ir.GetAttributeIndexed(index); break;
|
case Mode::Prim: float_index = ir.GetAttribute(index.Attribute());
|
||||||
default: UNREACHABLE();
|
break;
|
||||||
|
case Mode::Attr: float_index = ir.GetAttributeIndexed(index);
|
||||||
|
break;
|
||||||
|
default: UNREACHABLE();
|
||||||
}
|
}
|
||||||
X(isberd.dest_reg.Value(), ir.BitCast<IR::U32>(float_index));
|
X(isberd.dest_reg.Value(), ir.BitCast<IR::U32>(float_index));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue