yum-mirror/glslang

git clone https://git.yummers.dev/yum-mirror/glslang

Shaochi Zhou(AMD)Implement extension GL_EXT_descriptor_heap.c8d3e066

main
986 B35 linesraw
1#version 460 core
2
3#extension GL_EXT_descriptor_heap : enable
4#extension GL_EXT_nonuniform_qualifier : enable
5
6// Sampler array aliased to the sampler heap
7uniform sampler heapSampler[];
8
9// Different image arrays aliased to the image heap
10uniform texture2D heapTexture2D[];
11uniform texture3D heapTexture3D[];
12
13// Different buffer arrays aliased to the buffer heap
14buffer StorageBufferA {
15    vec4 a;
16} heapStorageBufferA[];
17buffer StorageBufferB {
18    vec3 b;
19} heapStorageBufferB[];
20uniform UniformBuffer {
21    vec4 colorOffset;
22} heapUniformBuffer[];
23
24layout (location = 0) in vec2 uvs;
25layout (location = 1) flat in uint index;
26
27layout (location = 0) out vec4 fragColor;
28
29void main()
30{
31    fragColor = texture(sampler2D(heapTexture2D[27], heapSampler[0]), uvs);
32    fragColor += heapUniformBuffer[nonuniformEXT(index)].colorOffset;
33    heapStorageBufferA[1].a = vec4(1, 2, 3, 4);
34    fragColor.x += heapStorageBufferB[nonuniformEXT(index)].b.x;
35}