mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
Two previously-stubbed GL 3.3 Core entry points. glMultiDrawArrays: mirrors the existing glMultiDrawElements(BaseVertex) architecture end to end -- a new MultiDrawArrays backend function-table slot dispatched from the frontend after program/primitive-mode validation (plus a drawcount < 0 -> GL_INVALID_VALUE guard). - DirectGLES: PrepareForDraw once, then loop native glDrawArrays with the same per-range client-side array upload the single DrawArrays does. - DirectVulkan: build a MultiDrawCmd payload and hand it to a new VulkanRenderer::MultiDrawArrays, which does one SetupDraw over the union of the sub-draw vertex ranges and then a vkCmdDraw per range (mirrors VulkanRenderer::MultiDrawElements). glGetBufferSubData: reads a range of the bound buffer's CPU shadow into client memory via a new BufferObject::DownloadSubData, with the same validation shape as BufferSubData (INVALID_VALUE for negative/overflowing range, INVALID_OPERATION for no bound buffer or a non-persistent mapped buffer). The shadow reflects CPU writes and backend write-backs but not arbitrary GPU-side writes, which is documented on the method. Tests: 2 BufferTest cases for glGetBufferSubData (round-trip read of a middle range and the whole buffer, plus out-of-range/negative/no-buffer errors). BufferTest 32/32, SanityTest 30/30, VertexArrayTest 42/42; library builds clean. (The glMultiDrawArrays draw paths are not runtime-testable on this host and are compile-verified against the tested MultiDrawElements pattern.)
54 lines
3.4 KiB
C++
54 lines
3.4 KiB
C++
// MobileGL - MobileGL/MG_Impl/GLImpl/Buffer/GL_Buffer.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 {
|
|
/* @INSERTION_POINT:FUNCTION_DECLARATION@ */
|
|
void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
|
|
void GetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params);
|
|
void GetBufferPointerv(GLenum target, GLenum pname, void** params);
|
|
GLboolean IsBuffer(GLuint buffer);
|
|
void DeleteBuffers(GLsizei n, const GLuint* buffers);
|
|
void FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
|
|
GLboolean UnmapBuffer(GLenum target);
|
|
void* MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
|
|
void* MapBuffer(GLenum target, GLenum access);
|
|
void BufferStorage(GLenum target, GLsizeiptr size, const void* data, GLbitfield flags);
|
|
void CreateBuffers(GLsizei n, GLuint* buffers);
|
|
void NamedBufferStorage(GLuint buffer, GLsizeiptr size, const void* data, GLbitfield flags);
|
|
void NamedBufferData(GLuint buffer, GLsizeiptr size, const void* data, GLenum usage);
|
|
void NamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data);
|
|
void CopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset,
|
|
GLsizeiptr size);
|
|
void ClearNamedBufferData(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void* data);
|
|
void ClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format,
|
|
GLenum type, const void* data);
|
|
void* MapNamedBuffer(GLuint buffer, GLenum access);
|
|
void* MapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
|
|
GLboolean UnmapNamedBuffer(GLuint buffer);
|
|
void FlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length);
|
|
void GetNamedBufferParameteriv(GLuint buffer, GLenum pname, GLint* params);
|
|
void GetNamedBufferParameteri64v(GLuint buffer, GLenum pname, GLint64* params);
|
|
void GetNamedBufferPointerv(GLuint buffer, GLenum pname, void** params);
|
|
void CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset,
|
|
GLsizeiptr size);
|
|
void BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
|
|
void GetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, void* data);
|
|
void BufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage);
|
|
void BindBuffer(GLenum target, GLuint buffer);
|
|
void GenBuffers(GLsizei n, GLuint* buffers);
|
|
void BindBufferBase(GLenum target, GLuint index, GLuint buffer);
|
|
void BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
|
|
void BindBuffersBase(GLenum target, GLuint first, GLsizei count, const GLuint* buffers);
|
|
void BindBuffersRange(GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr* offsets,
|
|
const GLsizeiptr* sizes);
|
|
|
|
} // namespace MobileGL::MG_Impl::GLImpl
|