c/client: Expose size limit for swapchains

This commit is contained in:
Jiali Zhang 2023-09-26 20:12:50 +08:00 committed by Jakob Bornecrantz
parent 900c43a6e2
commit 8f70291cad
2 changed files with 15 additions and 0 deletions

View file

@ -597,6 +597,13 @@ client_gl_compositor_init(struct client_gl_compositor *c,
}
c->base.base.info.format_count = count;
// Get max texture size.
GLint max_texture_size = 0;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size);
if (max_texture_size > 0) {
c->base.base.info.max_tetxure_size = (uint32_t)max_texture_size;
}
os_mutex_init(&c->context_mutex);
return true;

View file

@ -836,6 +836,14 @@ client_vk_compositor_create(struct xrt_compositor_native *xcn,
}
#endif
// Get max texture size.
{
struct vk_bundle *vk = &c->vk;
VkPhysicalDeviceProperties pdp;
vk->vkGetPhysicalDeviceProperties(vk->physical_device, &pdp);
c->base.base.info.max_tetxure_size = pdp.limits.maxImageDimension2D;
}
return c;
err_pool: