From 023622cc8b6e2533b0a1ede89d729ca5b0a47da2 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 10 Aug 2020 15:52:32 -0400 Subject: Glslang texel offset bug fix (#1485) * Fix the minProgramTexelOffset should be -. * Improve comments. --- source/slang-glslang/slang-glslang.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/slang-glslang/slang-glslang.cpp b/source/slang-glslang/slang-glslang.cpp index 02d5a8459..1c756cb6c 100644 --- a/source/slang-glslang/slang-glslang.cpp +++ b/source/slang-glslang/slang-glslang.cpp @@ -44,7 +44,8 @@ static TBuiltInResource _calcBuiltinResources() { // NOTE! This is a bit of a hack - to set all the fields to true/UNLIMITED. - + // Care must be taken if new variables are introduced, the default may not be appropriate. + // We are relying on limits being after the other fields. SLANG_COMPILE_TIME_ASSERT(SLANG_OFFSET_OF(TBuiltInResource, limits) > 0); // We are relying on maxLights being the first parameter, and all values will have the same type @@ -61,6 +62,10 @@ static TBuiltInResource _calcBuiltinResources() dst[i] = UNLIMITED; } } + + // In the sea of variables there is a min value + resource.minProgramTexelOffset = -UNLIMITED; + // Set up the bools { TLimits* limits = &resource.limits; -- cgit v1.2.3