mirror of
https://git.h3cjp.net/H3cJP/citra.git
synced 2024-11-28 06:52:47 +00:00
shader: Align constant buffer sizes to 16 bytes
WAR for AMD reading zeroes on uniform buffers of size 2.
This commit is contained in:
parent
59fead3a47
commit
0cd08b3e72
|
@ -2,6 +2,7 @@
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include "common/alignment.h"
|
||||||
#include "shader_recompiler/environment.h"
|
#include "shader_recompiler/environment.h"
|
||||||
#include "shader_recompiler/frontend/ir/modifiers.h"
|
#include "shader_recompiler/frontend/ir/modifiers.h"
|
||||||
#include "shader_recompiler/frontend/ir/program.h"
|
#include "shader_recompiler/frontend/ir/program.h"
|
||||||
|
@ -602,7 +603,7 @@ void VisitUsages(Info& info, IR::Inst& inst) {
|
||||||
}
|
}
|
||||||
u32& size{info.constant_buffer_used_sizes[index.U32()]};
|
u32& size{info.constant_buffer_used_sizes[index.U32()]};
|
||||||
if (offset.IsImmediate()) {
|
if (offset.IsImmediate()) {
|
||||||
size = std::max(size, offset.U32() + element_size);
|
size = Common::AlignUp(std::max(size, offset.U32() + element_size), 16u);
|
||||||
} else {
|
} else {
|
||||||
size = 0x10'000;
|
size = 0x10'000;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue