diff options
| author | Quentin LADEVIE <qladevie@wanadev.fr> | 2023-01-22 17:59:24 +0100 |
|---|---|---|
| committer | Quentin LADEVIE <qladevie@wanadev.fr> | 2023-01-22 17:59:24 +0100 |
| commit | 0a882c4b85423a170455f05a52d18f7fa7c9220b (patch) | |
| tree | 3bdc24d73ba7cc828fce2b93ce85f73831b12204 /shaders | |
| parent | 5e3bb454d50091e581d5d1d03af34e38277694b3 (diff) | |
Api test bindless and command buffers
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | shaders/test.comp | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/shaders/CMakeLists.txt b/shaders/CMakeLists.txt index 699e921..f572ced 100644 --- a/shaders/CMakeLists.txt +++ b/shaders/CMakeLists.txt @@ -21,6 +21,7 @@ endforeach(GLSL) add_custom_target( shaders DEPENDS ${SPIRV_BINARY_FILES} - ) +) add_dependencies(path-tracer shaders) +add_dependencies(api-test shaders) diff --git a/shaders/test.comp b/shaders/test.comp new file mode 100644 index 0000000..541cb93 --- /dev/null +++ b/shaders/test.comp @@ -0,0 +1,18 @@ +#extension GL_EXT_buffer_reference : require +#extension GL_EXT_nonuniform_qualifier : require + +layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(set = 0, binding = 0) uniform sampler samplers[]; +layout(set = 0, binding = 1) uniform texture2D textures[]; +layout(set = 0, binding = 2, rgba32f) uniform image2D images[]; + +void main() { + ivec2 coords = ivec2(gl_GlobalInvocationID.xy); + float t = 0.5; + vec3 color_1 = imageLoad(images[nonuniformEXT(0)], coords).xyz; + vec3 color_2 = imageLoad(images[nonuniformEXT(1)], coords).xyz; + vec3 out_color = (t * color_1) + ((1.0 - t) * color_2); + + imageStore(images[nonuniformEXT(0)], coords, vec4(out_color, 1.0)); +} |
