Skip to content

Commit f3b036b

Browse files
committed
rgl: Turn off shader optimizations in debug mode.
1 parent c47d03f commit f3b036b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Layers/xrRenderPC_GL/rgl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,11 @@ HRESULT CRender::shader_compile(
885885
string256 name_comment;
886886
sprintf_s(name_comment, "// %s\n", name);
887887
const char** sources = xr_alloc<const char*>(sources_len);
888+
#ifdef DEBUG
889+
sources[0] = "#version 410\n#pragma optimize (off)\n";
890+
#else
888891
sources[0] = "#version 410\n";
892+
#endif
889893
sources[1] = name_comment;
890894
memcpy(sources + 2, defines, def_len * sizeof(char*));
891895
memcpy(sources + def_len + 2, source.data(), source.size() * sizeof(char*));

0 commit comments

Comments
 (0)