google / google/shaderc

GLSL file with `#version 460` gets compiled as GLSL450

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

I'm compiling at runtime using the shaderc library from the Vulkan SDK (1.2.189.2 in my case). I compile a shader with `#version 460` with these options:
```glsl
#version 460
#extension GL_GOOGLE_include_directive : enable
#extension GL_EXT_ray_tracing : enable
#extension GL_EXT_nonuniform_qualifier : enable
#extension GL_EXT_scalar_block_layout : enable
#extension GL_EXT_buffer_reference2 : require
...
```
```cpp
std::unique_ptr includer(new FileIncluder());
options.SetIncluder(std::move(includer));
options.SetOptimizationLevel(shaderc_optimization_level_performance);
options.SetTargetSpirv(shaderc_spirv_version_1_5);
options.SetTargetEnvironment(shaderc_target_env_vulkan, shaderc_env_version_vulkan_1_2);
```
However, through NSight I can see that in the SPIR-V assembly I get GLSL450, which for what I am doing (Vulkan Ray-Tracing) is not supported through NSight (see screenshot).
```spirv
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel PhysicalStorageBuffer64 GLSL450
```
![image](https://user-images.githubusercontent.com/43609023/138569262-8a5c3ac2-2b27-4243-92ad-42d3224211d7.png)

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.