google / google/shaderc

bug: glslc -E does not escape newlines in string literals

Open
#1,509 0 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

Pretty straight forward to explain. preprocessing with `glslc -E` does not escape newlines in string literals when re-printing the string literal. This results in string literals breaking the source if they're used.

Minimal reproducible example:
```
~> cat shader.glsl
#version 450
#extension GL_EXT_debug_printf : enable

int main(){
debugPrintf("with Newline\n");
}

~> glslc -E shader.glsl
#version 450
#extension GL_EXT_debug_printf : enable

int main() {
debugPrintf("with Newline
");
}

~> glslc --version
shaderc v2023.8 v2025.3
spirv-tools v2025.3 v2022.4-833-g33e02568
glslang 11.1.0-1253-gefd24d75

Target: SPIR-V 1.0
```

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.