Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shaderc::PreprocessGlsl removes defines from the shader #1357

Open
SC5Shout opened this issue Aug 2, 2023 · 1 comment
Open

shaderc::PreprocessGlsl removes defines from the shader #1357

SC5Shout opened this issue Aug 2, 2023 · 1 comment

Comments

@SC5Shout
Copy link

SC5Shout commented Aug 2, 2023

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.

@dneto0
Copy link
Collaborator

dneto0 commented Aug 8, 2023

It's doing the same thing gcc -E would do. the #defines disappear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants