-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2186 from KhronosGroup/64bit-images
GLSL: Implement 64-bit image support.
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
reference/shaders-no-opt/vulkan/comp/image-64bit.vk.nocompat.comp.vk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#version 450 | ||
#if defined(GL_ARB_gpu_shader_int64) | ||
#extension GL_ARB_gpu_shader_int64 : require | ||
#else | ||
#error No extension available for 64-bit integers. | ||
#endif | ||
#extension GL_EXT_shader_image_int64 : require | ||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; | ||
|
||
layout(set = 0, binding = 0, r64ui) uniform u64image2D uimg; | ||
layout(set = 0, binding = 1, r64i) uniform i64image2D iimg; | ||
|
||
void main() | ||
{ | ||
uint64_t uv = imageLoad(uimg, ivec2(gl_GlobalInvocationID.xy + uvec2(50u))).x; | ||
int64_t iv = imageLoad(iimg, ivec2(gl_GlobalInvocationID.xy + uvec2(50u))).x; | ||
uint64_t _52 = imageAtomicMax(uimg, ivec2(gl_GlobalInvocationID.xy), uv); | ||
uv = _52; | ||
int64_t _59 = imageAtomicMax(iimg, ivec2(gl_GlobalInvocationID.xy), iv); | ||
iv = _59; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#version 450 | ||
#extension GL_ARB_gpu_shader_int64 : require | ||
#extension GL_EXT_shader_image_int64 : require | ||
layout(local_size_x = 1) in; | ||
|
||
layout(set = 0, binding = 0, r64ui) uniform u64image2D uimg; | ||
layout(set = 0, binding = 1, r64i) uniform i64image2D iimg; | ||
|
||
void main() | ||
{ | ||
uint64_t uv = imageLoad(uimg, ivec2(gl_GlobalInvocationID.xy + 50)).x; | ||
int64_t iv = imageLoad(iimg, ivec2(gl_GlobalInvocationID.xy + 50)).x; | ||
|
||
uv = imageAtomicMax(uimg, ivec2(gl_GlobalInvocationID.xy), uv); | ||
iv = imageAtomicMax(iimg, ivec2(gl_GlobalInvocationID.xy), iv); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters