From 45b1d2edf3cfa01e38b918c9e7c6be30d80a697c Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 9 Oct 2015 20:59:40 -1000 Subject: [PATCH] Initial GX Backend --- hecl/include/HECL/Backend.hpp | 4 - hecl/include/HECL/Backend/Backend.hpp | 19 ++ hecl/include/HECL/Backend/GX.hpp | 255 ++++++++++++++++++ hecl/lib/Backend/CMakeLists.txt | 3 +- hecl/lib/Backend/GLSL/CGLSLFragEmitter.cpp | 0 hecl/lib/Backend/GLSL/CGLSLObject.cpp | 0 hecl/lib/Backend/GLSL/CGLSLSpec.cpp | 0 hecl/lib/Backend/GLSL/CGLSLVertEmitter.cpp | 0 hecl/lib/Backend/GX.cpp | 74 +++++ hecl/lib/Backend/GX/CGXFragEmitter.cpp | 0 hecl/lib/Backend/GX/CGXObject.cpp | 0 hecl/lib/Backend/GX/CGXSpec.cpp | 0 hecl/lib/Backend/GX/CGXVertEmitter.cpp | 0 .../Backend/GX2LLVM/CGX2LLVMFragEmitter.cpp | 0 hecl/lib/Backend/GX2LLVM/CGX2LLVMObject.cpp | 0 hecl/lib/Backend/GX2LLVM/CGX2LLVMSpec.cpp | 0 .../Backend/GX2LLVM/CGX2LLVMVertEmitter.cpp | 0 hecl/lib/Backend/HECLBackend.cpp | 0 hecl/lib/Backend/HLSL/CHLSLFragEmitter.cpp | 0 hecl/lib/Backend/HLSL/CHLSLObject.cpp | 0 hecl/lib/Backend/HLSL/CHLSLSpec.cpp | 0 hecl/lib/Backend/HLSL/CHLSLVertEmitter.cpp | 0 hecl/lib/Backend/IBackendFragEmitter.hpp | 4 - hecl/lib/Backend/IBackendObject.hpp | 4 - hecl/lib/Backend/IBackendSpec.hpp | 4 - hecl/lib/Backend/IBackendVertEmitter.hpp | 4 - hecl/lib/Backend/SPIRV/CSPIRVFragEmitter.cpp | 0 hecl/lib/Backend/SPIRV/CSPIRVObject.cpp | 0 hecl/lib/Backend/SPIRV/CSPIRVSpec.cpp | 0 hecl/lib/Backend/SPIRV/CSPIRVVertEmitter.cpp | 0 hecl/lib/CMakeLists.txt | 3 +- hecl/lib/Frontend/Lexer.cpp | 4 +- hecl/lib/Frontend/expr/CExprAdd.hpp | 4 - hecl/lib/Frontend/expr/CExprBase.hpp | 4 - hecl/lib/Frontend/expr/CExprCall.hpp | 4 - hecl/lib/Frontend/expr/CExprGroup.hpp | 4 - hecl/lib/Frontend/expr/CExprLighting.hpp | 4 - hecl/lib/Frontend/expr/CExprMul.hpp | 4 - hecl/lib/Frontend/expr/CExprRoot.hpp | 4 - hecl/lib/Frontend/expr/CExprSub.hpp | 4 - hecl/lib/Frontend/expr/CExprTexture.hpp | 4 - hecl/lib/Frontend/expr/CExprTextureGather.hpp | 4 - hecl/lib/Frontend/expr/expr.hpp | 15 -- 43 files changed, 354 insertions(+), 79 deletions(-) delete mode 100644 hecl/include/HECL/Backend.hpp create mode 100644 hecl/include/HECL/Backend/Backend.hpp create mode 100644 hecl/include/HECL/Backend/GX.hpp delete mode 100644 hecl/lib/Backend/GLSL/CGLSLFragEmitter.cpp delete mode 100644 hecl/lib/Backend/GLSL/CGLSLObject.cpp delete mode 100644 hecl/lib/Backend/GLSL/CGLSLSpec.cpp delete mode 100644 hecl/lib/Backend/GLSL/CGLSLVertEmitter.cpp create mode 100644 hecl/lib/Backend/GX.cpp delete mode 100644 hecl/lib/Backend/GX/CGXFragEmitter.cpp delete mode 100644 hecl/lib/Backend/GX/CGXObject.cpp delete mode 100644 hecl/lib/Backend/GX/CGXSpec.cpp delete mode 100644 hecl/lib/Backend/GX/CGXVertEmitter.cpp delete mode 100644 hecl/lib/Backend/GX2LLVM/CGX2LLVMFragEmitter.cpp delete mode 100644 hecl/lib/Backend/GX2LLVM/CGX2LLVMObject.cpp delete mode 100644 hecl/lib/Backend/GX2LLVM/CGX2LLVMSpec.cpp delete mode 100644 hecl/lib/Backend/GX2LLVM/CGX2LLVMVertEmitter.cpp delete mode 100644 hecl/lib/Backend/HECLBackend.cpp delete mode 100644 hecl/lib/Backend/HLSL/CHLSLFragEmitter.cpp delete mode 100644 hecl/lib/Backend/HLSL/CHLSLObject.cpp delete mode 100644 hecl/lib/Backend/HLSL/CHLSLSpec.cpp delete mode 100644 hecl/lib/Backend/HLSL/CHLSLVertEmitter.cpp delete mode 100644 hecl/lib/Backend/IBackendFragEmitter.hpp delete mode 100644 hecl/lib/Backend/IBackendObject.hpp delete mode 100644 hecl/lib/Backend/IBackendSpec.hpp delete mode 100644 hecl/lib/Backend/IBackendVertEmitter.hpp delete mode 100644 hecl/lib/Backend/SPIRV/CSPIRVFragEmitter.cpp delete mode 100644 hecl/lib/Backend/SPIRV/CSPIRVObject.cpp delete mode 100644 hecl/lib/Backend/SPIRV/CSPIRVSpec.cpp delete mode 100644 hecl/lib/Backend/SPIRV/CSPIRVVertEmitter.cpp delete mode 100644 hecl/lib/Frontend/expr/CExprAdd.hpp delete mode 100644 hecl/lib/Frontend/expr/CExprBase.hpp delete mode 100644 hecl/lib/Frontend/expr/CExprCall.hpp delete mode 100644 hecl/lib/Frontend/expr/CExprGroup.hpp delete mode 100644 hecl/lib/Frontend/expr/CExprLighting.hpp delete mode 100644 hecl/lib/Frontend/expr/CExprMul.hpp delete mode 100644 hecl/lib/Frontend/expr/CExprRoot.hpp delete mode 100644 hecl/lib/Frontend/expr/CExprSub.hpp delete mode 100644 hecl/lib/Frontend/expr/CExprTexture.hpp delete mode 100644 hecl/lib/Frontend/expr/CExprTextureGather.hpp delete mode 100644 hecl/lib/Frontend/expr/expr.hpp diff --git a/hecl/include/HECL/Backend.hpp b/hecl/include/HECL/Backend.hpp deleted file mode 100644 index 93fbfa49f..000000000 --- a/hecl/include/HECL/Backend.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef HECLBACKEND_HPP -#define HECLBACKEND_HPP - -#endif // HECLBACKEND_HPP diff --git a/hecl/include/HECL/Backend/Backend.hpp b/hecl/include/HECL/Backend/Backend.hpp new file mode 100644 index 000000000..965b19c59 --- /dev/null +++ b/hecl/include/HECL/Backend/Backend.hpp @@ -0,0 +1,19 @@ +#ifndef HECLBACKEND_HPP +#define HECLBACKEND_HPP + +namespace HECL +{ +namespace Frontend {class IR;} +namespace Backend +{ + +class IBackend +{ +public: + virtual void reset(const Frontend::IR& ir)=0; +}; + +} +} + +#endif // HECLBACKEND_HPP diff --git a/hecl/include/HECL/Backend/GX.hpp b/hecl/include/HECL/Backend/GX.hpp new file mode 100644 index 000000000..3477df097 --- /dev/null +++ b/hecl/include/HECL/Backend/GX.hpp @@ -0,0 +1,255 @@ +#ifndef HECLBACKEND_GX_HPP +#define HECLBACKEND_GX_HPP + +#include "Backend.hpp" +#include +#include +#include +#include + +namespace HECL +{ +namespace Backend +{ + +struct GX : IBackend +{ + enum TevOp + { + TEV_ADD = 0, + TEV_SUB = 1, + TEV_COMP_R8_GT = 8, + TEV_COMP_R8_EQ = 9, + TEV_COMP_GR16_GT = 10, + TEV_COMP_GR16_EQ = 11, + TEV_COMP_BGR24_GT = 12, + TEV_COMP_BGR24_EQ = 13, + TEV_COMP_RGB8_GT = 14, + TEV_COMP_RGB8_EQ = 15, + TEV_COMP_A8_GT = TEV_COMP_RGB8_GT, // for alpha channel + TEV_COMP_A8_EQ = TEV_COMP_RGB8_EQ // for alpha channel + }; + + enum TevRegID + { + TEVPREV = 0, + TEVREG0 = 1, + TEVREG1 = 2, + TEVREG2 = 3 + }; + + enum TevColorArg + { + CC_CPREV = 0, /*!< Use the color value from previous TEV stage */ + CC_APREV = 1, /*!< Use the alpha value from previous TEV stage */ + CC_C0 = 2, /*!< Use the color value from the color/output register 0 */ + CC_A0 = 3, /*!< Use the alpha value from the color/output register 0 */ + CC_C1 = 4, /*!< Use the color value from the color/output register 1 */ + CC_A1 = 5, /*!< Use the alpha value from the color/output register 1 */ + CC_C2 = 6, /*!< Use the color value from the color/output register 2 */ + CC_A2 = 7, /*!< Use the alpha value from the color/output register 2 */ + CC_TEXC = 8, /*!< Use the color value from texture */ + CC_TEXA = 9, /*!< Use the alpha value from texture */ + CC_RASC = 10, /*!< Use the color value from rasterizer */ + CC_RASA = 11, /*!< Use the alpha value from rasterizer */ + CC_ONE = 12, + CC_HALF = 13, + CC_KONST = 14, + CC_ZERO = 15 /*!< Use to pass zero value */ + }; + + enum TevAlphaArg + { + CA_APREV = 0, /*!< Use the alpha value from previous TEV stage */ + CA_A0 = 1, /*!< Use the alpha value from the color/output register 0 */ + CA_A1 = 2, /*!< Use the alpha value from the color/output register 1 */ + CA_A2 = 3, /*!< Use the alpha value from the color/output register 2 */ + CA_TEXA = 4, /*!< Use the alpha value from texture */ + CA_RASA = 5, /*!< Use the alpha value from rasterizer */ + CA_KONST = 6, + CA_ZERO = 7 /*!< Use to pass zero value */ + }; + + enum TevKColorSel + { + TEV_KCSEL_8_8 = 0x00, + TEV_KCSEL_7_8 = 0x01, + TEV_KCSEL_6_8 = 0x02, + TEV_KCSEL_5_8 = 0x03, + TEV_KCSEL_4_8 = 0x04, + TEV_KCSEL_3_8 = 0x05, + TEV_KCSEL_2_8 = 0x06, + TEV_KCSEL_1_8 = 0x07, + + TEV_KCSEL_1 = TEV_KCSEL_8_8, + TEV_KCSEL_3_4 = TEV_KCSEL_6_8, + TEV_KCSEL_1_2 = TEV_KCSEL_4_8, + TEV_KCSEL_1_4 = TEV_KCSEL_2_8, + + TEV_KCSEL_K0 = 0x0C, + TEV_KCSEL_K1 = 0x0D, + TEV_KCSEL_K2 = 0x0E, + TEV_KCSEL_K3 = 0x0F, + TEV_KCSEL_K0_R = 0x10, + TEV_KCSEL_K1_R = 0x11, + TEV_KCSEL_K2_R = 0x12, + TEV_KCSEL_K3_R = 0x13, + TEV_KCSEL_K0_G = 0x14, + TEV_KCSEL_K1_G = 0x15, + TEV_KCSEL_K2_G = 0x16, + TEV_KCSEL_K3_G = 0x17, + TEV_KCSEL_K0_B = 0x18, + TEV_KCSEL_K1_B = 0x19, + TEV_KCSEL_K2_B = 0x1A, + TEV_KCSEL_K3_B = 0x1B, + TEV_KCSEL_K0_A = 0x1C, + TEV_KCSEL_K1_A = 0x1D, + TEV_KCSEL_K2_A = 0x1E, + TEV_KCSEL_K3_A = 0x1F + }; + + enum TevKAlphaSel + { + TEV_KASEL_8_8 = 0x00, + TEV_KASEL_7_8 = 0x01, + TEV_KASEL_6_8 = 0x02, + TEV_KASEL_5_8 = 0x03, + TEV_KASEL_4_8 = 0x04, + TEV_KASEL_3_8 = 0x05, + TEV_KASEL_2_8 = 0x06, + TEV_KASEL_1_8 = 0x07, + + TEV_KASEL_1 = TEV_KASEL_8_8, + TEV_KASEL_3_4 = TEV_KASEL_6_8, + TEV_KASEL_1_2 = TEV_KASEL_4_8, + TEV_KASEL_1_4 = TEV_KASEL_2_8, + + TEV_KASEL_K0_R = 0x10, + TEV_KASEL_K1_R = 0x11, + TEV_KASEL_K2_R = 0x12, + TEV_KASEL_K3_R = 0x13, + TEV_KASEL_K0_G = 0x14, + TEV_KASEL_K1_G = 0x15, + TEV_KASEL_K2_G = 0x16, + TEV_KASEL_K3_G = 0x17, + TEV_KASEL_K0_B = 0x18, + TEV_KASEL_K1_B = 0x19, + TEV_KASEL_K2_B = 0x1A, + TEV_KASEL_K3_B = 0x1B, + TEV_KASEL_K0_A = 0x1C, + TEV_KASEL_K1_A = 0x1D, + TEV_KASEL_K2_A = 0x1E, + TEV_KASEL_K3_A = 0x1F + }; + + enum TexGenSrc + { + TG_POS = 0, + TG_NRM, + TG_BINRM, + TG_TANGENT, + TG_TEX0, + TG_TEX1, + TG_TEX2, + TG_TEX3, + TG_TEX4, + TG_TEX5, + TG_TEX6, + TG_TEX7, + TG_TEXCOORD0, + TG_TEXCOORD1, + TG_TEXCOORD2, + TG_TEXCOORD3, + TG_TEXCOORD4, + TG_TEXCOORD5, + TG_TEXCOORD6, + TG_COLOR0, + TG_COLOR1 + }; + + enum TexMtx + { + TEXMTX0 = 30, + TEXMTX1 = 33, + TEXMTX2 = 36, + TEXMTX3 = 39, + TEXMTX4 = 42, + TEXMTX5 = 45, + TEXMTX6 = 48, + TEXMTX7 = 51, + TEXMTX8 = 54, + TEXMTX9 = 57, + IDENTITY = 60 + }; + + struct TexCoordGen + { + TexGenSrc m_src; + TexMtx m_mtx; + }; + unsigned m_tcgCount = 0; + TexCoordGen m_tcgs; + + struct TEVStage + { + TevOp m_op; + TevColorArg m_color[4]; + TevAlphaArg m_alpha[4]; + TevKColorSel m_kColor; + TevKAlphaSel m_kAlpha; + TevRegID m_regOut; + unsigned m_texMapIdx; + unsigned m_texGenIdx; + }; + unsigned m_tevCount = 0; + TEVStage m_tevs; + + enum BlendFactor + { + BL_ZERO, + BL_ONE, + BL_SRCCLR, + BL_INVSRCCLR, + BL_SRCALPHA, + BL_INVSRCALPHA, + BL_DSTALPHA, + BL_INVDSTALPHA + }; + BlendFactor m_blendSrc; + BlendFactor m_blendDst; + + struct Color + { + union + { + uint8_t color[4]; + uint32_t num = 0; + }; + Color() = default; + Color& operator=(const atVec4f& vec) + { + color[0] = uint8_t(std::min(std::max(vec.vec[0] * 255.f, 0.f), 255.f)); + color[1] = uint8_t(std::min(std::max(vec.vec[1] * 255.f, 0.f), 255.f)); + color[2] = uint8_t(std::min(std::max(vec.vec[2] * 255.f, 0.f), 255.f)); + color[3] = uint8_t(std::min(std::max(vec.vec[3] * 255.f, 0.f), 255.f)); + return *this; + } + Color(const atVec4f& vec) {*this = vec;} + bool operator==(const Color& other) const {return num == other.num;} + bool operator!=(const Color& other) const {return num != other.num;} + uint8_t operator[](size_t idx) const {return color[idx];} + uint8_t& operator[](size_t idx) {return color[idx];} + }; + unsigned m_kcolorCount = 0; + Color m_kcolors[4]; + + void reset(const Frontend::IR& ir); + +private: + unsigned addKColor(const Color& color); +}; + +} +} + +#endif // HECLBACKEND_GX_HPP diff --git a/hecl/lib/Backend/CMakeLists.txt b/hecl/lib/Backend/CMakeLists.txt index e99d6eebe..0ba45ba12 100644 --- a/hecl/lib/Backend/CMakeLists.txt +++ b/hecl/lib/Backend/CMakeLists.txt @@ -1 +1,2 @@ -add_library(HECLBackend HECLBackend.cpp) +add_library(HECLBackend + GX.cpp) diff --git a/hecl/lib/Backend/GLSL/CGLSLFragEmitter.cpp b/hecl/lib/Backend/GLSL/CGLSLFragEmitter.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/GLSL/CGLSLObject.cpp b/hecl/lib/Backend/GLSL/CGLSLObject.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/GLSL/CGLSLSpec.cpp b/hecl/lib/Backend/GLSL/CGLSLSpec.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/GLSL/CGLSLVertEmitter.cpp b/hecl/lib/Backend/GLSL/CGLSLVertEmitter.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/GX.cpp b/hecl/lib/Backend/GX.cpp new file mode 100644 index 000000000..fa0c9de80 --- /dev/null +++ b/hecl/lib/Backend/GX.cpp @@ -0,0 +1,74 @@ +#include +#include "HECL/Backend/GX.hpp" +#include "HECL/Frontend.hpp" + +static LogVisor::LogModule Log("HECL::GX"); + +namespace HECL +{ +namespace Backend +{ + +unsigned GX::addKColor(const Color& color) +{ + for (unsigned i=0 ; i= 4) + Log.report(LogVisor::FatalError, "GX KColor overflow"); + m_kcolors[m_kcolorCount] = color; + return m_kcolorCount++; +} + +void GX::reset(const Frontend::IR& ir) +{ + m_tevCount = 0; + m_tcgCount = 0; + m_kcolorCount = 0; + + /* Final instruction is the root call by hecl convention */ + const Frontend::IR::Instruction& rootCall = ir.m_instructions.back(); + bool doAlpha = false; + if (!rootCall.m_call.m_name.compare("HECLOpaque")) + { + m_blendSrc = BL_ONE; + m_blendDst = BL_ZERO; + } + else if (!rootCall.m_call.m_name.compare("HECLAlpha")) + { + m_blendSrc = BL_SRCALPHA; + m_blendDst = BL_INVSRCALPHA; + doAlpha = true; + } + else if (!rootCall.m_call.m_name.compare("HECLAdditive")) + { + m_blendSrc = BL_SRCALPHA; + m_blendDst = BL_ONE; + doAlpha = true; + } + + for (const Frontend::IR::Instruction& inst : ir.m_instructions) + { + switch (inst.m_op) + { + case Frontend::IR::OpCall: + { + const std::string& name = inst.m_call.m_name; + if (!name.compare("ColorReg")) + { + } + break; + } + case Frontend::IR::OpLoadImm: + { + addKColor(inst.m_loadImm.m_immVec); + break; + } + default: + Log.report(LogVisor::FatalError, "invalid inst op"); + } + } +} + +} +} diff --git a/hecl/lib/Backend/GX/CGXFragEmitter.cpp b/hecl/lib/Backend/GX/CGXFragEmitter.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/GX/CGXObject.cpp b/hecl/lib/Backend/GX/CGXObject.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/GX/CGXSpec.cpp b/hecl/lib/Backend/GX/CGXSpec.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/GX/CGXVertEmitter.cpp b/hecl/lib/Backend/GX/CGXVertEmitter.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/GX2LLVM/CGX2LLVMFragEmitter.cpp b/hecl/lib/Backend/GX2LLVM/CGX2LLVMFragEmitter.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/GX2LLVM/CGX2LLVMObject.cpp b/hecl/lib/Backend/GX2LLVM/CGX2LLVMObject.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/GX2LLVM/CGX2LLVMSpec.cpp b/hecl/lib/Backend/GX2LLVM/CGX2LLVMSpec.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/GX2LLVM/CGX2LLVMVertEmitter.cpp b/hecl/lib/Backend/GX2LLVM/CGX2LLVMVertEmitter.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/HECLBackend.cpp b/hecl/lib/Backend/HECLBackend.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/HLSL/CHLSLFragEmitter.cpp b/hecl/lib/Backend/HLSL/CHLSLFragEmitter.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/HLSL/CHLSLObject.cpp b/hecl/lib/Backend/HLSL/CHLSLObject.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/HLSL/CHLSLSpec.cpp b/hecl/lib/Backend/HLSL/CHLSLSpec.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/HLSL/CHLSLVertEmitter.cpp b/hecl/lib/Backend/HLSL/CHLSLVertEmitter.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/IBackendFragEmitter.hpp b/hecl/lib/Backend/IBackendFragEmitter.hpp deleted file mode 100644 index 63e685e63..000000000 --- a/hecl/lib/Backend/IBackendFragEmitter.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef IBACKENDFRAGEMITTER_HPP -#define IBACKENDFRAGEMITTER_HPP - -#endif // IBACKENDFRAGEMITTER_HPP diff --git a/hecl/lib/Backend/IBackendObject.hpp b/hecl/lib/Backend/IBackendObject.hpp deleted file mode 100644 index 09ed56102..000000000 --- a/hecl/lib/Backend/IBackendObject.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef IBACKENDOBJECT_HPP -#define IBACKENDOBJECT_HPP - -#endif // IBACKENDOBJECT_HPP diff --git a/hecl/lib/Backend/IBackendSpec.hpp b/hecl/lib/Backend/IBackendSpec.hpp deleted file mode 100644 index 9c6539e26..000000000 --- a/hecl/lib/Backend/IBackendSpec.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef IBACKENDSPEC_HPP -#define IBACKENDSPEC_HPP - -#endif // IBACKENDSPEC_HPP diff --git a/hecl/lib/Backend/IBackendVertEmitter.hpp b/hecl/lib/Backend/IBackendVertEmitter.hpp deleted file mode 100644 index 76434b849..000000000 --- a/hecl/lib/Backend/IBackendVertEmitter.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef IBACKENDVERTEMITTER_HPP -#define IBACKENDVERTEMITTER_HPP - -#endif // IBACKENDVERTEMITTER_HPP diff --git a/hecl/lib/Backend/SPIRV/CSPIRVFragEmitter.cpp b/hecl/lib/Backend/SPIRV/CSPIRVFragEmitter.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/SPIRV/CSPIRVObject.cpp b/hecl/lib/Backend/SPIRV/CSPIRVObject.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/SPIRV/CSPIRVSpec.cpp b/hecl/lib/Backend/SPIRV/CSPIRVSpec.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/Backend/SPIRV/CSPIRVVertEmitter.cpp b/hecl/lib/Backend/SPIRV/CSPIRVVertEmitter.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/hecl/lib/CMakeLists.txt b/hecl/lib/CMakeLists.txt index 2277730d9..1f1ee79e0 100644 --- a/hecl/lib/CMakeLists.txt +++ b/hecl/lib/CMakeLists.txt @@ -12,7 +12,8 @@ add_library(HECLCommon ProjectPath.cpp WideStringConvert.cpp ../include/HECL/HECL.hpp - ../include/HECL/Backend.hpp + ../include/HECL/Backend/Backend.hpp + ../include/HECL/Backend/GX.hpp ../include/HECL/Frontend.hpp ../include/HECL/Database.hpp ../include/HECL/Runtime.hpp diff --git a/hecl/lib/Frontend/Lexer.cpp b/hecl/lib/Frontend/Lexer.cpp index ca5feb044..fc3a68aff 100644 --- a/hecl/lib/Frontend/Lexer.cpp +++ b/hecl/lib/Frontend/Lexer.cpp @@ -345,7 +345,7 @@ void Lexer::EmitVec3(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar vec.vec[0] = imms[0]->m_tokenFloat; vec.vec[1] = imms[1]->m_tokenFloat; vec.vec[2] = imms[2]->m_tokenFloat; - vec.vec[3] = 0.0; + vec.vec[3] = 1.0; return; } @@ -569,7 +569,7 @@ void Lexer::EmitVectorSwizzle(IR& ir, const Lexer::OperationNode* swizNode, IR:: eval.vec[0] = opt->vec[SwizzleCompIdx(str[0])]; eval.vec[1] = opt->vec[SwizzleCompIdx(str[1])]; eval.vec[2] = opt->vec[SwizzleCompIdx(str[2])]; - eval.vec[3] = 0.0; + eval.vec[3] = 1.0; break; case 4: eval.vec[0] = opt->vec[SwizzleCompIdx(str[0])]; diff --git a/hecl/lib/Frontend/expr/CExprAdd.hpp b/hecl/lib/Frontend/expr/CExprAdd.hpp deleted file mode 100644 index 92eb36beb..000000000 --- a/hecl/lib/Frontend/expr/CExprAdd.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CEXPRADD_HPP -#define CEXPRADD_HPP - -#endif // CEXPRADD_HPP diff --git a/hecl/lib/Frontend/expr/CExprBase.hpp b/hecl/lib/Frontend/expr/CExprBase.hpp deleted file mode 100644 index 0a0f1d2ba..000000000 --- a/hecl/lib/Frontend/expr/CExprBase.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CEXPRBASE_HPP -#define CEXPRBASE_HPP - -#endif // CEXPRBASE_HPP diff --git a/hecl/lib/Frontend/expr/CExprCall.hpp b/hecl/lib/Frontend/expr/CExprCall.hpp deleted file mode 100644 index 83d449807..000000000 --- a/hecl/lib/Frontend/expr/CExprCall.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CEXPRCALL_HPP -#define CEXPRCALL_HPP - -#endif // CEXPRCALL_HPP diff --git a/hecl/lib/Frontend/expr/CExprGroup.hpp b/hecl/lib/Frontend/expr/CExprGroup.hpp deleted file mode 100644 index dabec847e..000000000 --- a/hecl/lib/Frontend/expr/CExprGroup.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CEXPRGROUP_HPP -#define CEXPRGROUP_HPP - -#endif // CEXPRGROUP_HPP diff --git a/hecl/lib/Frontend/expr/CExprLighting.hpp b/hecl/lib/Frontend/expr/CExprLighting.hpp deleted file mode 100644 index 8d1c355d9..000000000 --- a/hecl/lib/Frontend/expr/CExprLighting.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CEXPRLIGHTING_HPP -#define CEXPRLIGHTING_HPP - -#endif // CEXPRLIGHTING_HPP diff --git a/hecl/lib/Frontend/expr/CExprMul.hpp b/hecl/lib/Frontend/expr/CExprMul.hpp deleted file mode 100644 index 5a10c917f..000000000 --- a/hecl/lib/Frontend/expr/CExprMul.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CEXPRMUL_HPP -#define CEXPRMUL_HPP - -#endif // CEXPRMUL_HPP diff --git a/hecl/lib/Frontend/expr/CExprRoot.hpp b/hecl/lib/Frontend/expr/CExprRoot.hpp deleted file mode 100644 index e052e26b2..000000000 --- a/hecl/lib/Frontend/expr/CExprRoot.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CEXPRROOT_HPP -#define CEXPRROOT_HPP - -#endif // CEXPRROOT_HPP diff --git a/hecl/lib/Frontend/expr/CExprSub.hpp b/hecl/lib/Frontend/expr/CExprSub.hpp deleted file mode 100644 index 22f350b20..000000000 --- a/hecl/lib/Frontend/expr/CExprSub.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CEXPRSUB_HPP -#define CEXPRSUB_HPP - -#endif // CEXPRSUB_HPP diff --git a/hecl/lib/Frontend/expr/CExprTexture.hpp b/hecl/lib/Frontend/expr/CExprTexture.hpp deleted file mode 100644 index 06c286c66..000000000 --- a/hecl/lib/Frontend/expr/CExprTexture.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CEXPRTEXTURE_HPP -#define CEXPRTEXTURE_HPP - -#endif // CEXPRTEXTURE_HPP diff --git a/hecl/lib/Frontend/expr/CExprTextureGather.hpp b/hecl/lib/Frontend/expr/CExprTextureGather.hpp deleted file mode 100644 index 7ae870676..000000000 --- a/hecl/lib/Frontend/expr/CExprTextureGather.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CEXPRTEXTUREGATHER_HPP -#define CEXPRTEXTUREGATHER_HPP - -#endif // CEXPRTEXTUREGATHER_HPP diff --git a/hecl/lib/Frontend/expr/expr.hpp b/hecl/lib/Frontend/expr/expr.hpp deleted file mode 100644 index 55d08b8ae..000000000 --- a/hecl/lib/Frontend/expr/expr.hpp +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef EXPR_HPP -#define EXPR_HPP - -#include "CExprBase.hpp" -#include "CExprRoot.hpp" -#include "CExprCall.hpp" -#include "CExprGroup.hpp" -#include "CExprMul.hpp" -#include "CExprAdd.hpp" -#include "CExprSub.hpp" -#include "CExprTexture.hpp" -#include "CExprTextureGather.hpp" -#include "CExprLighting.hpp" - -#endif // EXPR_HPP