From d5450a7d88c3cab9931cf14720dc286cb9ea288d Mon Sep 17 00:00:00 2001 From: Mads Buvik Sandvei Date: Sat, 3 Oct 2020 14:22:34 +0200 Subject: [PATCH] Correctly resetting line numbering during shader processing. --- apps/openmw_test_suite/shader/shadermanager.cpp | 2 +- components/shader/shadermanager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw_test_suite/shader/shadermanager.cpp b/apps/openmw_test_suite/shader/shadermanager.cpp index e823d5fe2..a25e5e9ba 100644 --- a/apps/openmw_test_suite/shader/shadermanager.cpp +++ b/apps/openmw_test_suite/shader/shadermanager.cpp @@ -92,7 +92,7 @@ namespace "\n" "void bar() { foo() }\n" "\n" - "#line 2 0\n" + "#line 1 0\n" "\n" "void main() { bar() }\n"; EXPECT_EQ(shader->getShaderSource(), expected); diff --git a/components/shader/shadermanager.cpp b/components/shader/shadermanager.cpp index 8523a2962..bfaa11282 100644 --- a/components/shader/shadermanager.cpp +++ b/components/shader/shadermanager.cpp @@ -106,7 +106,7 @@ namespace Shader else { lineDirectivePosition = 0; - lineNumber = 1; + lineNumber = 0; } lineNumber += std::count(source.begin() + lineDirectivePosition, source.begin() + foundPos, '\n');