yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
10ae0e16
main
1#version 310 es 2#extension GL_QCOM_tile_shading : enable 3 4layout ( local_size_x = 16 , local_size_y = 16 , local_size_z = 1 ) in ; 5layout ( shading_rate_xQCOM = 2 , shading_rate_yQCOM = 2 , shading_rate_zQCOM = 3 ) in ; 6 7layout ( set = 0 , binding = 0 , tile_attachmentQCOM , rgba32f ) uniform readonly highp image2D input0 ; 8layout ( set = 0 , binding = 1 , tile_attachmentQCOM , rgba32f ) uniform readonly highp image2D color0 ; // attachment0 9layout ( set = 0 , binding = 2 , tile_attachmentQCOM , rgba32i ) uniform writeonly highp iimage2D color1 ; // attachment1 10 11// depth/stencil attachments 12layout ( set = 0 , binding = 3 , tile_attachmentQCOM , rgba32f ) uniform readonly highp image2D depth ; 13layout ( set = 0 , binding = 4 , tile_attachmentQCOM , rgba32ui ) uniform writeonly highp uimage2D stencil ; 14 15void main () 16{ 17uvec2 uoffset = clamp ( gl_GlobalInvocationID . xy , gl_TileOffsetQCOM , gl_TileOffsetQCOM + gl_TileDimensionQCOM . xy - uvec2 ( 1.1 )) ; 18ivec2 offset = ivec2 ( uoffset ) ; 19 20// read from attachments 21vec4 colorA = imageLoad ( color0 , offset ) ; 22vec4 colorC = imageLoad ( input0 , offset ) ; 23float d = imageLoad ( depth , offset ) . x ; 24uint s = uint ( 2 ) ; 25 26// compute output values 27vec4 outColor = ( colorA + vec4 ( 1.0f ) + colorC ) * 0.33f ; 28float outDepth = d * 2.0f ; 29uint outStencil = s + uint ( 1 ) ; 30 31// write to attachments 32imageStore ( color1 , offset , ivec4 ( outColor ) ) ; 33imageStore ( stencil , offset , uvec4 ( outStencil ) ) ; 34}