mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 22:28:32 +09:00
glGenQueries only reserves names; a name becomes a query object when it is first used with BeginQuery or QueryCounter (GL 4.6 core 4.2.1). MobileGL created the live object eagerly at glGenQueries time and glIsQuery reported every reserved name as an object, with a comment noting the shortcut. The registry already distinguished the two states -- a target of 0 means the name has never been used -- so glIsQuery now consults it, and a name that came from glCreateQueries carries a flag saying it is an object regardless. glCreateQueries itself was a stub. It creates the objects outright with their target already fixed, which is the whole point of the DSA form: there is no binding step to infer the target from later.
29 lines
1.3 KiB
C++
29 lines
1.3 KiB
C++
// MobileGL - MobileGL/MG_Impl/GLImpl/Query/GL_Query.h
|
|
// Copyright (c) 2025-2026 MobileGL-Dev
|
|
// Licensed under the GNU Lesser General Public License v3.0:
|
|
// https://www.gnu.org/licenses/gpl-3.0.txt
|
|
// https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
// SPDX-License-Identifier: LGPL-3.0-only
|
|
// End of Source File Header
|
|
|
|
#pragma once
|
|
#include <Includes.h>
|
|
|
|
namespace MobileGL::MG_Impl::GLImpl {
|
|
void GenQueries(GLsizei n, GLuint* ids);
|
|
void CreateQueries(GLenum target, GLsizei n, GLuint* ids);
|
|
void DeleteQueries(GLsizei n, const GLuint* ids);
|
|
GLboolean IsQuery(GLuint id);
|
|
void BeginQuery(GLenum target, GLuint id);
|
|
void EndQuery(GLenum target);
|
|
void GetQueryiv(GLenum target, GLenum pname, GLint* params);
|
|
void BeginQueryIndexed(GLenum target, GLuint index, GLuint id);
|
|
void EndQueryIndexed(GLenum target, GLuint index);
|
|
void GetQueryIndexediv(GLenum target, GLuint index, GLenum pname, GLint* params);
|
|
void GetQueryObjectiv(GLuint id, GLenum pname, GLint* params);
|
|
void GetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params);
|
|
void GetQueryObjecti64v(GLuint id, GLenum pname, GLint64* params);
|
|
void GetQueryObjectui64v(GLuint id, GLenum pname, GLuint64* params);
|
|
void QueryCounter(GLuint id, GLenum target);
|
|
} // namespace MobileGL::MG_Impl::GLImpl
|