mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 19:07:01 +02:00
shader_recompiler: rename/clean up typed SSA SPIR-V emitter
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
#include "graphics/shader/recompiler/ExecMask.h"
|
||||
|
||||
namespace Libs::Graphics::ShaderRecompiler::Exec {
|
||||
|
||||
Mask FullMask(uint32_t wave_size) {
|
||||
return {0xffffffffu, wave_size == 64u ? 0xffffffffu : 0u};
|
||||
}
|
||||
|
||||
Mask ApplyWaveSize(Mask mask, uint32_t wave_size) {
|
||||
const auto full = FullMask(wave_size);
|
||||
mask.low &= full.low;
|
||||
mask.high &= full.high;
|
||||
return mask;
|
||||
}
|
||||
|
||||
Mask ReadExec(const State& state) {
|
||||
return ApplyWaveSize(state.exec, state.wave_size);
|
||||
}
|
||||
|
||||
void WriteExec(State& state, Mask mask) {
|
||||
state.exec = ApplyWaveSize(mask, state.wave_size);
|
||||
}
|
||||
|
||||
void AndExec(State& state, Mask mask) {
|
||||
WriteExec(state, {state.exec.low & mask.low, state.exec.high & mask.high});
|
||||
}
|
||||
|
||||
void OrExec(State& state, Mask mask) {
|
||||
WriteExec(state, {state.exec.low | mask.low, state.exec.high | mask.high});
|
||||
}
|
||||
|
||||
void XorExec(State& state, Mask mask) {
|
||||
WriteExec(state, {state.exec.low ^ mask.low, state.exec.high ^ mask.high});
|
||||
}
|
||||
|
||||
void InvertExec(State& state) {
|
||||
const auto full = FullMask(state.wave_size);
|
||||
WriteExec(state, {~state.exec.low & full.low, ~state.exec.high & full.high});
|
||||
}
|
||||
|
||||
bool IsExecZero(const State& state) {
|
||||
const auto exec = ReadExec(state);
|
||||
return exec.low == 0u && exec.high == 0u;
|
||||
}
|
||||
|
||||
bool IsVccZero(const State& state) {
|
||||
const auto vcc = ApplyWaveSize(state.vcc, state.wave_size);
|
||||
return vcc.low == 0u && vcc.high == 0u;
|
||||
}
|
||||
|
||||
} // namespace Libs::Graphics::ShaderRecompiler::Exec
|
||||
@@ -1,34 +0,0 @@
|
||||
#ifndef EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_RECOMPILER_EXECMASK_H_
|
||||
#define EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_RECOMPILER_EXECMASK_H_
|
||||
|
||||
#include "common/common.h"
|
||||
|
||||
namespace Libs::Graphics::ShaderRecompiler::Exec {
|
||||
|
||||
struct Mask {
|
||||
uint32_t low = 0;
|
||||
uint32_t high = 0;
|
||||
};
|
||||
|
||||
struct State {
|
||||
uint32_t wave_size = 64;
|
||||
Mask exec;
|
||||
Mask vcc;
|
||||
bool scc = false;
|
||||
};
|
||||
|
||||
Mask FullMask(uint32_t wave_size);
|
||||
Mask ApplyWaveSize(Mask mask, uint32_t wave_size);
|
||||
|
||||
Mask ReadExec(const State& state);
|
||||
void WriteExec(State& state, Mask mask);
|
||||
void AndExec(State& state, Mask mask);
|
||||
void OrExec(State& state, Mask mask);
|
||||
void XorExec(State& state, Mask mask);
|
||||
void InvertExec(State& state);
|
||||
bool IsExecZero(const State& state);
|
||||
bool IsVccZero(const State& state);
|
||||
|
||||
} // namespace Libs::Graphics::ShaderRecompiler::Exec
|
||||
|
||||
#endif /* EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_RECOMPILER_EXECMASK_H_ */
|
||||
Reference in New Issue
Block a user