From 3e34d0eddc120b2341b053d9e5d9eb7b6a5519e6 Mon Sep 17 00:00:00 2001 From: Garux Date: Mon, 29 Jan 2024 17:12:08 +0600 Subject: [PATCH] fix LIGHT_SHADER_DEBUG --- radiant/renderstate.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/radiant/renderstate.cpp b/radiant/renderstate.cpp index 4b99f926..b5f05a33 100644 --- a/radiant/renderstate.cpp +++ b/radiant/renderstate.cpp @@ -598,7 +598,7 @@ class CountLights { std::size_t m_count; public: - typedef RendererLight& first_argument_type; + typedef const RendererLight& first_argument_type; CountLights() : m_count( 0 ){ } @@ -1160,9 +1160,7 @@ void ShaderCache_Construct(){ StringOutputStream buffer( 256 ); for ( std::size_t i = 0; i < 256; ++i ) { - buffer << '(' << g_DebugShaderColours[i].x() << ' ' << g_DebugShaderColours[i].y() << ' ' << g_DebugShaderColours[i].z() << ')'; - g_lightDebugShaders.push_back( g_ShaderCache->capture( buffer ) ); - buffer.clear(); + g_lightDebugShaders.push_back( g_ShaderCache->capture( buffer( '(', g_DebugShaderColours[i].x(), ' ', g_DebugShaderColours[i].y(), ' ', g_DebugShaderColours[i].z(), ')' ) ) ); } #endif } @@ -1179,8 +1177,7 @@ void ShaderCache_Destroy(){ StringOutputStream buffer( 256 ); for ( std::size_t i = 0; i < 256; ++i ) { - buffer << '(' << g_DebugShaderColours[i].x() << ' ' << g_DebugShaderColours[i].y() << ' ' << g_DebugShaderColours[i].z() << ')'; - g_ShaderCache->release( buffer ); + g_ShaderCache->release( buffer( '(', g_DebugShaderColours[i].x(), ' ', g_DebugShaderColours[i].y(), ' ', g_DebugShaderColours[i].z(), ')' ) ); } #endif }