Support Extension GL_ARB_shader_atomic_counter_ops and relative intrisic functions.
refs: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_atomic_counter_ops.txt Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
This commit is contained in:
parent
0db0010d3c
commit
bf56773517
6 changed files with 273 additions and 0 deletions
28
Test/atomicCounterARBOps.vert
Normal file
28
Test/atomicCounterARBOps.vert
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#version 450 core
|
||||
#extension GL_ARB_shader_atomic_counters: enable
|
||||
#extension GL_ARB_shader_atomic_counter_ops:enable
|
||||
|
||||
layout(binding = 0) uniform atomic_uint counter;
|
||||
|
||||
out highp vec4 vsColor;
|
||||
|
||||
void main(){
|
||||
vec4 outColor = vec4(1.0);
|
||||
uint ret;
|
||||
|
||||
ret = atomicCounterAddARB(counter, 4u);
|
||||
ret = atomicCounterSubtractARB(counter, 4u);
|
||||
ret = atomicCounterMinARB(counter, 4u);
|
||||
ret = atomicCounterMaxARB(counter, 4u);
|
||||
ret = atomicCounterAndARB(counter, 4u);
|
||||
ret = atomicCounterOrARB(counter, 4u);
|
||||
ret = atomicCounterXorARB(counter, 4u);
|
||||
ret = atomicCounterExchangeARB(counter, 4u);
|
||||
ret = atomicCounterCompSwapARB(counter, 4u, 4u);
|
||||
|
||||
uint after = atomicCounter(counter);
|
||||
if (after == ret)
|
||||
outColor = vec4(0.0);
|
||||
|
||||
vsColor = outColor;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue