Fix resource register macro expansion (#2747)

The preprocessor library (fcpp) has issues with ## and doesn't expand
properly. We can work around that by using the [reg] syntax which is
supported for all shader targets that internally use HLSL through glslang.
This commit is contained in:
pezcode 2022-03-23 04:47:29 +01:00 committed by GitHub
parent 3cc0de3335
commit d7a8e50d26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,7 @@
// To be able to patch the uav registers on the DXBC SPDB Chunk (D3D11 renderer) the whitespaces around
// '_type[_reg]' are necessary. This only affects shaders with debug info (i.e., those that have the SPDB Chunk).
# if BGFX_SHADER_LANGUAGE_HLSL > 400
# if BGFX_SHADER_LANGUAGE_HLSL > 400 || BGFX_SHADER_LANGUAGE_PSSL || BGFX_SHADER_LANGUAGE_SPIRV || BGFX_SHADER_LANGUAGE_METAL
# define REGISTER(_type, _reg) register( _type[_reg] )
# else
# define REGISTER(_type, _reg) register(_type ## _reg)