Skip to content

Instantly share code, notes, and snippets.

Avatar

Christophe Groovounet

View GitHub Profile
@Groovounet
Groovounet / gist:01aa31a61ea81f9f3009a9e5ec7cddb1
Created Feb 14, 2018
Independent texture fetches with ASM
View gist:01aa31a61ea81f9f3009a9e5ec7cddb1
#version 430 core
#define FETCH_COUNT 16
#define FRAG_COLOR 0
#define NORMALIZE_COORD float(1.0 / 2048.0)
layout(binding = 0) uniform sampler2D Texture[FETCH_COUNT];
@Groovounet
Groovounet / gist:eee06640917a027cb7e8a041ce919cd2
Last active Feb 14, 2018
Dependent texture fetches with Polaris 10 ASM
View gist:eee06640917a027cb7e8a041ce919cd2
#version 430 core
#define FETCH_COUNT 16
uniform sampler2D TextureDiffuse[FETCH_COUNT];
in vec4 gl_FragCoord;
layout(location = 0, index = 0) out vec4 Color;
View uniform-f32vec4-srgb.frag
#version 430 core
vec3 correctSrgbToRgb(in vec3 ColorSRGB, in float Gamma)
{
return mix(
pow((ColorSRGB + 0.055) * 0.94786729857819905213270142180095, vec3(Gamma)),
ColorSRGB * 0.07739938080495356037151702786378,
lessThanEqual(ColorSRGB, vec3(0.04045)));
}
View uniform-u8vec4-srgb.frag
#version 430 core
vec3 correctSrgbToRgb(in vec3 ColorSRGB, in float Gamma)
{
return mix(
pow((ColorSRGB + 0.055) * 0.94786729857819905213270142180095, vec3(Gamma)),
ColorSRGB * 0.07739938080495356037151702786378,
lessThanEqual(ColorSRGB, vec3(0.04045)));
}
View uniform-f32vec4-srgb-gamma
#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;
View uniform-u8vec4-srgb-gamma
#version 430 core
vec4 gammaSrgbToRgb(in vec4 ColorSRGB)
{
return vec4(pow(ColorSRGB.rgb, vec3(2.2)), ColorSRGB.a);
}
layout(binding = 0) uniform bufferFetch
{
uint Color;
View uniform-f32vec4-srgb-taylor.frag
#version 430 core
vec3 taylorSrgbToRgb(in vec3 ColorSRGB)
{
vec3 A = (ColorSRGB * 0.305306011 + 0.682171111);
vec3 B = (ColorSRGB * A + 0.012522878);
return ColorSRGB * B;
}
vec4 taylorSrgbToRgb(in vec4 ColorSRGB)
View uniform-u8vec4-srgb-taylor.frag
#version 430 core
vec3 taylorSrgbToRgb(in vec3 ColorSRGB)
{
vec3 A = (ColorSRGB * 0.305306011 + 0.682171111);
vec3 B = (ColorSRGB * A + 0.012522878);
return ColorSRGB * B;
}
vec4 taylorSrgbToRgb(in vec4 ColorSRGB)
View u8vec4 uniform buffer
#version 430 core
layout(binding = 0) uniform bufferFetch
{
uint Color;
} Buffer;
layout(location = 0, index = 0) out vec4 Color;
void main()
View vec4 uniform buffer
#version 430 core
layout(binding = 0) uniform bufferFetch
{
vec4 Color;
} Buffer;
layout(location = 0, index = 0) out vec4 Color;
void main()
You can’t perform that action at this time.