From 7dd0dfe188e84c491a29e7c1b66947073772459e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 19 Feb 2024 12:23:42 +0100 Subject: [PATCH 1/2] Fix: Build error using WITH_GPU_DRAW_TESTS and WITH_VULKAN_BACKEND --- source/blender/draw/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt index 87966f4fac5..9bc077432bf 100644 --- a/source/blender/draw/CMakeLists.txt +++ b/source/blender/draw/CMakeLists.txt @@ -955,6 +955,9 @@ if(WITH_GTESTS) endif() if(WITH_VULKAN_BACKEND) add_definitions(-DWITH_VULKAN_BACKEND) + list(APPEND INC_SYS + PUBLIC ${VULKAN_INCLUDE_DIRS} + ) endif() endif() endif() From 5d06b7b906b39dc6235ed00460df72c3b3f013a7 Mon Sep 17 00:00:00 2001 From: bartus Date: Thu, 15 Feb 2024 14:27:55 +0100 Subject: [PATCH 2/2] Cycles: Add support for OpenPGL 0.6.0 Replace PGLFieldArguments with FieldConfig class for this version. Co-authored-by: Brecht Van Lommel Pull Request: https://projects.blender.org/blender/blender/pulls/118328 --- intern/cycles/integrator/path_trace.cpp | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp index cd5dca34d2a..f627466c9a7 100644 --- a/intern/cycles/integrator/path_trace.cpp +++ b/intern/cycles/integrator/path_trace.cpp @@ -1285,42 +1285,78 @@ void PathTrace::set_guiding_params(const GuidingParams &guiding_params, const bo if (guiding_params_.modified(guiding_params)) { guiding_params_ = guiding_params; +# if !(OPENPGL_VERSION_MAJOR == 0 && OPENPGL_VERSION_MINOR <= 5) +# define OPENPGL_USE_FIELD_CONFIG +# endif + if (guiding_params_.use) { +# ifdef OPENPGL_USE_FIELD_CONFIG + openpgl::cpp::FieldConfig field_config; +# else PGLFieldArguments field_args; +# endif switch (guiding_params_.type) { default: /* Parallax-aware von Mises-Fisher mixture models. */ case GUIDING_TYPE_PARALLAX_AWARE_VMM: { +# ifdef OPENPGL_USE_FIELD_CONFIG + field_config.Init( + PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE, + PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_PARALLAX_AWARE_VMM, + guiding_params.deterministic); +# else pglFieldArgumentsSetDefaults( field_args, PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE, PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_PARALLAX_AWARE_VMM); +# endif break; } /* Directional quad-trees. */ case GUIDING_TYPE_DIRECTIONAL_QUAD_TREE: { +# ifdef OPENPGL_USE_FIELD_CONFIG + field_config.Init( + PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE, + PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_QUADTREE, + guiding_params.deterministic); +# else pglFieldArgumentsSetDefaults( field_args, PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE, PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_QUADTREE); +# endif break; } /* von Mises-Fisher mixture models. */ case GUIDING_TYPE_VMM: { +# ifdef OPENPGL_USE_FIELD_CONFIG + field_config.Init(PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE, + PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_VMM, + guiding_params.deterministic); +# else pglFieldArgumentsSetDefaults( field_args, PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE, PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_VMM); +# endif break; } } +# ifdef OPENPGL_USE_FIELD_CONFIG + field_config.SetSpatialStructureArgMaxDepth(16); +# else field_args.deterministic = guiding_params.deterministic; reinterpret_cast(field_args.spatialSturctureArguments)->maxDepth = 16; +# endif openpgl::cpp::Device *guiding_device = static_cast( device_->get_guiding_device()); if (guiding_device) { guiding_sample_data_storage_ = make_unique(); +# ifdef OPENPGL_USE_FIELD_CONFIG + guiding_field_ = make_unique(guiding_device, field_config); +# else guiding_field_ = make_unique(guiding_device, field_args); +# endif } else { guiding_sample_data_storage_ = nullptr;