summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2023-02-06 12:12:47 -0800
committerclayjohn <claynjohn@gmail.com>2023-02-06 12:12:47 -0800
commit56450fb179a41d5a3b85ce40cd89793761b86646 (patch)
treeb2b08ef00892c7cc70d8439164670d7054a4f688 /drivers
parent5eb2011423fd96d42f97757b6e582712498180c3 (diff)
Implement cull_mask for decals and lights in mobile and compatibility backends
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/storage/light_storage.cpp7
-rw-r--r--drivers/gles3/storage/light_storage.h8
-rw-r--r--drivers/gles3/storage/texture_storage.h1
3 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gles3/storage/light_storage.cpp b/drivers/gles3/storage/light_storage.cpp
index 138498220d..026f7467a8 100644
--- a/drivers/gles3/storage/light_storage.cpp
+++ b/drivers/gles3/storage/light_storage.cpp
@@ -311,6 +311,13 @@ uint64_t LightStorage::light_get_version(RID p_light) const {
return light->version;
}
+uint32_t LightStorage::light_get_cull_mask(RID p_light) const {
+ const Light *light = light_owner.get_or_null(p_light);
+ ERR_FAIL_COND_V(!light, 0);
+
+ return light->cull_mask;
+}
+
AABB LightStorage::light_get_aabb(RID p_light) const {
const Light *light = light_owner.get_or_null(p_light);
ERR_FAIL_COND_V(!light, AABB());
diff --git a/drivers/gles3/storage/light_storage.h b/drivers/gles3/storage/light_storage.h
index f6f7628a90..8e6480869b 100644
--- a/drivers/gles3/storage/light_storage.h
+++ b/drivers/gles3/storage/light_storage.h
@@ -239,13 +239,6 @@ public:
return light->color;
}
- _FORCE_INLINE_ uint32_t light_get_cull_mask(RID p_light) {
- const Light *light = light_owner.get_or_null(p_light);
- ERR_FAIL_COND_V(!light, 0);
-
- return light->cull_mask;
- }
-
_FORCE_INLINE_ bool light_is_distance_fade_enabled(RID p_light) {
const Light *light = light_owner.get_or_null(p_light);
return light->distance_fade;
@@ -297,6 +290,7 @@ public:
virtual RS::LightBakeMode light_get_bake_mode(RID p_light) override;
virtual uint32_t light_get_max_sdfgi_cascade(RID p_light) override { return 0; }
virtual uint64_t light_get_version(RID p_light) const override;
+ virtual uint32_t light_get_cull_mask(RID p_light) const override;
/* LIGHT INSTANCE API */
diff --git a/drivers/gles3/storage/texture_storage.h b/drivers/gles3/storage/texture_storage.h
index 017e74fc4d..fedda6b260 100644
--- a/drivers/gles3/storage/texture_storage.h
+++ b/drivers/gles3/storage/texture_storage.h
@@ -585,6 +585,7 @@ public:
virtual void decal_set_normal_fade(RID p_decal, float p_fade) override;
virtual AABB decal_get_aabb(RID p_decal) const override;
+ virtual uint32_t decal_get_cull_mask(RID p_decal) const override { return 0; }
virtual void texture_add_to_decal_atlas(RID p_texture, bool p_panorama_to_dp = false) override {}
virtual void texture_remove_from_decal_atlas(RID p_texture, bool p_panorama_to_dp = false) override {}