KhronosGroup / KhronosGroup/OpenGL-API

Relax requirements for gl_VertexID and gl_PrimitiveID with immediate-mode drawing

未关闭
#78 3 条评论 0 个 reaction 已指派 1 人 已被 @ianromanick 认领 在 GitHub 查看
主要语言
没有语言数据
星标
42
派生
8
PR 合并指标
30 天内没有已合并 PR

描述

When an application uses immediate-mode drawing commands, the OpenGL implementation must buffer vertices submitted. The OpenGL specification does not place limits on the number of vertices that may be submitted between `glBegin` and `glEnd`, but the buffers used to store that data will have finite size. When the buffer becomes full, the implementation may need to split the primitive. On some implementations, this buffer may be relatively "small" only allowing a thousand or so vertices per batch.

Splitting the primitive will cause `gl_VertexID` and `gl_PrimitiveID` to have observably incorrect values, but the specification does not strictly allow this. The alternative, which is allowed by the specification, is to generate `GL_OUT_OF_MEMORY`. That seems... rude.

Instead, we propose two alternatives:

1. Simply make `gl_VertexID` and `gl_PrimitiveID` (and `gl_PrimitiveIDIn` for geometry shaders) undefined with immediate-mode drawing.
2. Add some language that says something to the effect, "after some implementation defined limit (which may be arbitrarily small), `gl_VertexID` and `gl_PrimitiveID` may reset to zero."

This first is cleaner, but it is more broad than necessary. The second introduces (effectively untestable) implementation-dependent behavior.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。