Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous requirement for non-zero indirect buffer object in core profile #65

Open
cubanismo opened this issue Mar 27, 2020 · 2 comments
Assignees

Comments

@cubanismo
Copy link

Section 10.3.11 of the OpenGL 4.6 spec defines "Indirect commands in Buffer Objects", or the GL_DRAW_INDIRECT_BUFFER/GL_DISPATCH_INDIRECT_BUFFER buffer targets. It refers readers to section 10.3.9 for general properties of the mechanism. Section 10.3.9 notes behavior is undefined if buffer object zero is bound to an enabled array at draw time, but it is not clear from the language in section 10.3.11 if this property is inherited by indirect buffers. Notably, section 10.3.10 duplicates the zero-object undefined behavior property while referring to section 10.3.9 for general behavior, while section 10.3.11 does not, perhaps implying it is well-defined and supported for indirect commands to use client memory for their indirect command memory. Further, no error case is defined for this situation in the DrawIndirect commands. The only clarifying point that indicates to the contrary is that the compatibility profile spec contains additional language:

"If zero is bound to DRAW_INDIRECT_BUFFER, the corresponding DrawIndirect commands instead source their arguments directly from the indirect pointer in client memory"

Which clearly defines the behavior only in the compatibility profile, implying it is intended to be undefined in the core profile.

To clarify this in the core profile spec, I think an explicit error case should be added to the DrawIndirect commands (probably in DrawArraysIndirect, so it will be inherited by all of them), and the "undefined behavior" language from section 10.3.9/10.3.10 should be duplicated into section 10.3.11 as well.

@cubanismo
Copy link
Author

Note this issue was pointed out by a developer here: https://forums.developer.nvidia.com/t/gldrawelementsindirect-throws-zero-buffer-bound-to-gl-draw-indirect-buffer/117307

The NVIDIA driver currently returns GL_INVALID_OPERATION for this case.

@pdaniell-nv
Copy link

@cubanismo there is already this in the error section on page 367 of the OpenGL 4.6 core spec:

An INVALID_OPERATION error is generated if zero is bound to DRAW_INDIRECT_BUFFER

Is that enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants