diff --git a/test/gl/shaders/shader_test.compute.tzsl b/test/gl/shaders/shader_test.compute.tzsl index 1b811d15a9..ae45a6e0f7 100644 --- a/test/gl/shaders/shader_test.compute.tzsl +++ b/test/gl/shaders/shader_test.compute.tzsl @@ -46,12 +46,12 @@ void math_tests() tz::debug::assert(tz::math::clamp(2.5f, 1.0f, 2.0f) == 2.0f); tz::debug::assert(tz::math::distance(vec2(0.0f, 0.0f), vec2(0.0f, 0.0f)) == 0.0f); - tz::debug::assert(tz::math::dot(vec2(2.0f, 0.0f), vec2(2.0f, 0.0f)) == 2.0f); + tz::debug::assert(tz::math::dot(vec2(2.0f, 0.0f), vec2(2.0f, 0.0f)) == 4.0f); tz::debug::assert(tz::math::ln(tz::math::exp(2.0f)) == 2.0f); tz::debug::assert(tz::math::log(tz::math::exp2(2.0f)) == 2.0f); - tz::debug::assert(tz::math::sqrt(3.0f) == (1.0f / tz::math::inverse_sqrt(3.0f))); + tz::debug::assert(tz::math::inverse_sqrt(3.0f) == (1.0f / tz::math::sqrt(3.0f))); tz::debug::assert(!tz::math::is_infinity(1.0f)); tz::debug::assert(!tz::math::is_nan(1.0f)); diff --git a/tools/tzslc/shaders/debug.tzsl b/tools/tzslc/shaders/debug.tzsl index 4663da0ffa..7b6ccd417d 100644 --- a/tools/tzslc/shaders/debug.tzsl +++ b/tools/tzslc/shaders/debug.tzsl @@ -47,7 +47,7 @@ #if TZ_VULKAN && TZ_DEBUG // tz::debug::printf(...) implemented via compiler magic. Assume it's here. - #define tz::debug::assert(expr) debugPrintfEXT("TZ_GPUASSERT(%d,%d): Assert failure on line %d.", expr, TZ_SHADER_STAGE, __LINE__ + 1) + #define tz::debug::assert(expr) if(!(expr)){debugPrintfEXT("TZ_GPUASSERT(0,%d): Assert failure on line %d.", TZ_SHADER_STAGE, __LINE__ + 1);} #else #define debugPrintfEXT // #define tz::debug::assert //