KhronosGroup / OpenGL-API

OpenGL and OpenGL ES API Issue Tracker
34 stars 5 forks source link

ARB_gl_spirv: mapping of atomics #38

Closed jozefkucia closed 6 years ago

jozefkucia commented 6 years ago

The ARB_gl_spirv spec contains the following mapping:

 atomicCounterIncrement -> OpAtomicIIncrement
 atomicCounterDecrement -> OpAtomicIDecrement
 atomicCounter          -> OpAtomicLoad

The mapping seems to be inaccurate for atomicCounterDecrement. atomicCounterDecrement returns the value resulting from the decrement operation while the OpAtomicIDecrement returns the original value.

pdaniell-nv commented 6 years ago

@johnkslang to do some research on this then assign @dgkoch to make the extension spec update.

johnkslang commented 6 years ago

From glslang generator number:

//return 2; // EOpAtomicCounterDecrement gets a post decrement, to map between GLSL -> SPIR-V
dgkoch commented 6 years ago

@jozefkucia in general the "Mapping to SPIR-V" section isn't considered normative, but included to aid in understanding. As @johnkslang noted, we've already accounted for these differences between GLSL/HLSL and SPIRV in the glslang producer. I've also proposed a note in the extension spec to call this out: https://github.com/KhronosGroup/OpenGL-Registry/pull/185

pdaniell-nv commented 6 years ago

This should be resolved now by https://github.com/KhronosGroup/OpenGL-Registry/pull/185. Closing.