Don't use trashy max_decals value to prevent crashes
This commit is contained in:
parent
d2e1216504
commit
0c3febca06
1 changed files with 8 additions and 8 deletions
|
@ -8785,6 +8785,14 @@ RendererSceneRenderRD::RendererSceneRenderRD(RendererStorageRD *p_storage) {
|
||||||
default_giprobe_buffer = RD::get_singleton()->uniform_buffer_create(sizeof(GI::GIProbeData) * RenderBuffers::MAX_GIPROBES);
|
default_giprobe_buffer = RD::get_singleton()->uniform_buffer_create(sizeof(GI::GIProbeData) * RenderBuffers::MAX_GIPROBES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ //decals
|
||||||
|
cluster.max_decals = max_cluster_elements;
|
||||||
|
uint32_t decal_buffer_size = cluster.max_decals * sizeof(Cluster::DecalData);
|
||||||
|
cluster.decals = memnew_arr(Cluster::DecalData, cluster.max_decals);
|
||||||
|
cluster.decal_sort = memnew_arr(Cluster::InstanceSort<DecalInstance>, cluster.max_decals);
|
||||||
|
cluster.decal_buffer = RD::get_singleton()->storage_buffer_create(decal_buffer_size);
|
||||||
|
}
|
||||||
|
|
||||||
{ //reflections
|
{ //reflections
|
||||||
|
|
||||||
cluster.max_reflections = max_cluster_elements;
|
cluster.max_reflections = max_cluster_elements;
|
||||||
|
@ -8815,14 +8823,6 @@ RendererSceneRenderRD::RendererSceneRenderRD(RendererStorageRD *p_storage) {
|
||||||
cluster.directional_light_buffer = RD::get_singleton()->uniform_buffer_create(directional_light_buffer_size);
|
cluster.directional_light_buffer = RD::get_singleton()->uniform_buffer_create(directional_light_buffer_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
{ //decals
|
|
||||||
cluster.max_decals = max_cluster_elements;
|
|
||||||
uint32_t decal_buffer_size = cluster.max_decals * sizeof(Cluster::DecalData);
|
|
||||||
cluster.decals = memnew_arr(Cluster::DecalData, cluster.max_decals);
|
|
||||||
cluster.decal_sort = memnew_arr(Cluster::InstanceSort<DecalInstance>, cluster.max_decals);
|
|
||||||
cluster.decal_buffer = RD::get_singleton()->storage_buffer_create(decal_buffer_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!low_end) {
|
if (!low_end) {
|
||||||
String defines = "\n#define MAX_DIRECTIONAL_LIGHT_DATA_STRUCTS " + itos(cluster.max_directional_lights) + "\n";
|
String defines = "\n#define MAX_DIRECTIONAL_LIGHT_DATA_STRUCTS " + itos(cluster.max_directional_lights) + "\n";
|
||||||
Vector<String> volumetric_fog_modes;
|
Vector<String> volumetric_fog_modes;
|
||||||
|
|
Loading…
Reference in a new issue