xrt: Make some fields on xrt_gl_swapchain private

This commit is contained in:
Jakob Bornecrantz 2020-07-10 10:23:38 +01:00 committed by Jakob Bornecrantz
parent 34843c3ffe
commit 0d05eb6cae
3 changed files with 10 additions and 10 deletions
src/xrt

View file

@ -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);
}
}

View file

@ -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];
};
/*!

View file

@ -753,8 +753,6 @@ struct xrt_swapchain_gl
// GLuint
unsigned int images[XRT_MAX_SWAPCHAIN_IMAGES];
// GLuint
unsigned int memory[XRT_MAX_SWAPCHAIN_IMAGES];
};
/*!