yum-mirror/glslang

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

Wooyoung KimAdd the GLSL_QCOM_tile_shading support10ae0e16

main
1.4 KiB38 linesraw
1#version 460
2#extension GL_QCOM_tile_shading : enable 
3
4layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
5
6layout (set=0, binding=0, tile_attachmentQCOM, rgba32f) uniform highp image2D input0;
7
8// tile color attachments (new syntax)
9layout (set=0, binding=1, tile_attachmentQCOM, rgba32f) uniform highp image2D  color0; // attachment0
10layout (set=0, binding=2, tile_attachmentQCOM, rgba32i) uniform highp iimage2D color1; // attachment1
11
12
13// depth/stencil attachments
14layout (set=0, binding=3, tile_attachmentQCOM, rgba32f) uniform highp image2D  depth;
15layout (set=0, binding=4, tile_attachmentQCOM, rgba32ui) uniform highp uimage2D stencil;
16
17void main ()
18{
19  uvec2 uoffset = clamp(gl_GlobalInvocationID.xy, gl_TileOffsetQCOM, gl_TileOffsetQCOM + gl_TileDimensionQCOM.xy - uvec2(1.1));
20  ivec2 offset = ivec2(uoffset);
21
22  // read from attachments 
23  vec4  colorA   = imageLoad( color0, offset );
24  ivec4 icolorB  = imageLoad( color1, offset );
25  vec4  colorC   = imageLoad( input0, offset );
26  float d        = imageLoad( depth, offset ).x;
27  uint  s        = imageLoad( stencil, offset ).x;
28  
29  // compute output values
30  vec4 outColor   = ( colorA + vec4(icolorB) + colorC ) * 0.33f;
31  float outDepth  = d * 2.0f;
32  uint outStencil = s + uint(1);
33  
34  // write to attachments
35  imageStore( color0,  offset, outColor );
36  imageStore( depth,   offset, vec4(outDepth) );
37  imageStore( stencil, offset, uvec4(outStencil) );
38}