Adjustments to test compute shader
This commit is contained in:
parent
81ff8a8da6
commit
99bd2c429b
2 changed files with 15 additions and 8 deletions
test/shaders
|
@ -1,6 +1,9 @@
|
|||
#version 450 core
|
||||
|
||||
layout( local_size_x = 16 , local_size_y = 16 ) in;
|
||||
layout(
|
||||
local_size_x = 8 ,
|
||||
local_size_y = 32
|
||||
) in;
|
||||
|
||||
//! type compute
|
||||
//! include lib/utils.glsl
|
||||
|
@ -15,7 +18,7 @@ layout( location = 6 ) uniform vec3 u_ColorLift;
|
|||
layout( location = 7 ) uniform vec3 u_ColorGain;
|
||||
layout( location = 8 ) uniform vec3 u_ColorGamma;
|
||||
|
||||
layout( binding = 0 , rgba8 ) writeonly uniform image2D ub_Output;
|
||||
layout( binding = 0 , rgba8 ) writeonly uniform image2D u_Output;
|
||||
|
||||
#define uVigShapeMul (u_Vignette1.x)
|
||||
#define uVigShapePow (u_Vignette1.y)
|
||||
|
@ -27,7 +30,10 @@ layout( binding = 0 , rgba8 ) writeonly uniform image2D ub_Output;
|
|||
void main( void )
|
||||
{
|
||||
ivec2 coords = ivec2( gl_GlobalInvocationID.xy );
|
||||
vec2 pos = vec2( coords ) / u_OutputSize;
|
||||
vec2 pos = vec2( coords ) / vec2( imageSize( u_Output ) );
|
||||
if ( pos.x > 1. || pos.y > 1. ) {
|
||||
return;
|
||||
}
|
||||
float f = u_Bloom.x;
|
||||
vec3 color = textureLod( u_MainInput , pos , 0 ).rgb;
|
||||
|
||||
|
@ -58,6 +64,6 @@ void main( void )
|
|||
color = pow( color , vec3( 1 ) / ( u_ColorGamma + 2.2 ) );
|
||||
|
||||
// Write it
|
||||
imageStore( ub_Output , coords ,
|
||||
imageStore( u_Output , coords ,
|
||||
vec4( color , M_Luminosity( color ) ) );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue