summaryrefslogtreecommitdiffstats
path: root/source/slang/syntax.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2019-01-16 08:16:53 -0800
committerGitHub <noreply@github.com>2019-01-16 08:16:53 -0800
commitf0633a7d0b1615f6b115d53763bedeeb857b7f3c (patch)
treef3871140fdafe54dfcc412df6a828840c890f17f /source/slang/syntax.cpp
parent29ffac963e9c4b02d3cbc9d4b281512ed820e67d (diff)
Add proper IR codegen support for local static const variables (#779)
Previously the IR codegen logic was treating function-scope `static const` variables just like `static` variables, which results in them generating less efficient output HLSL/GLSL. This change special-cases function-local `static const` variables with logic that mirrors how we handle global-scope `static const` variables. The approach in this change attempts to find a simpler solution to deal with `static const` variables inside of generic functions than what is currently done for `static` variables in generic functions, but I haven't tested whether that works in practice, so I didn't apply the same approach to the plain `static` case. That would make a good follow-on change. I've included a single test case to demonstrate that with this fix the Slang compiler generates output DXBC that uses an indexable "immediate" constant buffer, whereas without the fix it generates an array in local memory (slow).
Diffstat (limited to 'source/slang/syntax.cpp')
0 files changed, 0 insertions, 0 deletions