google / google/shaderc

shaderc::PreprocessGlsl removes defines from the shader

Open
#1,357 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.2k
Forks
445
Avg merge
11h 6m
Merged PRs (30d)
6

Description

I've got this code in my shader:

```glsl
#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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.