yum-mirror/glslang

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

Wooyoung KimAdd the GLSL_QCOM_tile_shading support10ae0e16

main
1.5 KiB42 linesraw
1#version 460
2#extension GL_QCOM_tile_shading : enable 
3
4precision highp int;
5precision highp float;
6
7layout (set=0, binding=0, tile_attachmentQCOM, rgba32f) uniform highp image2D input0;
8layout (set=0, binding=1, tile_attachmentQCOM, rgba32f) uniform highp image2D  color0;
9layout (set=0, binding=2, tile_attachmentQCOM, rgba32i) uniform highp iimage2D color1;
10
11// depth/stencil attachments
12layout (set=0, binding=3, tile_attachmentQCOM, rgba32f) uniform highp image2D  depth;
13layout (set=0, binding=4, tile_attachmentQCOM, rgba32ui) uniform highp uimage2D stencil;
14
15layout (location=0) out vec4 fragColor; 
16
17void main() 
18{ 
19    // integer coordinates of the center of tile.
20    uvec2 o2     = uvec2(8, 4);
21          o2     = o2 / uvec2(2);
22    ivec2 offset = ivec2(gl_TileOffsetQCOM + (gl_TileDimensionQCOM/uvec3(2)).xy);
23
24    // read from attachments 
25    vec4  colorA   = imageLoad( color0, offset );
26    ivec4 icolorB  = imageLoad( color1, offset );
27    vec4  colorB   = vec4(icolorB);
28    vec4  colorC   = imageLoad( input0, offset );
29    float d        = imageLoad( depth, offset ).x;
30    uint  s        = imageLoad( stencil, offset ).x;
31 
32    // compute output value
33    vec4 outColor  = ( colorB + colorB + colorC + d + s );
34  
35    // write to attachments
36    imageStore( color0,  offset, outColor );
37    imageStore( depth,   offset, vec4(outColor) );
38    imageStore( stencil, offset, uvec4(outColor) );
39  
40    // write to color attachment 0 via fragment output 
41    fragColor = outColor + vec4(1.0, 0.0, 0.0, 1.0); 
42}