mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-09 04:10:05 +00:00
video_core: Fix shader-interpreter conditional-code initialization
Rather than reserving the incoming state of the conditional codes, the shader-interpreter was setting them both to false. In pretty much all cases, the initial state of a shaderunit can be zero-initialized statically. Just running the interpreter shouldn't necessarily reset the conditional codes though. The JIT loads incoming conditional codes while the shader-interpreter resets them to false. This makes the interpreter match the behavior of the shader-jit.
This commit is contained in:
parent
1053676c9f
commit
2cff4c9c34
3 changed files with 6 additions and 12 deletions
|
@ -9,10 +9,7 @@
|
||||||
|
|
||||||
namespace Pica {
|
namespace Pica {
|
||||||
|
|
||||||
ShaderUnit::ShaderUnit(GeometryEmitter* emitter) : emitter_ptr{emitter} {
|
ShaderUnit::ShaderUnit(GeometryEmitter* emitter) : emitter_ptr{emitter} {}
|
||||||
const Common::Vec4<f24> temp_vec{f24::Zero(), f24::Zero(), f24::Zero(), f24::One()};
|
|
||||||
temporary.fill(temp_vec);
|
|
||||||
}
|
|
||||||
|
|
||||||
ShaderUnit::~ShaderUnit() = default;
|
ShaderUnit::~ShaderUnit() = default;
|
||||||
|
|
||||||
|
|
|
@ -46,11 +46,11 @@ struct ShaderUnit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
s32 address_registers[3];
|
s32 address_registers[3] = {};
|
||||||
bool conditional_code[2];
|
bool conditional_code[2] = {};
|
||||||
alignas(16) std::array<Common::Vec4<f24>, 16> input;
|
alignas(16) std::array<Common::Vec4<f24>, 16> input = {};
|
||||||
alignas(16) std::array<Common::Vec4<f24>, 16> temporary;
|
alignas(16) std::array<Common::Vec4<f24>, 16> temporary = {};
|
||||||
alignas(16) std::array<Common::Vec4<f24>, 16> output;
|
alignas(16) std::array<Common::Vec4<f24>, 16> output = {};
|
||||||
GeometryEmitter* emitter_ptr;
|
GeometryEmitter* emitter_ptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -52,9 +52,6 @@ static void RunInterpreter(const ShaderSetup& setup, ShaderUnit& state,
|
||||||
boost::circular_buffer<LoopStackElement> loop_stack(4);
|
boost::circular_buffer<LoopStackElement> loop_stack(4);
|
||||||
u32 program_counter = entry_point;
|
u32 program_counter = entry_point;
|
||||||
|
|
||||||
state.conditional_code[0] = false;
|
|
||||||
state.conditional_code[1] = false;
|
|
||||||
|
|
||||||
const auto do_if = [&](Instruction instr, bool condition) {
|
const auto do_if = [&](Instruction instr, bool condition) {
|
||||||
if (condition) {
|
if (condition) {
|
||||||
if_stack.push_back({
|
if_stack.push_back({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue