mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 05:38:31 +09:00
[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:
@@ -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
|
||||
Reference in New Issue
Block a user