From 13e61006818199bd11c1f6f0148d1258d8200375 Mon Sep 17 00:00:00 2001 From: "C.Even" Date: Tue, 20 Jul 2021 08:06:56 -0500 Subject: [PATCH] Fix shaderc consistency (#2553) * shaderc: Initialize 'texFormat' in uniform. * glsl-optimizer: Fix consistency error of 'print_float' --- 3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp | 2 +- tools/shaderc/shaderc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp index 3a0d23ae6..dcd7f3745 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp @@ -1344,7 +1344,7 @@ void print_float (string_buffer& buffer, float f) // that so compiler output matches. if (posE != NULL) { - if((posE[1] == '+' || posE[1] == '-') && posE[2] == '0') + if((posE[1] == '+' || posE[1] == '-') && posE[2] == '0' && posE[3] == '0') { char* p = posE+2; while (p[0]) diff --git a/tools/shaderc/shaderc.h b/tools/shaderc/shaderc.h index 789128005..46672548f 100644 --- a/tools/shaderc/shaderc.h +++ b/tools/shaderc/shaderc.h @@ -91,6 +91,7 @@ namespace bgfx , regCount(0) , texComponent(0) , texDimension(0) + , texFormat(0) { }