yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
4c78efd0c
master
1//TEST_IGNORE_FILE: 2#version 450 3layout (row_major )uniform ; 4layout (row_major )buffer ; 5#extension GL_EXT_shader_16bit_storage : require 6#extension GL_EXT_shader_explicit_arithmetic_types : require 7 8layout (r16f ) 9layout (binding = 1 ) 10uniform image2D halfTexture_0 ; 11 12layout (rg16f ) 13layout (binding = 2 ) 14uniform image2D halfTexture2_0 ; 15 16layout (rgba16f ) 17layout (binding = 3 ) 18uniform image2D halfTexture4_0 ; 19 20layout (std430 ,binding = 0 )buffer StructuredBuffer_int_t_0 { 21int _data []; 22}outputBuffer_0 ; 23 24layout (local_size_x = 4 ,local_size_y = 4 ,local_size_z = 1 )in ; 25void main () 26{ 27ivec2 pos_0 = ivec2 (gl_GlobalInvocationID .xy ); 28 29int _S1 = pos_0 .y ; 30 31int _S2 = pos_0 .x ; 32 33ivec2 _S3 = ivec2 (uvec2 (ivec2 (3 - _S1 ,3 - _S2 ))); 34 35float16_t _S4 = (float16_t (imageLoad ((halfTexture_0 ), (_S3 )).x )); 36f16vec2 _S5 = (f16vec2 (imageLoad ((halfTexture2_0 ), (_S3 )).xy )); 37f16vec4 _S6 = (f16vec4 (imageLoad ((halfTexture4_0 ), (_S3 )))); 38 39ivec2 _S7 = ivec2 (uvec2 (pos_0 )); 40 41imageStore ((halfTexture_0 ), (_S7 ),f16vec4 (_S5 .x + _S5 .y ,float16_t (0 ),float16_t (0 ),float16_t (0 ))); 42imageStore ((halfTexture2_0 ), (_S7 ),f16vec4 (_S6 .xy ,float16_t (0 ),float16_t (0 ))); 43imageStore ((halfTexture4_0 ), (_S7 ),f16vec4 (_S5 ,_S4 ,_S4 )); 44 45int index_0 = _S2 + _S1 * 4 ; 46outputBuffer_0 ._data [uint (index_0 )]= index_0 ; 47return ; 48}