yum-mirror/glslang

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

Wooyoung KimAdd the GLSL_QCOM_tile_shading support10ae0e16

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