KhronosGroup / OpenGL-API

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

Layout of compute shader shared variables #40

Closed Jiawei-Shao closed 5 years ago

Jiawei-Shao commented 6 years ago

Hi,

Now OpenGL ES 3.2 SPEC does not define the layout of compute shader shared variables in the memory when validating GL_MAX_COMPUTE_SHARED_MEMORY_SIZE, will OpenGL(ES) SPEC define a default memory layout rule for compute shader shared variables like varying packing rules?

OpenGL Wiki mentions "OpenGL does not specify the exact mapping between GL types and shared variable storage, though you could use the std140 layout rules and UBO/SSBO sizes as a general guideline"[1], however in Mesa it seems the total memory of shared variables is computed though std430.

[1] https://www.khronos.org/opengl/wiki/Compute_Shader#Limitations [2] https://cgit.freedesktop.org/mesa/mesa/tree/src/compiler/glsl/lower_shared_reference.cpp#n111

Jiawei-Shao commented 6 years ago

@qjia7

pdaniell-nv commented 6 years ago

Issue tracked internally here: https://gitlab.khronos.org/opengl/API/issues/88

pdaniell-nv commented 5 years ago

This issue was resolved in the latest OpenGL and OpenGL ES specs: