KhronosGroup / OpenGL-API

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

Repeated INVALID_OPERATION error in DispatchCompute #24

Closed qjia7 closed 6 years ago

qjia7 commented 6 years ago

In OpenGL ES Version 3.1 (November 3, 2016), Chapter 17, for DispatchCompute API, there are below errors description: Errors

  1. An INVALID_OPERATION error is generated if there is no active program object for the compute shader stage.
  2. An INVALID_VALUE error is generated if any of num groups x, num groups y and num groups z are greater than the maximum work group count for the corresponding dimension.
  3. An INVALID_OPERATION error is generated if program is the name of a program that has not been successfully linked, or of a linked program object that contains no compute shaders.

For case 1 and 3, I think if there is an active program object for the compute shader stage, it must has been successfully linked since the active program object's definition[1] requires it. So maybe case 3 should be modified as below:

  1. An INVALID_OPERATION error is generated if program is successfully linked, but contains no compute shaders. A corresponding test case can be found in https://chromium-review.googlesource.com/c/angle/angle/+/784273/3/src/tests/gl_tests/ComputeShaderTest.cpp#35

[1]Paste the spec description about active program object here. 'If a non-zero program object is bound by UseProgram, it is the active program object whose uniforms are updated by these commands. If no program object is bound using UseProgram, the active program object of the current program pipeline object set by ActiveShaderProgram is the active program object.' Meanwhile, UseProgram and ActiveShaderProgram both require that program has been successfully linked.

qjia7 commented 6 years ago

@johnkslang @TobiasHector Please take a look. Thanks.

pdaniell-nv commented 6 years ago

In the latest OpenGL 4.6 and OpenGL ES 3.2 specifications, the last clause 3. has been removed since it was considered redundant. In general we don't usually propagate bug fixes to older specifications because the fix may invalidate existing implementations.

Does that seems reasonable?

qjia7 commented 6 years ago

@pdaniell-nv Thanks for pointing it out. Sounds good for me.