video_core: Reduce nihstro includes in headers. (#6626)

This commit is contained in:
Steveice10 2023-06-19 15:49:22 -07:00 committed by GitHub
parent 3faddd5e03
commit 03dbdfc12f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 37 deletions

View file

@ -12,7 +12,6 @@
#include <boost/serialization/access.hpp>
#include <boost/serialization/array.hpp>
#include <boost/serialization/base_object.hpp>
#include <nihstro/shader_bytecode.h>
#include "common/assert.h"
#include "common/common_funcs.h"
#include "common/common_types.h"
@ -22,10 +21,6 @@
#include "video_core/regs_rasterizer.h"
#include "video_core/regs_shader.h"
using nihstro::DestRegister;
using nihstro::RegisterType;
using nihstro::SourceRegister;
namespace Pica::Shader {
constexpr unsigned MAX_PROGRAM_CODE_LENGTH = 4096;
@ -164,36 +159,19 @@ struct UnitState {
GSEmitter* emitter_ptr;
static std::size_t InputOffset(const SourceRegister& reg) {
switch (reg.GetRegisterType()) {
case RegisterType::Input:
return offsetof(UnitState, registers.input) +
reg.GetIndex() * sizeof(Common::Vec4<float24>);
case RegisterType::Temporary:
return offsetof(UnitState, registers.temporary) +
reg.GetIndex() * sizeof(Common::Vec4<float24>);
default:
UNREACHABLE();
return 0;
}
static std::size_t InputOffset(int register_index) {
return offsetof(UnitState, registers.input) +
register_index * sizeof(Common::Vec4<float24>);
}
static std::size_t OutputOffset(const DestRegister& reg) {
switch (reg.GetRegisterType()) {
case RegisterType::Output:
return offsetof(UnitState, registers.output) +
reg.GetIndex() * sizeof(Common::Vec4<float24>);
static std::size_t OutputOffset(int register_index) {
return offsetof(UnitState, registers.output) +
register_index * sizeof(Common::Vec4<float24>);
}
case RegisterType::Temporary:
return offsetof(UnitState, registers.temporary) +
reg.GetIndex() * sizeof(Common::Vec4<float24>);
default:
UNREACHABLE();
return 0;
}
static std::size_t TemporaryOffset(int register_index) {
return offsetof(UnitState, registers.temporary) +
register_index * sizeof(Common::Vec4<float24>);
}
/**