shaderc
shaderc copied to clipboard
shaderc::PreprocessGlsl removes defines from the shader
I've got this code in my shader:
#define float highp float
#define float2 highp vec2
#define float3 highp vec3
#define float4 highp vec4
#define float2x2 highp mat2
#define float3x3 highp mat3
#define float4x4 highp mat4
#define half mediump float
#define half2 mediump vec2
#define half3 mediump vec3
#define half4 mediump vec4
#define half2x2 mediump mat2
#define half3x3 mediump mat3
#define half4x4 mediump mat4
and when I use shaderc::PreprocessGlsl
function, shaderc::PreprocessedSourceCompilationResult::begin()
gives the preprocessed shader but defines are deleted. Is there a way to keep these defines?
I don't want to use shaderc::CompileOptions::AddMacroDefinition()
function.
It's doing the same thing gcc -E
would do. the #defines disappear.