Repository navigation
Unify helper structs and functions from [hpp_]vk_common.h - #1595
asuessenbach wants to merge 6 commits into
Conversation
d6720c3 to
3cf2e2d
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
This PR unifies several Vulkan helper structs previously split between vk_common.h and hpp_vk_common.h into templated, binding-type aware versions, and relocates related helper utilities into more focused headers/sources.
Changes:
- Introduces templated
vkb::common::{BufferMemoryBarrier, ImageMemoryBarrier, LoadStoreInfo}<BindingType>and migrates call sites across samples/framework. - Moves G-buffer helper functions out of
vk_common.[h|cpp]intocommon/g_buffer.[h|cpp]. - Cleans up includes by removing broad
vk_common.husage and adding more specific headers where needed.
| File | Description |
|---|---|
| samples/tooling/profiles/profiles.h | Removes reliance on vk_common.h from the sample header. |
| samples/tooling/profiles/profiles.cpp | Replaces vk_common.h include with vk_initializers.h. |
| samples/performance/wait_idle/wait_idle.cpp | Drops vk_common.h include after helper migration. |
| samples/performance/texture_compression_basisu/texture_compression_basisu.cpp | Adds vk_initializers.h include to replace prior common include usage. |
| samples/performance/surface_rotation/surface_rotation.h | Drops vk_common.h include. |
| samples/performance/subpasses/subpasses.cpp | Switches to common/g_buffer.h and new image barrier type. |
| samples/performance/render_passes/render_passes.cpp | Updates load/store vector type to unified templated helper. |
| samples/performance/pipeline_cache/pipeline_cache.h | Drops vk_common.h include. |
| samples/performance/pipeline_barriers/pipeline_barriers.cpp | Uses common/g_buffer.h and new image barrier helper initializers. |
| samples/performance/multithreading_render_passes/multithreading_render_passes.cpp | Replaces old image barrier struct usage with unified helper. |
| samples/performance/multi_draw_indirect/multi_draw_indirect.cpp | Uses unified buffer barrier type and adds vk_initializers.h. |
| samples/performance/msaa/msaa.h | Updates load/store types to vkb::common::LoadStoreInfoC. |
| samples/performance/msaa/msaa.cpp | Replaces old barrier usage with unified helper types. |
| samples/performance/layout_transitions/layout_transitions.cpp | Uses common/g_buffer.h and unified image barrier types. |
| samples/performance/image_compression_control/image_compression_control.h | Updates load/store info member type to unified helper. |
| samples/performance/image_compression_control/image_compression_control.cpp | Drops vk_common.h include. |
| samples/performance/descriptor_management/descriptor_management.cpp | Drops vk_common.h include. |
| samples/performance/constant_data/constant_data.cpp | Drops vk_common.h include. |
| samples/performance/async_compute/async_compute.cpp | Switches to unified image barrier type and adds vk_initializers.h. |
| samples/performance/afbc/afbc.cpp | Drops vk_common.h include. |
| samples/performance/16bit_arithmetic/16bit_arithmetic.h | Updates load/store type to unified helper. |
| samples/performance/16bit_arithmetic/16bit_arithmetic.cpp | Uses unified buffer/image barrier helper types. |
| samples/general/mobile_nerf_rayquery/mobile_nerf_rayquery.cpp | Adds vk_initializers.h include. |
| samples/general/mobile_nerf/mobile_nerf.cpp | Adds vk_initializers.h include. |
| samples/extensions/vertex_dynamic_state/vertex_dynamic_state.cpp | Adds vk_initializers.h include. |
| samples/extensions/tensor_and_data_graph/tensor_image_aliasing/tensor_image_aliasing.cpp | Drops vk_common.h include. |
| samples/extensions/tensor_and_data_graph/simple_tensor_and_data_graph/simple_tensor_and_data_graph.cpp | Replaces old image barrier structs with unified helper. |
| samples/extensions/tensor_and_data_graph/postprocessing_with_vgf/postprocessing_with_vgf.cpp | Drops vk_common.h include. |
| samples/extensions/tensor_and_data_graph/graph_constants/graph_constants.cpp | Migrates image barriers to unified helper. |
| samples/extensions/tensor_and_data_graph/compute_shaders_with_tensors/compute_shaders_with_tensors.cpp | Migrates image barriers to unified helper. |
| samples/extensions/synchronization_2/synchronization_2.cpp | Adds vk_initializers.h include. |
| samples/extensions/sparse_image/sparse_image.cpp | Adds vk_initializers.h include. |
| samples/extensions/shader_relaxed_extended_instruction/shader_relaxed_extended_instruction.cpp | Drops vk_common.h, keeps vk_initializers.h. |
| samples/extensions/shader_object/shader_object.cpp | Adds vk_initializers.h and reorders standard includes. |
| samples/extensions/shader_debugprintf/shader_debugprintf.cpp | Adds vk_initializers.h include. |
| samples/extensions/ray_tracing_reflection/ray_tracing_reflection.cpp | Adds vk_initializers.h include. |
| samples/extensions/ray_tracing_position_fetch/ray_tracing_position_fetch.cpp | Adds vk_initializers.h include. |
| samples/extensions/ray_tracing_invocation_reorder/ray_tracing_invocation_reorder.cpp | Adds vk_initializers.h and migrates buffer barrier type. |
| samples/extensions/ray_tracing_extended/ray_tracing_extended.cpp | Adds vk_initializers.h and migrates buffer barrier type. |
| samples/extensions/ray_tracing_basic/ray_tracing_basic.cpp | Adds vk_initializers.h include. |
| samples/extensions/ray_queries/ray_queries.cpp | Adds vk_initializers.h include. |
| samples/extensions/rasterization_order_attachment_access/rasterization_order_attachment_access.cpp | Adds vk_initializers.h include. |
| samples/extensions/push_descriptors/push_descriptors.cpp | Adds vk_initializers.h include. |
| samples/extensions/portability/portability.cpp | Adds vk_initializers.h include. |
| samples/extensions/pipeline_binary/pipeline_binary.cpp | Drops vk_common.h, keeps vk_initializers.h. |
| samples/extensions/patch_control_points/patch_control_points.cpp | Adds vk_initializers.h include. |
| samples/extensions/open_gl_interop/open_gl_interop.cpp | Switches to vk_initializers.h and adjusts include ordering. |
| samples/extensions/open_gl_interop/offscreen_context.h | Replaces vk_common.h with direct Vulkan + STL includes. |
| samples/extensions/open_cl_interop_arm/open_cl_interop_arm.cpp | Switches to vk_initializers.h. |
| samples/extensions/open_cl_interop/open_cl_interop.cpp | Switches to vk_initializers.h. |
| samples/extensions/mesh_shading/mesh_shading.cpp | Adds vk_initializers.h include. |
| samples/extensions/mesh_shader_culling/mesh_shader_culling.cpp | Adds vk_initializers.h include. |
| samples/extensions/memory_budget/memory_budget.cpp | Adds vk_initializers.h include. |
| samples/extensions/logic_op_dynamic_state/logic_op_dynamic_state.cpp | Adds vk_initializers.h and normalizes include ordering. |
| samples/extensions/layer_settings/layer_settings.cpp | Drops vk_common.h, keeps vk_initializers.h. |
| samples/extensions/host_image_copy/host_image_copy.cpp | Adds vk_initializers.h include. |
| samples/extensions/gshader_to_mshader/gshader_to_mshader.cpp | Adds vk_initializers.h include. |
| samples/extensions/graphics_pipeline_library/graphics_pipeline_library.cpp | Adds vk_initializers.h include. |
| samples/extensions/full_screen_exclusive/full_screen_exclusive.h | Drops vk_common.h include. |
| samples/extensions/fragment_shading_rate_dynamic/fragment_shading_rate_dynamic.cpp | Adds vk_initializers.h and migrates barrier type usage. |
| samples/extensions/fragment_shading_rate/fragment_shading_rate.cpp | Adds vk_initializers.h include. |
| samples/extensions/fragment_shader_barycentric/fragment_shader_barycentric.cpp | Adds vk_initializers.h include. |
| samples/extensions/fragment_density_map/fragment_density_map.cpp | Adds vk_initializers.h include. |
| samples/extensions/extended_dynamic_state2/extended_dynamic_state2.cpp | Adds vk_initializers.h and adjusts include ordering. |
| samples/extensions/dynamic_rendering_local_read/dynamic_rendering_local_read.cpp | Adds vk_initializers.h include. |
| samples/extensions/dynamic_rendering/dynamic_rendering.cpp | Adds vk_initializers.h include. |
| samples/extensions/dynamic_primitive_clipping/dynamic_primitive_clipping.cpp | Adds vk_initializers.h include. |
| samples/extensions/dynamic_multisample_rasterization/dynamic_multisample_rasterization.cpp | Adds vk_initializers.h include. |
| samples/extensions/dynamic_line_rasterization/dynamic_line_rasterization.cpp | Adds vk_initializers.h include. |
| samples/extensions/dynamic_blending/dynamic_blending.cpp | Switches to vk_initializers.h. |
| samples/extensions/device_fault/device_fault.cpp | Adds vk_initializers.h and migrates buffer barrier type. |
| samples/extensions/descriptor_indexing/descriptor_indexing.cpp | Adds vk_initializers.h include. |
| samples/extensions/descriptor_heap/descriptor_heap.cpp | Adds vk_initializers.h include. |
| samples/extensions/descriptor_buffer_basic/descriptor_buffer_basic.cpp | Adds vk_initializers.h include. |
| samples/extensions/debug_utils/debug_utils.cpp | Adds vk_initializers.h include. |
| samples/extensions/conservative_rasterization/conservative_rasterization.cpp | Adds vk_initializers.h include. |
| samples/extensions/conditional_rendering/conditional_rendering.cpp | Adds vk_initializers.h include. |
| samples/extensions/compute_shader_derivatives/compute_shader_derivatives.cpp | Drops vk_common.h, keeps vk_initializers.h. |
| samples/extensions/color_write_enable/color_write_enable.cpp | Adds vk_initializers.h include. |
| samples/extensions/calibrated_timestamps/calibrated_timestamps.cpp | Adds vk_initializers.h include. |
| samples/extensions/buffer_device_address/buffer_device_address.cpp | Adds vk_initializers.h and migrates buffer barrier type. |
| samples/complex/render_octomap/render_octomap.cpp | Adds vk_initializers.h include. |
| samples/api/timestamp_queries/timestamp_queries.cpp | Adds vk_initializers.h include. |
| samples/api/texture_mipmap_generation/texture_mipmap_generation.cpp | Adds vk_initializers.h include. |
| samples/api/texture_loading/texture_loading.cpp | Adds vk_initializers.h include. |
| samples/api/terrain_tessellation/terrain_tessellation.cpp | Adds vk_initializers.h include. |
| samples/api/swapchain_recreation/swapchain_recreation.h | Drops vk_common.h include. |
| samples/api/swapchain_recreation/swapchain_recreation.cpp | Drops vk_common.h include. |
| samples/api/swapchain_present_timing/swapchain_present_timing.h | Drops vk_common.h include. |
| samples/api/swapchain_present_timing/swapchain_present_timing.cpp | Drops vk_common.h include. |
| samples/api/separate_image_sampler/separate_image_sampler.cpp | Adds vk_initializers.h include. |
| samples/api/oit_linked_lists/oit_linked_lists.cpp | Adds vk_initializers.h include. |
| samples/api/oit_depth_peeling/oit_depth_peeling.cpp | Adds vk_initializers.h include. |
| samples/api/instancing/instancing.cpp | Adds vk_initializers.h include. |
| samples/api/hpp_texture_mipmap_generation/hpp_texture_mipmap_generation.cpp | Removes hpp_vk_common.h include in favor of unified helpers. |
| samples/api/hpp_hello_triangle/hpp_hello_triangle.h | Fixes include paths/order and adds VMA include. |
| samples/api/hello_triangle_1_3/hello_triangle_1_3.h | Drops vk_common.h include. |
| samples/api/hello_triangle_1_3/hello_triangle_1_3.cpp | Drops vk_common.h include. |
| samples/api/hello_triangle/hello_triangle.h | Replaces vk_common.h with direct VMA include. |
| samples/api/hello_triangle/hello_triangle.cpp | Drops vk_common.h include. |
| samples/api/hdr/hdr.cpp | Adds vk_initializers.h include. |
| samples/api/dynamic_uniform_buffers/dynamic_uniform_buffers.cpp | Adds vk_initializers.h and fixes destructor spacing. |
| samples/api/compute_nbody/compute_nbody.cpp | Adds vk_initializers.h include. |
| framework/vulkan_sample.h | Migrates HPP image barriers to unified ImageMemoryBarrierCpp. |
| framework/stats/stats_provider.h | Adds missing <unordered_map> include after include cleanup. |
| framework/scene_graph/node.h | Adds missing <unordered_map> include after include cleanup. |
| framework/scene_graph/components/sub_mesh.h | Drops vk_common.h include to reduce transitive dependencies. |
| framework/scene_graph/components/image/astc.h | Drops vk_common.h include to reduce transitive dependencies. |
| framework/resource_replay.cpp | Drops vk_common.h include; updates load/store type. |
| framework/resource_record.h | Updates render-pass registration API to use unified load/store type. |
| framework/resource_record.cpp | Updates function signature to unified load/store type. |
| framework/resource_cache.h | Updates render-pass request API to unified load/store type. |
| framework/resource_cache.cpp | Updates function signature to unified load/store type. |
| framework/rendering/render_target.h | Drops hpp_vk_common.h include. |
| framework/rendering/render_pipeline.h | Switches load/store API to unified helper and updates internal storage. |
| framework/rendering/postprocessing_renderpass.h | Updates load store container type to unified helper. |
| framework/rendering/postprocessing_renderpass.cpp | Migrates image barriers to unified helper types. |
| framework/platform/window.h | Drops vk_common.h include. |
| framework/platform/platform.h | Drops vk_common.h include. |
| framework/platform/glfw_window.h | Drops vk_common.h include. |
| framework/hpp_resource_record.h | Updates HPP resource record to unified load/store types. |
| framework/hpp_resource_cache.h | Updates HPP resource cache to unified load/store types. |
| framework/hpp_resource_cache.cpp | Updates function signature to unified load/store types. |
| framework/gui.h | Migrates HPP image barriers to unified ImageMemoryBarrierCpp. |
| framework/gltf_loader.h | Drops vk_common.h include. |
| framework/gltf_loader.cpp | Migrates image barriers to unified helper and drops vk_common.h include. |
| framework/core/render_pass.h | Adds common/load_store_info.h include and updates API types. |
| framework/core/render_pass.cpp | Updates load/store usage to unified helper type. |
| framework/core/pipeline_layout.h | Drops vk_common.h include. |
| framework/core/pipeline.h | Drops vk_common.h include. |
| framework/core/instance.h | Adds <volk.h> include after vk_common.h cleanup. |
| framework/core/image_view.h | Drops vk_common.h include. |
| framework/core/hpp_render_pass.h | Updates HPP render pass wrapper to unified load/store types. |
| framework/core/hpp_image_view.cpp | Drops hpp_vk_common.h include. |
| framework/core/command_buffer.h | Replaces old barrier/load-store type plumbing with unified helper headers & types. |
| framework/core/allocated.h | Adds <vk_mem_alloc.h> include after vk_common.h cleanup. |
| framework/common/vk_common.h | Removes helper structs and heavy transitive includes; keeps Vulkan C header. |
| framework/common/vk_common.cpp | Adds <volk.h> include and removes in-file gbuffer implementations. |
| framework/common/utils.cpp | Migrates barriers to unified helper types. |
| framework/common/resource_caching.h | Updates hashing for unified load/store type. |
| framework/common/load_store_info.h | Adds new unified templated LoadStoreInfo helper. |
| framework/common/image_memory_barrier.h | Adds new unified templated ImageMemoryBarrier helper. |
| framework/common/hpp_vk_common.h | Removes HPP-only helper structs now replaced by unified templates. |
| framework/common/hpp_resource_caching.h | Updates hashing for unified HPP load/store helper. |
| framework/common/g_buffer.h | Adds new G-buffer helper declarations using unified load/store type. |
| framework/common/g_buffer.cpp | Adds new G-buffer helper implementations moved from vk_common.cpp. |
| framework/common/buffer_memory_barrier.h | Adds new unified templated BufferMemoryBarrier helper. |
| framework/builder_base.h | Adds <vk_mem_alloc.h> include after vk_common.h cleanup. |
| framework/api_vulkan_sample.h | Removes broad vk_common.h/vk_initializers.h includes from header. |
| framework/api_vulkan_sample.cpp | Adds vk_initializers.h include in translation unit. |
| framework/CMakeLists.txt | Registers new common headers/sources with the framework build. |
Review effort: Lite
0d0e97a to
979d55c
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved issues can discard visualization data, call uninitialized Vulkan dispatch functions, and trigger undefined behavior, while changed barrier defaults introduce unnecessary pipeline stalls.
6 open issues
Initialize Vulkan-Hpp dispatcher before querying surface formats · New Preserve output image contents by setting the old layout to GENERAL · New Replace vector reinterpret_cast with element-wise enum conversion · New Restore TOP_OF_PIPE source stage to avoid unnecessary serialization · New Restore BOTTOM_OF_PIPE destination stage to avoid pipeline stalls · New For the C binding (ImageMemoryBarrierC), these defaults are stored asuint32_tbut come from…
1 resolved since last review
Review effort: Balanced
d6f3966 to
7c48282
Compare
|
As usual: no idea why the Antora build step fails. |
There was a problem hiding this comment.
🔵 Needs a closer look
Reinterpreting a vector as a different specialization at line 119 causes undefined behavior; the returned vector must instead be constructed by explicitly converting each flag.
No open issues 🎉
6 resolved since last review
Replace vector reinterpret_cast with element-wise enum conversion Preserve output image contents by setting the old layout to GENERAL Initialize Vulkan-Hpp dispatcher before querying surface formats Restore BOTTOM_OF_PIPE destination stage to avoid pipeline stalls Restore TOP_OF_PIPE source stage to avoid unnecessary serialization For the C binding (ImageMemoryBarrierC), these defaults are stored asuint32_tbut come from…
Review effort: Balanced
|
This change produces visibly different colours on some samples, hello_triangle is one of them. My guess is that there's an unintended change somewhere there that affects sRGB handling. |
7c48282 to
2db15a8
Compare
tomek-brcm
left a comment
There was a problem hiding this comment.
The hello_trianlge samples bypass the framework and have similar unintentional sRGB->UNORM change. Original code also had a _PACK32 variant on the list. This PR replaced it by a 565 format. It's not very useful (unless RAM crisis gets substantially worse) and it doesn't have sRGB variant so the hardware won't apply the conversion and the shader code doesn't do it either.
The eColorAttachmentBlend test was replaced by eColorAttachment, again, likely unintentional.
|
@tomek-brcm Thanks for spotting all those unintentional changes! |
68a4563 to
cb5ade5
Compare
|
The Clang Format Check found formatting that differs from the project style (clang-format 21.1.8). The changes could not be offered as inline suggestions. Save the patch below as Formatting patchdiff --git a/framework/core/device.h b/framework/core/device.h
index 43f5cc81..6549e2a2 100644
--- a/framework/core/device.h
+++ b/framework/core/device.h
@@ -360,4 +360,4 @@ inline std::pair<typename Device<bindingType>::ImageType, typename Device<bindin
- Extent2DType const &extent,
- uint32_t mip_levels,
- ImageUsageFlagsType usage,
- MemoryPropertyFlagsType properties) const
+ Extent2DType const &extent,
+ uint32_t mip_levels,
+ ImageUsageFlagsType usage,
+ MemoryPropertyFlagsType properties) const
@@ -373,5 +373,5 @@ inline std::pair<typename Device<bindingType>::ImageType, typename Device<bindin
- static_cast<VkFormat>(format),
- static_cast<VkExtent2D>(extent),
- mip_levels,
- static_cast<VkImageUsageFlags>(usage),
- static_cast<VkMemoryPropertyFlags>(properties)));
+ static_cast<VkFormat>(format),
+ static_cast<VkExtent2D>(extent),
+ mip_levels,
+ static_cast<VkImageUsageFlags>(usage),
+ static_cast<VkMemoryPropertyFlags>(properties)));
@@ -631,5 +631,5 @@ inline std::pair<vk::Image, vk::DeviceMemory>
- vk::Format format,
- vk::Extent2D const &extent,
- uint32_t mip_levels,
- vk::ImageUsageFlags usage,
- vk::MemoryPropertyFlags properties) const
+ vk::Format format,
+ vk::Extent2D const &extent,
+ uint32_t mip_levels,
+ vk::ImageUsageFlags usage,
+ vk::MemoryPropertyFlags properties) const
@@ -708 +708 @@ vkb::core::HPPQueue const &Device<bindingType>::get_queue_by_flags_impl(vk::Queu
- (queue_index < properties.queueCount);
+ (queue_index < properties.queueCount);
@@ -722 +722 @@ inline void
- std::function<void(vkb::core::PhysicalDevice<bindingType> &)> request_gpu_features)
+ std::function<void(vkb::core::PhysicalDevice<bindingType> &)> request_gpu_features)
diff --git a/framework/core/hpp_image_view.cpp b/framework/core/hpp_image_view.cpp
index 041be360..4713e124 100644
--- a/framework/core/hpp_image_view.cpp
+++ b/framework/core/hpp_image_view.cpp
@@ -43 +43 @@ HPPImageView::HPPImageView(vkb::core::HPPImage &img,
- vk::ImageAspectFlagBits::eColor,
+ vk::ImageAspectFlagBits::eColor,
diff --git a/framework/core/hpp_render_pass.h b/framework/core/hpp_render_pass.h
index c143e4c2..db32bfd7 100644
--- a/framework/core/hpp_render_pass.h
+++ b/framework/core/hpp_render_pass.h
@@ -62,3 +62,3 @@ class HPPRenderPass : private vkb::RenderPass
- reinterpret_cast<std::vector<vkb::rendering::AttachmentC> const &>(attachments),
- reinterpret_cast<std::vector<vkb::common::LoadStoreInfoC> const &>(load_store_infos),
- reinterpret_cast<std::vector<vkb::SubpassInfo> const &>(subpasses))
+ reinterpret_cast<std::vector<vkb::rendering::AttachmentC> const &>(attachments),
+ reinterpret_cast<std::vector<vkb::common::LoadStoreInfoC> const &>(load_store_infos),
+ reinterpret_cast<std::vector<vkb::SubpassInfo> const &>(subpasses))
diff --git a/framework/core/hpp_swapchain.cpp b/framework/core/hpp_swapchain.cpp
index 77440283..e843d5fc 100644
--- a/framework/core/hpp_swapchain.cpp
+++ b/framework/core/hpp_swapchain.cpp
@@ -164,2 +164,2 @@ vk::CompositeAlphaFlagBitsKHR choose_composite_alpha(vk::CompositeAlphaFlagBitsK
- composite_alpha_priority_list.end(),
- [&supported_composite_alpha](vk::CompositeAlphaFlagBitsKHR composite_alpha) {
+ composite_alpha_priority_list.end(),
+ [&supported_composite_alpha](vk::CompositeAlphaFlagBitsKHR composite_alpha) {
@@ -216 +216 @@ std::set<vk::ImageUsageFlagBits> choose_image_usage(const std::set<vk::ImageUsag
- validate_format_feature(image_usage, supported_features));
+ validate_format_feature(image_usage, supported_features));
@@ -257,11 +257,11 @@ HPPSwapchain::HPPSwapchain(HPPSwapchain &old_swapchain, const vk::Extent2D &exte
- old_swapchain.device,
- old_swapchain.surface,
- old_swapchain.properties.present_mode,
- old_swapchain.present_mode_priority_list,
- old_swapchain.surface_format_priority_list,
- extent,
- old_swapchain.properties.image_count,
- old_swapchain.properties.pre_transform,
- old_swapchain.image_usage_flags,
- old_swapchain.requested_compression,
- old_swapchain.requested_compression_fixed_rate}
+ old_swapchain.device,
+ old_swapchain.surface,
+ old_swapchain.properties.present_mode,
+ old_swapchain.present_mode_priority_list,
+ old_swapchain.surface_format_priority_list,
+ extent,
+ old_swapchain.properties.image_count,
+ old_swapchain.properties.pre_transform,
+ old_swapchain.image_usage_flags,
+ old_swapchain.requested_compression,
+ old_swapchain.requested_compression_fixed_rate}
@@ -272,11 +272,11 @@ HPPSwapchain::HPPSwapchain(HPPSwapchain &old_swapchain, const uint32_t image_cou
- old_swapchain.device,
- old_swapchain.surface,
- old_swapchain.properties.present_mode,
- old_swapchain.present_mode_priority_list,
- old_swapchain.surface_format_priority_list,
- old_swapchain.properties.extent,
- image_count,
- old_swapchain.properties.pre_transform,
- old_swapchain.image_usage_flags,
- old_swapchain.requested_compression,
- old_swapchain.requested_compression_fixed_rate}
+ old_swapchain.device,
+ old_swapchain.surface,
+ old_swapchain.properties.present_mode,
+ old_swapchain.present_mode_priority_list,
+ old_swapchain.surface_format_priority_list,
+ old_swapchain.properties.extent,
+ image_count,
+ old_swapchain.properties.pre_transform,
+ old_swapchain.image_usage_flags,
+ old_swapchain.requested_compression,
+ old_swapchain.requested_compression_fixed_rate}
@@ -287,11 +287,11 @@ HPPSwapchain::HPPSwapchain(HPPSwapchain &old_swapchain, const std::set<vk::Image
- old_swapchain.device,
- old_swapchain.surface,
- old_swapchain.properties.present_mode,
- old_swapchain.present_mode_priority_list,
- old_swapchain.surface_format_priority_list,
- old_swapchain.properties.extent,
- old_swapchain.properties.image_count,
- old_swapchain.properties.pre_transform,
- image_usage_flags,
- old_swapchain.requested_compression,
- old_swapchain.requested_compression_fixed_rate}
+ old_swapchain.device,
+ old_swapchain.surface,
+ old_swapchain.properties.present_mode,
+ old_swapchain.present_mode_priority_list,
+ old_swapchain.surface_format_priority_list,
+ old_swapchain.properties.extent,
+ old_swapchain.properties.image_count,
+ old_swapchain.properties.pre_transform,
+ image_usage_flags,
+ old_swapchain.requested_compression,
+ old_swapchain.requested_compression_fixed_rate}
@@ -304,11 +304,11 @@ HPPSwapchain::HPPSwapchain(HPPSwapchain &old_swapchain,
- old_swapchain.device,
- old_swapchain.surface,
- old_swapchain.properties.present_mode,
- old_swapchain.present_mode_priority_list,
- old_swapchain.surface_format_priority_list,
- extent,
- old_swapchain.properties.image_count,
- transform,
- old_swapchain.image_usage_flags,
- old_swapchain.requested_compression,
- old_swapchain.requested_compression_fixed_rate}
+ old_swapchain.device,
+ old_swapchain.surface,
+ old_swapchain.properties.present_mode,
+ old_swapchain.present_mode_priority_list,
+ old_swapchain.surface_format_priority_list,
+ extent,
+ old_swapchain.properties.image_count,
+ transform,
+ old_swapchain.image_usage_flags,
+ old_swapchain.requested_compression,
+ old_swapchain.requested_compression_fixed_rate}
@@ -321,11 +321,11 @@ HPPSwapchain::HPPSwapchain(HPPSwapchain &old_swapc
- old_swapchain.device,
- old_swapchain.surface,
- old_swapchain.properties.present_mode,
- old_swapchain.present_mode_priority_list,
- old_swapchain.surface_format_priority_list,
- old_swapchain.properties.extent,
- old_swapchain.properties.image_count,
- old_swapchain.properties.pre_transform,
- old_swapchain.image_usage_flags,
- requested_compression,
- requested_compression_fixed_rate}
+ old_swapchain.device,
+ old_swapchain.surface,
+ old_swapchain.properties.present_mode,
+ old_swapchain.present_mode_priority_list,
+ old_swapchain.surface_format_priority_list,
+ old_swapchain.properties.extent,
+ old_swapchain.properties.image_count,
+ old_swapchain.properties.pre_transform,
+ old_swapchain.image_usage_flags,
+ requested_compression,
+ requested_compression_fixed_rate}
@@ -346,9 +346,9 @@ HPPSwapchain::HPPSwapchain(vkb::core::DeviceCpp &device,
- device,
- surface,
- present_mode,
- present_mode_priority_list,
- surface_format_priority_list,
- extent,
- image_count,
- transform,
- image_usage_flags}
+ device,
+ surface,
+ present_mode,
+ present_mode_priority_list,
+ surface_format_priority_list,
+ extent,
+ image_count,
+ transform,
+ image_usage_flags}
diff --git a/framework/core/image_core.cpp b/framework/core/image_core.cpp
index 32fd6b0c..c2c3e7a3 100644
--- a/framework/core/image_core.cpp
+++ b/framework/core/image_core.cpp
@@ -95,12 +95,12 @@ Image::Image(vkb::core::DeviceC &device,
- ImageBuilder(extent)
- .with_format(format)
- .with_image_type(find_image_type(extent))
- .with_usage(image_usage)
- .with_mip_levels(mip_levels)
- .with_array_layers(array_layers)
- .with_tiling(tiling)
- .with_flags(flags)
- .with_vma_usage(memory_usage)
- .with_sample_count(sample_count)
- .with_queue_families(num_queue_families, queue_families)
- .with_implicit_sharing_mode())
+ ImageBuilder(extent)
+ .with_format(format)
+ .with_image_type(find_image_type(extent))
+ .with_usage(image_usage)
+ .with_mip_levels(mip_levels)
+ .with_array_layers(array_layers)
+ .with_tiling(tiling)
+ .with_flags(flags)
+ .with_vma_usage(memory_usage)
+ .with_sample_count(sample_count)
+ .with_queue_families(num_queue_families, queue_families)
+ .with_implicit_sharing_mode())
diff --git a/framework/core/pipeline_layout.h b/framework/core/pipeline_layout.h
index 46c9d2af..96e3a62e 100644
--- a/framework/core/pipeline_layout.h
+++ b/framework/core/pipeline_layout.h
@@ -49 +49 @@ class PipelineLayout
- VkShaderStageFlagBits stage = VK_SHADER_STAGE_ALL) const;
+ VkShaderStageFlagBits stage = VK_SHADER_STAGE_ALL) const;
diff --git a/framework/core/render_pass.cpp b/framework/core/render_pass.cpp
index c1160fab..ec55a62a 100644
--- a/framework/core/render_pass.cpp
+++ b/framework/core/render_pass.cpp
@@ -297,3 +297,3 @@ std::vector<T> get_subpass_dependencies(const size_t subpass_count, bool depth_s
- color_dep.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
- color_dep.dstAccessMask = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
- VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
+ color_dep.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
+ color_dep.dstAccessMask = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
@@ -310,7 +310,7 @@ std::vector<T> get_subpass_dependencies(const size_t subpass_count, bool depth_s
- depth_dep.dstStageMask = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
- VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT |
- VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
- depth_dep.srcAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
- depth_dep.dstAccessMask = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT |
- VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
- VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
+ depth_dep.dstStageMask = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
+ VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT |
+ VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
+ depth_dep.srcAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
+ depth_dep.dstAccessMask = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT |
+ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
+ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
diff --git a/framework/core/swapchain.cpp b/framework/core/swapchain.cpp
index 1edb84aa..12fe606c 100644
--- a/framework/core/swapchain.cpp
+++ b/framework/core/swapchain.cpp
@@ -118 +118 @@ inline VkSurfaceFormatKHR choose_surface_format(const VkSurfaceFormatKHR
- surface.colorSpace == requested_surface_format.colorSpace)
+ surface.colorSpace == requested_surface_format.colorSpace)
@@ -220,2 +220,2 @@ inline std::set<VkImageUsageFlagBits>
- VkImageUsageFlags supported_image_usage,
- VkFormatFeatureFlags supported_features)
+ VkImageUsageFlags supported_image_usage,
+ VkFormatFeatureFlags supported_features)
@@ -286,11 +286,11 @@ Swapchain::Swapchain(Swapchain &old_swapchain, const VkExtent2D &extent) :
- old_swapchain.device,
- old_swapchain.surface,
- old_swapchain.properties.present_mode,
- old_swapchain.present_mode_priority_list,
- old_swapchain.surface_format_priority_list,
- extent,
- old_swapchain.properties.image_count,
- old_swapchain.properties.pre_transform,
- old_swapchain.image_usage_flags,
- old_swapchain.requested_compression,
- old_swapchain.requested_compression_fixed_rate}
+ old_swapchain.device,
+ old_swapchain.surface,
+ old_swapchain.properties.present_mode,
+ old_swapchain.present_mode_priority_list,
+ old_swapchain.surface_format_priority_list,
+ extent,
+ old_swapchain.properties.image_count,
+ old_swapchain.properties.pre_transform,
+ old_swapchain.image_usage_flags,
+ old_swapchain.requested_compression,
+ old_swapchain.requested_compression_fixed_rate}
@@ -301,11 +301,11 @@ Swapchain::Swapchain(Swapchain &old_swapchain, const uint32_t image_count) :
- old_swapchain.device,
- old_swapchain.surface,
- old_swapchain.properties.present_mode,
- old_swapchain.present_mode_priority_list,
- old_swapchain.surface_format_priority_list,
- old_swapchain.properties.extent,
- image_count,
- old_swapchain.properties.pre_transform,
- old_swapchain.image_usage_flags,
- old_swapchain.requested_compression,
- old_swapchain.requested_compression_fixed_rate}
+ old_swapchain.device,
+ old_swapchain.surface,
+ old_swapchain.properties.present_mode,
+ old_swapchain.present_mode_priority_list,
+ old_swapchain.surface_format_priority_list,
+ old_swapchain.properties.extent,
+ image_count,
+ old_swapchain.properties.pre_transform,
+ old_swapchain.image_usage_flags,
+ old_swapchain.requested_compression,
+ old_swapchain.requested_compression_fixed_rate}
@@ -316,11 +316,11 @@ Swapchain::Swapchain(Swapchain &old_swapchain, const std::set<VkImageUsageFlagBi
- old_swapchain.device,
- old_swapchain.surface,
- old_swapchain.properties.present_mode,
- old_swapchain.present_mode_priority_list,
- old_swapchain.surface_format_priority_list,
- old_swapchain.properties.extent,
- old_swapchain.properties.image_count,
- old_swapchain.properties.pre_transform,
- image_usage_flags,
- old_swapchain.requested_compression,
- old_swapchain.requested_compression_fixed_rate}
+ old_swapchain.device,
+ old_swapchain.surface,
+ old_swapchain.properties.present_mode,
+ old_swapchain.present_mode_priority_list,
+ old_swapchain.surface_format_priority_list,
+ old_swapchain.properties.extent,
+ old_swapchain.properties.image_count,
+ old_swapchain.properties.pre_transform,
+ image_usage_flags,
+ old_swapchain.requested_compression,
+ old_swapchain.requested_compression_fixed_rate}
@@ -333,11 +333,11 @@ Swapchain::Swapchain(Swapchain &old_swapchain,
- old_swapchain.device,
- old_swapchain.surface,
- old_swapchain.properties.present_mode,
- old_swapchain.present_mode_priority_list,
- old_swapchain.surface_format_priority_list,
- extent,
- old_swapchain.properties.image_count,
- transform,
- old_swapchain.image_usage_flags,
- old_swapchain.requested_compression,
- old_swapchain.requested_compression_fixed_rate}
+ old_swapchain.device,
+ old_swapchain.surface,
+ old_swapchain.properties.present_mode,
+ old_swapchain.present_mode_priority_list,
+ old_swapchain.surface_format_priority_list,
+ extent,
+ old_swapchain.properties.image_count,
+ transform,
+ old_swapchain.image_usage_flags,
+ old_swapchain.requested_compression,
+ old_swapchain.requested_compression_fixed_rate}
@@ -350,11 +350,11 @@ Swapchain::Swapchain(Swapchain &old_swapchain,
- old_swapchain.device,
- old_swapchain.surface,
- old_swapchain.properties.present_mode,
- old_swapchain.present_mode_priority_list,
- old_swapchain.surface_format_priority_list,
- old_swapchain.properties.extent,
- old_swapchain.properties.image_count,
- old_swapchain.properties.pre_transform,
- old_swapchain.image_usage_flags,
- requested_compression,
- requested_compression_fixed_rate}
+ old_swapchain.device,
+ old_swapchain.surface,
+ old_swapchain.properties.present_mode,
+ old_swapchain.present_mode_priority_list,
+ old_swapchain.surface_format_priority_list,
+ old_swapchain.properties.extent,
+ old_swapchain.properties.image_count,
+ old_swapchain.properties.pre_transform,
+ old_swapchain.image_usage_flags,
+ requested_compression,
+ requested_compression_fixed_rate}
@@ -375,9 +375,9 @@ Swapchain::Swapchain(vkb::core::DeviceC &device,
- device,
- surface,
- present_mode,
- present_mode_priority_list,
- surface_format_priority_list,
- extent,
- image_count,
- transform,
- image_usage_flags}
+ device,
+ surface,
+ present_mode,
+ present_mode_priority_list,
+ surface_format_priority_list,
+ extent,
+ image_count,
+ transform,
+ image_usage_flags}
@@ -525 +525 @@ Swapchain::Swapchain(Swapchain &old_swapchain,
- images[0])
+ images[0])
diff --git a/samples/extensions/fragment_shading_rate_dynamic/fragment_shading_rate_dynamic.cpp b/samples/extensions/fragment_shading_rate_dynamic/fragment_shading_rate_dynamic.cpp
index 3b73e99b..72c33bd0 100644
--- a/samples/extensions/fragment_shading_rate_dynamic/fragment_shading_rate_dynamic.cpp
+++ b/samples/extensions/fragment_shading_rate_dynamic/fragment_shading_rate_dynamic.cpp
@@ -180,4 +180,4 @@ void FragmentShadingRateDynamic::create_shading_rate_attachment()
- frequency_image_extent,
- VK_FORMAT_R8G8_UINT,
- VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT,
- VMA_MEMORY_USAGE_GPU_ONLY);
+ frequency_image_extent,
+ VK_FORMAT_R8G8_UINT,
+ VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT,
+ VMA_MEMORY_USAGE_GPU_ONLY);
@@ -613 +613 @@ void FragmentShadingRateDynamic::setup_descriptor_pool()
- num_descriptor_sets);
+ num_descriptor_sets);
@@ -623,2 +623,2 @@ void FragmentShadingRateDynamic::setup_descriptor_set_layout()
- VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT,
- 0),
+ VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT,
+ 0),
@@ -626 +626 @@ void FragmentShadingRateDynamic::setup_descriptor_set_layout()
- VK_SHADER_STAGE_FRAGMENT_BIT, 1), // sampler env map
+ VK_SHADER_STAGE_FRAGMENT_BIT, 1), // sampler env map
@@ -628 +628 @@ void FragmentShadingRateDynamic::setup_descriptor_set_layout()
- VK_SHADER_STAGE_FRAGMENT_BIT, 2), // sampler sphere
+ VK_SHADER_STAGE_FRAGMENT_BIT, 2), // sampler sphere
@@ -630,2 +630,2 @@ void FragmentShadingRateDynamic::setup_descriptor_set_layout()
- VK_SHADER_STAGE_FRAGMENT_BIT,
- 3), // input_frequency
+ VK_SHADER_STAGE_FRAGMENT_BIT,
+ 3), // input_frequency
@@ -633,2 +633,2 @@ void FragmentShadingRateDynamic::setup_descriptor_set_layout()
- VK_SHADER_STAGE_FRAGMENT_BIT,
- 4) // output_sampling_rate
+ VK_SHADER_STAGE_FRAGMENT_BIT,
+ 4) // output_sampling_rate
@@ -639 +639 @@ void FragmentShadingRateDynamic::setup_descriptor_set_layout()
- static_cast<uint32_t>(set_layout_bindings.size()));
+ static_cast<uint32_t>(set_layout_bindings.size()));
@@ -690 +690 @@ void FragmentShadingRateDynamic::setup_descriptor_sets()
- &scene_buffer_descriptor),
+ &scene_buffer_descriptor),
@@ -692 +692 @@ void FragmentShadingRateDynamic::setup_descriptor_sets()
- &environment_image_descriptor),
+ &environment_image_descriptor),
@@ -694 +694 @@ void FragmentShadingRateDynamic::setup_descriptor_sets()
- &sphere_image_descriptor),
+ &sphere_image_descriptor),
@@ -696 +696 @@ void FragmentShadingRateDynamic::setup_descriptor_sets()
- &frequency_descriptor),
+ &frequency_descriptor),
@@ -698,2 +698,2 @@ void FragmentShadingRateDynamic::setup_descriptor_sets()
- &shading_image),
- };
+ &shading_image),
+ };
@@ -710 +710 @@ void FragmentShadingRateDynamic::create_compute_pipeline()
- VK_SHADER_STAGE_COMPUTE_BIT, 0),
+ VK_SHADER_STAGE_COMPUTE_BIT, 0),
@@ -712 +712 @@ void FragmentShadingRateDynamic::create_compute_pipeline()
- VK_SHADER_STAGE_COMPUTE_BIT, 1),
+ VK_SHADER_STAGE_COMPUTE_BIT, 1),
@@ -714 +714 @@ void FragmentShadingRateDynamic::create_compute_pipeline()
- VK_SHADER_STAGE_COMPUTE_BIT, 2),
+ VK_SHADER_STAGE_COMPUTE_BIT, 2),
@@ -785 +785 @@ void FragmentShadingRateDynamic::update_compute_pipeline()
- compute_buffers[0].shading_rate_image->get_extent().height),
+ compute_buffers[0].shading_rate_image->get_extent().height),
@@ -820 +820 @@ void FragmentShadingRateDynamic::update_compute_pipeline()
- 0, &frequency_image),
+ 0, &frequency_image),
@@ -822 +822 @@ void FragmentShadingRateDynamic::update_compute_pipeline()
- 1, &shading_image),
+ 1, &shading_image),
@@ -824 +824 @@ void FragmentShadingRateDynamic::update_compute_pipeline()
- VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 2, &buffer_info)};
+ VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 2, &buffer_info)};
@@ -984 +984 @@ void FragmentShadingRateDynamic::prepare_pipelines()
- 0), // Position
+ 0), // Position
@@ -986 +986 @@ void FragmentShadingRateDynamic::prepare_pipelines()
- sizeof(float) * 3), // Normal
+ sizeof(float) * 3), // Normal
@@ -988 +988 @@ void FragmentShadingRateDynamic::prepare_pipelines()
- sizeof(float) * 6), // UV
+ sizeof(float) * 6), // UV |
c73598f to
9fa9204
Compare
9fa9204 to
f213d71
Compare
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>



Description
Unify three helper structs from
[hpp_]vk_common.h:vkb::BufferMemoryBarrierandvkb::common::HPPBufferMemoryBarrierintovkb::common::BufferMemoryBarrier<vkb::BindingType>, now incommon/buffer_memory_barrier.hvkb::ImageMemoryBarrierandvkb::common::HPPImageMemoryBarrierintovkb::common::ImageMemoryBarrier<vkb::BindingType>, now incommon/image_memory_barrier.hvkb::LoadStoreInfoandvkb::common::HPPLoadStoreInfointovkb::common::LoadStoreInfo<vkb::BindingType>, now incommon/load_store_info.hIn addition to that
gbuffer-namespace are moved intocommon/g_buffer.[h|cpp][hpp_]vk_common.hare available with two flavours now,Vulkan-HppandVulkan, where theVulkan-Hppversion provides the actual implementation and theVulkanversion just calls into theVulkan-HppversionWith this change, the file
hpp_vk_common.hisn't needed anymore.Build tested on Win11 with VS2026. Run tested on Win11 with NVidia GPU.
General Checklist:
Please ensure the following points are checked:
Note: The Samples CI runs a number of checks including:
If this PR contains framework changes:
batchcommand line argument to make sure all samples still work properlySample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist: