shader: Reimplement GetCbufU64 as GetCbufU32x2
It may generate better code on some compilers and it's easier to handle.
This commit is contained in:
parent
5b3c6d59c2
commit
3f594dd86b
9 changed files with 21 additions and 22 deletions
|
@ -162,8 +162,8 @@ U32 IREmitter::GetCbuf(const U32& binding, const U32& byte_offset) {
|
|||
return Inst<U32>(Opcode::GetCbufU32, binding, byte_offset);
|
||||
}
|
||||
|
||||
UAny IREmitter::GetCbuf(const U32& binding, const U32& byte_offset, size_t bitsize,
|
||||
bool is_signed) {
|
||||
Value IREmitter::GetCbuf(const U32& binding, const U32& byte_offset, size_t bitsize,
|
||||
bool is_signed) {
|
||||
switch (bitsize) {
|
||||
case 8:
|
||||
return Inst<U32>(is_signed ? Opcode::GetCbufS8 : Opcode::GetCbufU8, binding, byte_offset);
|
||||
|
@ -172,7 +172,7 @@ UAny IREmitter::GetCbuf(const U32& binding, const U32& byte_offset, size_t bitsi
|
|||
case 32:
|
||||
return Inst<U32>(Opcode::GetCbufU32, binding, byte_offset);
|
||||
case 64:
|
||||
return Inst<U64>(Opcode::GetCbufU64, binding, byte_offset);
|
||||
return Inst(Opcode::GetCbufU32x2, binding, byte_offset);
|
||||
default:
|
||||
throw InvalidArgument("Invalid bit size {}", bitsize);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue