Allowing use of const static variables in library exports#3780
Allowing use of const static variables in library exports#3780tex3d merged 1 commit intomicrosoft:masterfrom
Conversation
|
The comment reads: // Read/write to global static resource is disallowed for libraries: It appears to be a problem related to read and write of global static variables. I propose that if a global static variable is marked as read only (const), the above concerns do not apply. |
We're currently in the process of converting already existing shader assets to raytracing equivalent versions. While doing so we run in to the following compile error when using global static variables in our library export: "static global resource use is disallowed in library exports."
shadercode:
While there is an explanation for why the use of global static variables is disallowed in DxilPromoteResourcePasses.cpp it remains unclear if const variables are disallowed by design, or if we can loosen the restrictions a bit to let global static const variables through?
Note: changing from global static to preprocessor defines would work for the problem at hand, but it's a non trivial task given the amount of already existing assets in the engine.