mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 20:28:32 +09:00
[Fix] (MG_Impl): create sampler objects at Gen; guard combined-format CopyTexImage
glGenSamplers creates the sampler objects themselves (unlike texture and buffer names), so glIsSampler must answer GL_TRUE before any bind - the names now get their state vectors at Gen time (KHR-GL33.api.coverage). glCopyTexImage2D with a combined DEPTH_STENCIL internalformat now requires both halves in the read framebuffer and reports GL_INVALID_OPERATION when only the depth or only the stencil attachment point is populated (packed_depth_stencil.validate_errors.*).
This commit is contained in:
@@ -185,6 +185,11 @@ namespace MobileGL::MG_Impl::GLImpl {
|
||||
static thread_local Vector<GLuint> names;
|
||||
MG_State::pGLContext->GenSamplerNames(count, names);
|
||||
Memcpy(samplers, names.data(), count * sizeof(GLuint));
|
||||
// Unlike textures/buffers, glGenSamplers CREATES the sampler objects: each name
|
||||
// is immediately a sampler (glIsSampler == GL_TRUE before any bind).
|
||||
for (GLsizei i = 0; i < count; ++i) {
|
||||
MG_State::pGLContext->CreateSamplerObject(names[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void DeleteSamplers_State(GLsizei count, const GLuint* samplers) {
|
||||
|
||||
Reference in New Issue
Block a user