Browse Source

Fix Vulkan: SpotLight3D's and OmniLight3D's Projector doesn't work

Tobias Widner 2 years ago
parent
commit
422bacbfd1

+ 2 - 1
drivers/gles3/storage/light_storage.h

@@ -36,6 +36,7 @@
 #include "core/templates/local_vector.h"
 #include "core/templates/local_vector.h"
 #include "core/templates/rid_owner.h"
 #include "core/templates/rid_owner.h"
 #include "core/templates/self_list.h"
 #include "core/templates/self_list.h"
+#include "drivers/gles3/storage/texture_storage.h"
 #include "servers/rendering/renderer_compositor.h"
 #include "servers/rendering/renderer_compositor.h"
 #include "servers/rendering/storage/light_storage.h"
 #include "servers/rendering/storage/light_storage.h"
 #include "servers/rendering/storage/utilities.h"
 #include "servers/rendering/storage/utilities.h"
@@ -246,7 +247,7 @@ public:
 		const Light *light = light_owner.get_or_null(p_light);
 		const Light *light = light_owner.get_or_null(p_light);
 		ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL);
 		ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL);
 
 
-		return light_owner.owns(light->projector);
+		return TextureStorage::get_singleton()->owns_texture(light->projector);
 	}
 	}
 
 
 	_FORCE_INLINE_ bool light_is_negative(RID p_light) const {
 	_FORCE_INLINE_ bool light_is_negative(RID p_light) const {

+ 2 - 1
servers/rendering/renderer_rd/storage_rd/light_storage.h

@@ -34,6 +34,7 @@
 #include "core/templates/local_vector.h"
 #include "core/templates/local_vector.h"
 #include "core/templates/rid_owner.h"
 #include "core/templates/rid_owner.h"
 #include "core/templates/self_list.h"
 #include "core/templates/self_list.h"
+#include "servers/rendering/renderer_rd/storage_rd/texture_storage.h"
 #include "servers/rendering/storage/light_storage.h"
 #include "servers/rendering/storage/light_storage.h"
 #include "servers/rendering/storage/utilities.h"
 #include "servers/rendering/storage/utilities.h"
 
 
@@ -235,7 +236,7 @@ public:
 		const Light *light = light_owner.get_or_null(p_light);
 		const Light *light = light_owner.get_or_null(p_light);
 		ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL);
 		ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL);
 
 
-		return light_owner.owns(light->projector);
+		return TextureStorage::get_singleton()->owns_texture(light->projector);
 	}
 	}
 
 
 	_FORCE_INLINE_ bool light_is_negative(RID p_light) const {
 	_FORCE_INLINE_ bool light_is_negative(RID p_light) const {