Fix: EEVEE-Next: Volume: Missing nullptr checks
This was a misusage of the API as it is clearly written that these functions can return `nullptr`. Fixes #114131
This commit is contained in:
@@ -144,11 +144,14 @@ void WorldVolumePipeline::sync(GPUMaterial *gpumat)
|
||||
|
||||
world_ps_.material_set(*inst_.manager, gpumat);
|
||||
/* Bind correct dummy texture for attributes defaults. */
|
||||
volume_sub_pass(world_ps_, nullptr, nullptr, gpumat);
|
||||
PassSimple::Sub *sub = volume_sub_pass(world_ps_, nullptr, nullptr, gpumat);
|
||||
|
||||
world_ps_.draw_procedural(GPU_PRIM_TRIS, 1, 3);
|
||||
/* Sync with object property pass. */
|
||||
world_ps_.barrier(GPU_BARRIER_SHADER_IMAGE_ACCESS);
|
||||
is_valid_ = (sub != nullptr);
|
||||
if (is_valid_) {
|
||||
world_ps_.draw_procedural(GPU_PRIM_TRIS, 1, 3);
|
||||
/* Sync with object property pass. */
|
||||
world_ps_.barrier(GPU_BARRIER_SHADER_IMAGE_ACCESS);
|
||||
}
|
||||
}
|
||||
|
||||
void WorldVolumePipeline::render(View &view)
|
||||
|
||||
@@ -84,7 +84,9 @@ static inline void volume_call(
|
||||
{
|
||||
if (matpass.sub_pass != nullptr) {
|
||||
PassMain::Sub *object_pass = volume_sub_pass(*matpass.sub_pass, scene, ob, matpass.gpumat);
|
||||
object_pass->draw(geom, res_handle);
|
||||
if (object_pass != nullptr) {
|
||||
object_pass->draw(geom, res_handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +361,9 @@ void SyncModule::sync_volume(Object *ob, ObjectHandle & /*ob_handle*/, ResourceH
|
||||
}
|
||||
PassMain::Sub *object_pass = volume_sub_pass(
|
||||
*matpass.sub_pass, inst_.scene, ob, matpass.gpumat);
|
||||
object_pass->draw(geom, res_handle);
|
||||
if (object_pass != nullptr) {
|
||||
object_pass->draw(geom, res_handle);
|
||||
}
|
||||
};
|
||||
|
||||
drawcall_add(material.volume_occupancy, geom, res_handle);
|
||||
|
||||
Reference in New Issue
Block a user