From f35285b0769a1566f08b76c67418fa2cd5369a1a Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Mon, 28 Jan 2019 22:25:51 -1000 Subject: [PATCH] Windows fixes --- hecl/extern/athena | 2 +- hecl/include/hecl/Backend/ProgrammableCommon.hpp | 2 +- hecl/lib/Backend/HLSL.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hecl/extern/athena b/hecl/extern/athena index 1014a3ccd..af7d73f9b 160000 --- a/hecl/extern/athena +++ b/hecl/extern/athena @@ -1 +1 @@ -Subproject commit 1014a3ccdab4e312952a4a5f1fd7151b3c9f8970 +Subproject commit af7d73f9bd5815a8896f1611e4eb457369010f69 diff --git a/hecl/include/hecl/Backend/ProgrammableCommon.hpp b/hecl/include/hecl/Backend/ProgrammableCommon.hpp index 10bf05a4e..2f2cd1767 100644 --- a/hecl/include/hecl/Backend/ProgrammableCommon.hpp +++ b/hecl/include/hecl/Backend/ProgrammableCommon.hpp @@ -68,7 +68,7 @@ private: virtual std::string EmitVec3(const atVec4f& vec) const = 0; virtual std::string EmitVec3(const std::string& a, const std::string& b, const std::string& c) const = 0; - std::string EmitVal(float val) const { return hecl::Format("%g", val); } + std::string EmitVal(float val) const { return hecl::Format("%f", val); } std::string EmitAdd(const std::string& a, const std::string& b) const { return '(' + a + '+' + b + ')'; } diff --git a/hecl/lib/Backend/HLSL.cpp b/hecl/lib/Backend/HLSL.cpp index 1b6ac0e47..f15453e8a 100644 --- a/hecl/lib/Backend/HLSL.cpp +++ b/hecl/lib/Backend/HLSL.cpp @@ -163,9 +163,9 @@ std::string HLSL::makeVert(unsigned col, unsigned uv, unsigned w, unsigned s, si " float4 objNorm = float4(0.0,0.0,0.0,0.0);\n"; for (size_t i = 0; i < s; ++i) retval += hecl::Format( - " objPos += mul(mv[%" PRISize "], float4(v.posIn, 1.0)) * v.weightIn[%" PRISize "][%" PRISize + " objPos += mul(objs[%" PRISize "], float4(v.posIn, 1.0)) * v.weightIn[%" PRISize "][%" PRISize "];\n" - " objNorm += mul(mvInv[%" PRISize "], float4(v.normIn, 1.0)) * v.weightIn[%" PRISize "][%" PRISize "];\n", + " objNorm += mul(objsInv[%" PRISize "], float4(v.normIn, 1.0)) * v.weightIn[%" PRISize "][%" PRISize "];\n", i, i / 4, i % 4, i, i / 4, i % 4); retval += " objPos[3] = 1.0;\n" @@ -176,11 +176,11 @@ std::string HLSL::makeVert(unsigned col, unsigned uv, unsigned w, unsigned s, si } else { /* non-skinned */ retval += - " float4 objPos = float4(posIn, 1.0);\n" - " float4 objNorm = float4(normIn, 0.0);\n" + " float4 objPos = float4(v.posIn, 1.0);\n" + " float4 objNorm = float4(v.normIn, 0.0);\n" " vtf.mvPos = mul(mv, objPos);\n" " vtf.mvNorm = mul(mvInv, objNorm);\n" - " gl_Position = mul(proj, vtf.mvPos);\n"; + " vtf.mvpPos = mul(proj, vtf.mvPos);\n"; } retval += " float4 tmpProj;\n";