summaryrefslogtreecommitdiffstats
path: root/modules/openxr/extensions/platform/openxr_opengl_extension.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/openxr/extensions/platform/openxr_opengl_extension.cpp')
-rw-r--r--modules/openxr/extensions/platform/openxr_opengl_extension.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/modules/openxr/extensions/platform/openxr_opengl_extension.cpp b/modules/openxr/extensions/platform/openxr_opengl_extension.cpp
index d92084a220..caded14ca7 100644
--- a/modules/openxr/extensions/platform/openxr_opengl_extension.cpp
+++ b/modules/openxr/extensions/platform/openxr_opengl_extension.cpp
@@ -56,11 +56,6 @@
// feature off.
// See: https://registry.khronos.org/OpenGL/extensions/EXT/EXT_sRGB_write_control.txt
-// On OpenGLES this is not defined in our standard headers..
-#ifndef GL_FRAMEBUFFER_SRGB
-#define GL_FRAMEBUFFER_SRGB 0x8DB9
-#endif
-
HashMap<String, bool *> OpenXROpenGLExtension::get_requested_extensions() {
HashMap<String, bool *> request_extensions;
@@ -196,23 +191,6 @@ void OpenXROpenGLExtension::get_usable_depth_formats(Vector<int64_t> &p_usable_d
p_usable_depth_formats.push_back(GL_DEPTH_COMPONENT24);
}
-void OpenXROpenGLExtension::on_pre_draw_viewport(RID p_render_target) {
- if (srgb_ext_is_available) {
- hw_linear_to_srgb_is_enabled = glIsEnabled(GL_FRAMEBUFFER_SRGB);
- if (hw_linear_to_srgb_is_enabled) {
- // Disable this.
- glDisable(GL_FRAMEBUFFER_SRGB);
- }
- }
-}
-
-void OpenXROpenGLExtension::on_post_draw_viewport(RID p_render_target) {
- if (srgb_ext_is_available && hw_linear_to_srgb_is_enabled) {
- // Re-enable this.
- glEnable(GL_FRAMEBUFFER_SRGB);
- }
-}
-
bool OpenXROpenGLExtension::get_swapchain_image_data(XrSwapchain p_swapchain, int64_t p_swapchain_format, uint32_t p_width, uint32_t p_height, uint32_t p_sample_count, uint32_t p_array_size, void **r_swapchain_graphics_data) {
GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton();
ERR_FAIL_NULL_V(texture_storage, false);
@@ -262,8 +240,8 @@ bool OpenXROpenGLExtension::get_swapchain_image_data(XrSwapchain p_swapchain, in
Vector<RID> texture_rids;
for (uint64_t i = 0; i < swapchain_length; i++) {
- RID texture_rid = texture_storage->texture_create_external(
- p_array_size == 1 ? GLES3::Texture::TYPE_2D : GLES3::Texture::TYPE_LAYERED,
+ RID texture_rid = texture_storage->texture_create_from_native_handle(
+ p_array_size == 1 ? RS::TEXTURE_TYPE_2D : RS::TEXTURE_TYPE_LAYERED,
format,
images[i].image,
p_width,