Skip to content

Instantly share code, notes, and snippets.

@Groovounet
Created January 27, 2018 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Groovounet/d24a3f3a0091a2ea6eca11b65ae25071 to your computer and use it in GitHub Desktop.
Save Groovounet/d24a3f3a0091a2ea6eca11b65ae25071 to your computer and use it in GitHub Desktop.
#version 430 core
vec4 gammaSrgbToRgb(in vec4 ColorSRGB)
{
return vec4(pow(ColorSRGB.rgb, vec3(2.2)), ColorSRGB.a);
}
layout(binding = 0) uniform bufferFetch
{
vec4 Color;
} Buffer;
layout(location = 0, index = 0) out vec4 Color;
void main()
{
Color = gammaSrgbToRgb(Buffer.Color);
}
1 | 0 | | label_basic_block_1: s_mov_b32 s0, s1
2 | 0 | | s_movk_i32 s1, 0x0000
3 | 0 | | s_load_dwordx4 s[4:7], s[0:1], 0x140
4 | 0 | | s_waitcnt lgkmcnt(0)
5 | 0 | | s_andn2_b32 s5, s5, 0x3fff0000
6 | 0 | | s_buffer_load_dword s2, s[4:7], 0x00
7 | 0 | | s_waitcnt lgkmcnt(0)
8 | 0 | | s_lshl_b32 s2, s2, 4
9 | 0 | | s_load_dwordx4 s[0:3], s[0:1], s2
10 | 0 | | s_waitcnt lgkmcnt(0)
11 | 0 | | s_andn2_b32 s1, s1, 0x3fff0000
12 | 0 | | s_buffer_load_dwordx4 s[0:3], s[0:3], 0x00
13 | 0 | | s_waitcnt lgkmcnt(0)
14 | 1 | ^ | v_log_f32 v0, abs(s0)
15 | 1 | x | v_mul_legacy_f32 v0, 0x400ccccd, v0
16 | 1 | x | v_exp_f32 v0, v0
17 | 2 | :^ | v_log_f32 v1, abs(s1)
18 | 2 | :x | v_mul_legacy_f32 v1, 0x400ccccd, v1
19 | 2 | :x | v_exp_f32 v1, v1
20 | 3 | ::^ | v_log_f32 v2, abs(s2)
21 | 3 | ::x | v_mul_legacy_f32 v2, 0x400ccccd, v2
22 | 3 | ::x | v_exp_f32 v2, v2
23 | 4 | :::^ | v_mov_b32 v3, s3
24 | 4 | xv:: | v_cvt_pkrtz_f16_f32 v0, v0, v1
25 | 4 | :^vv | v_cvt_pkrtz_f16_f32 v1, v2, v3
26 | 2 | vv | exp mrt0, v0, v0, v1, v1
27 | 0 | | s_endpgm
Maximum # VGPR used 4, # VGPR allocated: 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment