Syntax coloring for C++ snippets in README.md
This commit is contained in:
parent
ea6bdacd05
commit
bc6011b512
10
README.md
10
README.md
@ -45,7 +45,7 @@ For more in-depth documentation than what's provided in this README, please have
|
||||
To perform reflection and convert to other shader languages you can use the SPIRV-Cross API.
|
||||
For example:
|
||||
|
||||
```
|
||||
```c++
|
||||
#include "spirv_glsl.hpp"
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
@ -150,7 +150,7 @@ Likely cause: If this SPIR-V was created from glslang HLSL, make sure the entry
|
||||
|
||||
HLSL relies on semantics in order to effectively link together shader stages. In the SPIR-V generated by glslang, the transformation from HLSL to GLSL ends up looking like
|
||||
|
||||
```
|
||||
```c++
|
||||
struct VSOutput {
|
||||
// SV_Position is rerouted to gl_Position
|
||||
float4 position : SV_Position;
|
||||
@ -190,7 +190,7 @@ This is not supported in legacy GL/GLES targets, so to support this, varying str
|
||||
This is done automatically, but the API user might need to be aware that this is happening in order to support all cases.
|
||||
|
||||
Modern GLES code like this:
|
||||
```
|
||||
```c++
|
||||
struct Output {
|
||||
vec4 a;
|
||||
vec2 b;
|
||||
@ -199,7 +199,7 @@ out Output vout;
|
||||
```
|
||||
|
||||
Is transformed into:
|
||||
```
|
||||
```c++
|
||||
struct Output {
|
||||
vec4 a;
|
||||
vec2 b;
|
||||
@ -216,7 +216,7 @@ API users might want to ensure that both the struct names and member names match
|
||||
|
||||
Another thing you need to remember is when using samplers and textures in HLSL these are separable, and not directly compatible with GLSL. If you need to use this with desktop GL/GLES, you need to call `Compiler::build_combined_image_samplers` first before calling `Compiler::compile`, or you will get an exception.
|
||||
|
||||
```
|
||||
```c++
|
||||
// From main.cpp
|
||||
// Builds a mapping for all combinations of images and samplers.
|
||||
compiler->build_combined_image_samplers();
|
||||
|
Loading…
Reference in New Issue
Block a user