mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-03-03 05:06:31 +00:00
xrt: Make some fields on xrt_gl_swapchain private
This commit is contained in:
parent
34843c3ffe
commit
0d05eb6cae
src/xrt
|
@ -51,7 +51,7 @@ client_gl_swapchain_destroy(struct xrt_swapchain *xsc)
|
|||
if (num_images > 0) {
|
||||
glDeleteTextures(num_images, &sc->base.images[0]);
|
||||
U_ZERO_ARRAY(sc->base.images);
|
||||
glDeleteMemoryObjectsEXT(num_images, &sc->base.memory[0]);
|
||||
glDeleteMemoryObjectsEXT(num_images, &sc->memory[0]);
|
||||
U_ZERO_ARRAY(sc->base.images);
|
||||
sc->base.base.num_images = 0;
|
||||
}
|
||||
|
@ -304,13 +304,12 @@ client_gl_swapchain_create(struct xrt_compositor *xc,
|
|||
: GL_TEXTURE_2D_ARRAY,
|
||||
sc->base.images[i]);
|
||||
}
|
||||
glCreateMemoryObjectsEXT(xsc->num_images, &sc->base.memory[0]);
|
||||
glCreateMemoryObjectsEXT(xsc->num_images, &sc->memory[0]);
|
||||
for (uint32_t i = 0; i < xsc->num_images; i++) {
|
||||
GLint dedicated = GL_TRUE;
|
||||
glMemoryObjectParameterivEXT(sc->base.memory[i],
|
||||
GL_DEDICATED_MEMORY_OBJECT_EXT,
|
||||
&dedicated);
|
||||
glImportMemoryFdEXT(sc->base.memory[i], xscn->images[i].size,
|
||||
glMemoryObjectParameterivEXT(
|
||||
sc->memory[i], GL_DEDICATED_MEMORY_OBJECT_EXT, &dedicated);
|
||||
glImportMemoryFdEXT(sc->memory[i], xscn->images[i].size,
|
||||
GL_HANDLE_TYPE_OPAQUE_FD_EXT,
|
||||
xscn->images[i].fd);
|
||||
|
||||
|
@ -321,12 +320,12 @@ client_gl_swapchain_create(struct xrt_compositor *xc,
|
|||
glTextureStorageMem2DEXT(
|
||||
sc->base.images[i], info->mip_count,
|
||||
(GLuint)info->format, info->width, info->height,
|
||||
sc->base.memory[i], 0);
|
||||
sc->memory[i], 0);
|
||||
} else {
|
||||
glTextureStorageMem3DEXT(
|
||||
sc->base.images[i], info->mip_count,
|
||||
(GLuint)info->format, info->width, info->height,
|
||||
info->array_size, sc->base.memory[i], 0);
|
||||
info->array_size, sc->memory[i], 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,9 @@ struct client_gl_swapchain
|
|||
struct xrt_swapchain_gl base;
|
||||
|
||||
struct xrt_swapchain_native *xscn;
|
||||
|
||||
// GLuint
|
||||
unsigned int memory[XRT_MAX_SWAPCHAIN_IMAGES];
|
||||
};
|
||||
|
||||
/*!
|
||||
|
|
|
@ -753,8 +753,6 @@ struct xrt_swapchain_gl
|
|||
|
||||
// GLuint
|
||||
unsigned int images[XRT_MAX_SWAPCHAIN_IMAGES];
|
||||
// GLuint
|
||||
unsigned int memory[XRT_MAX_SWAPCHAIN_IMAGES];
|
||||
};
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Reference in a new issue