summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/shader.h
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2016-12-17 23:38:03 +0100
committerYuri Kunde Schlesner <yuriks@yuriks.net>2017-01-26 03:53:25 +0100
commit6fa3687afc97685101f9ee5c65cf98f505980695 (patch)
treeeb8c3927526cff06dbf9676499ca2e9fc11eda02 /src/video_core/shader/shader.h
parentShader: Initialize conditional_code in interpreter (diff)
downloadyuzu-6fa3687afc97685101f9ee5c65cf98f505980695.tar
yuzu-6fa3687afc97685101f9ee5c65cf98f505980695.tar.gz
yuzu-6fa3687afc97685101f9ee5c65cf98f505980695.tar.bz2
yuzu-6fa3687afc97685101f9ee5c65cf98f505980695.tar.lz
yuzu-6fa3687afc97685101f9ee5c65cf98f505980695.tar.xz
yuzu-6fa3687afc97685101f9ee5c65cf98f505980695.tar.zst
yuzu-6fa3687afc97685101f9ee5c65cf98f505980695.zip
Diffstat (limited to 'src/video_core/shader/shader.h')
-rw-r--r--src/video_core/shader/shader.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.h
index 9d2410487..7d51d0044 100644
--- a/src/video_core/shader/shader.h
+++ b/src/video_core/shader/shader.h
@@ -73,19 +73,13 @@ struct OutputVertex {
ret.Lerp(factor, v1);
return ret;
}
+
+ static OutputVertex FromRegisters(Math::Vec4<float24> output_regs[16], const Regs& regs,
+ u32 output_mask);
};
static_assert(std::is_pod<OutputVertex>::value, "Structure is not POD");
static_assert(sizeof(OutputVertex) == 32 * sizeof(float), "OutputVertex has invalid size");
-struct OutputRegisters {
- OutputRegisters() = default;
-
- alignas(16) Math::Vec4<float24> value[16];
-
- OutputVertex ToVertex(const Regs::ShaderConfig& config) const;
-};
-static_assert(std::is_pod<OutputRegisters>::value, "Structure is not POD");
-
/**
* This structure contains the state information that needs to be unique for a shader unit. The 3DS
* has four shader units that process shaders in parallel. At the present, Citra only implements a
@@ -98,11 +92,10 @@ struct UnitState {
// required to be 16-byte aligned.
alignas(16) Math::Vec4<float24> input[16];
alignas(16) Math::Vec4<float24> temporary[16];
+ alignas(16) Math::Vec4<float24> output[16];
} registers;
static_assert(std::is_pod<Registers>::value, "Structure is not POD");
- OutputRegisters output_registers;
-
bool conditional_code[2];
// Two Address registers and one loop counter
@@ -128,7 +121,7 @@ struct UnitState {
static size_t OutputOffset(const DestRegister& reg) {
switch (reg.GetRegisterType()) {
case RegisterType::Output:
- return offsetof(UnitState, output_registers.value) +
+ return offsetof(UnitState, registers.output) +
reg.GetIndex() * sizeof(Math::Vec4<float24>);
case RegisterType::Temporary: