PDA

View Full Version : Atomic global counter in Direct3D 11?



Groovounet
05-12-2010, 11:11 AM
With OpenGL we have various build-in read only counters like "gl_Instance", "gl_VertexID", "gl_PrimitiveID", "gl_InvocationID", etc...

Direct3D 11 has D3D11_BUFFER_UAV_FLAG_COUNTER, a "counter buffer" which seems to be a feature cover by GL_NV_shader_buffer_store.

I was wondering is Direct3D 11 as some OpenGL kind of counter and them if by extrapolation we could expect "OpenGL programmable atomic counters"?

The difference would be maybe no memory access and use of a "register" (as part of the cache?) which could make is a could to free operator for few counters.

(And maybe extend that to some sort of atomic load and store uniforms variable? Maybe it is just an evil idea!)