[Fix] (MG_Impl): report the draw-indirect binding and the buffer access state

Three pieces of queryable buffer state were missing, all of them read by the
KHR-GL40.draw_indirect basic-binding-* and basic-buffer-* cases:

- GL_DRAW_INDIRECT_BUFFER_BINDING had no case in glGetIntegerv, so it raised
  GL_INVALID_ENUM and left the caller's variable untouched (the test read back its own
  -9999 sentinel). GL_DISPATCH_INDIRECT_BUFFER_BINDING right next to it was already
  handled; this is the same two lines against BufferTarget::DrawIndirect. Because
  glGetBooleanv/glGetFloatv/glGetDoublev all widen from the integer path, one case
  fixes all four getters.
- GL_BUFFER_ACCESS answered 0 for an unmapped buffer. Its initial value is
  GL_READ_WRITE and glUnmapBuffer restores it (GL 4.6 core table 6.2); 0 is not a legal
  value of that state at all, and the test threw on the unrecognised enum.
- GL_BUFFER_ACCESS_FLAGS was not implemented, so it fell through to the invalid-pname
  arm. It is the MapBufferRange bitfield verbatim, which the mapping access flags
  already hold in normalised form - glMapBuffer's access enum is converted on the way
  in - so it converts straight back out, and reads zero while unmapped.
This commit is contained in:
BZLZHH
2026-08-04 09:52:40 -04:00
parent d81a6a0998
commit 00534d8bbc
4 changed files with 18 additions and 4 deletions
@@ -73,7 +73,7 @@ namespace MobileGL {
}
}
GLbitfield ConvertBufferMappingAccessToGLEnum(BufferMappingAccessBit access) {
GLbitfield ConvertBufferMappingAccessToGLEnum(Flags<BufferMappingAccessBit> access) {
GLbitfield result = 0;
if (access & BufferMappingAccessBit::Read) result |= GL_MAP_READ_BIT;
if (access & BufferMappingAccessBit::Write) result |= GL_MAP_WRITE_BIT;
@@ -14,6 +14,6 @@ namespace MobileGL {
namespace MG_Util {
GLenum ConvertBufferTargetToGLEnum(BufferTarget bufferTarget);
GLenum ConvertBufferUsageToGLEnum(BufferUsage usage);
GLbitfield ConvertBufferMappingAccessToGLEnum(BufferMappingAccessBit access);
GLbitfield ConvertBufferMappingAccessToGLEnum(Flags<BufferMappingAccessBit> access);
} // namespace MG_Util
} // namespace MobileGL