Skip to content

Commit 0c24a1a

Browse files
Update postprocessing_with_vgf and tensor_image_aliasing to latest main
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
1 parent 18db552 commit 0c24a1a

5 files changed

Lines changed: 26 additions & 12 deletions

File tree

samples/extensions/tensor_and_data_graph/postprocessing_with_vgf/postprocessing_with_vgf.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
PostprocessingWithVgf::PostprocessingWithVgf()
3131
{
32-
set_api_version(VK_API_VERSION_1_3); // Required by the emulation layers
33-
3432
// Declare that we need the data graph and tensor extensions
3533
add_device_extension("VK_ARM_tensors");
3634
add_device_extension("VK_ARM_data_graph");
@@ -39,6 +37,11 @@ PostprocessingWithVgf::PostprocessingWithVgf()
3937
add_device_extension("VK_KHR_deferred_host_operations");
4038
}
4139

40+
uint32_t PostprocessingWithVgf::get_api_version() const
41+
{
42+
return VK_API_VERSION_1_3; // Required by the emulation layers
43+
}
44+
4245
PostprocessingWithVgf::~PostprocessingWithVgf()
4346
{
4447
if (data_graph_pipeline_descriptor_set != VK_NULL_HANDLE)
@@ -112,7 +115,7 @@ bool PostprocessingWithVgf::prepare(const vkb::ApplicationOptions &options)
112115
vkb::ShaderSource frag_shader("base.frag.spv");
113116
auto scene_subpass = std::make_unique<vkb::rendering::subpasses::ForwardSubpassC>(get_render_context(), std::move(vert_shader), std::move(frag_shader), get_scene(), camera);
114117

115-
auto render_pipeline = std::make_unique<vkb::RenderPipeline>();
118+
auto render_pipeline = std::make_unique<vkb::rendering::RenderPipelineC>();
116119
render_pipeline->add_subpass(std::move(scene_subpass));
117120
render_pipeline->prepare();
118121

@@ -135,7 +138,7 @@ bool PostprocessingWithVgf::prepare(const vkb::ApplicationOptions &options)
135138
prepare_data_graph_pipeline_descriptor_set();
136139

137140
// Create a RenderPipeline to blit `output_image` to the swapchain
138-
blit_pipeline = std::make_unique<vkb::RenderPipeline>();
141+
blit_pipeline = std::make_unique<vkb::rendering::RenderPipelineC>();
139142
blit_pipeline->add_subpass(std::make_unique<BlitSubpass>(get_render_context(), output_image_view.get()));
140143
blit_pipeline->prepare();
141144

samples/extensions/tensor_and_data_graph/postprocessing_with_vgf/postprocessing_with_vgf.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ class PostprocessingWithVgf : public vkb::VulkanSampleC
9292

9393
void draw_gui() override;
9494

95+
private:
96+
// from vkb::VulkanSample
97+
uint32_t get_api_version() const override;
98+
9599
private:
96100
VgfData load_vgf(const std::string &vgf_file_path);
97101

@@ -144,7 +148,7 @@ class PostprocessingWithVgf : public vkb::VulkanSampleC
144148
std::unique_ptr<ExternallyAllocatedTensor> output_tensor;
145149
std::unique_ptr<TensorView> output_tensor_view;
146150

147-
std::unique_ptr<vkb::RenderPipeline> blit_pipeline;
151+
std::unique_ptr<vkb::rendering::RenderPipelineC> blit_pipeline;
148152

149153
VkDescriptorPool descriptor_pool = VK_NULL_HANDLE;
150154

samples/extensions/tensor_and_data_graph/tensor_and_data_graph_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2024-2025, Arm Limited and Contributors
1+
/* Copyright (c) 2024-2026, Arm Limited and Contributors
22
*
33
* SPDX-License-Identifier: Apache-2.0
44
*
@@ -306,7 +306,7 @@ class ComputePipelineWithTensors : public vkb::core::VulkanResourceC<VkPipeline>
306306
};
307307

308308
/*
309-
* @brief Simple subpass for use with vkb::RenderPipeline, which blits an image to the render target (stretching to fit).
309+
* @brief Simple subpass for use with vkb::rendering::RenderPipelineC, which blits an image to the render target (stretching to fit).
310310
*/
311311
class BlitSubpass : public vkb::rendering::SubpassC
312312
{

samples/extensions/tensor_and_data_graph/tensor_image_aliasing/tensor_image_aliasing.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
TensorImageAliasing::TensorImageAliasing()
2828
{
29-
set_api_version(VK_API_VERSION_1_3); // Required by the emulation layers
30-
3129
// Declare that we need the data graph and tensor extensions
3230
add_device_extension("VK_ARM_tensors");
3331
add_device_extension("VK_ARM_data_graph");
@@ -36,6 +34,11 @@ TensorImageAliasing::TensorImageAliasing()
3634
add_device_extension("VK_KHR_deferred_host_operations");
3735
}
3836

37+
uint32_t TensorImageAliasing::get_api_version() const
38+
{
39+
return VK_API_VERSION_1_3; // Required by the emulation layers
40+
}
41+
3942
TensorImageAliasing::~TensorImageAliasing()
4043
{
4144
if (data_graph_pipeline_descriptor_set != VK_NULL_HANDLE)
@@ -109,7 +112,7 @@ bool TensorImageAliasing::prepare(const vkb::ApplicationOptions &options)
109112
vkb::ShaderSource frag_shader("base.frag.spv");
110113
auto scene_subpass = std::make_unique<vkb::rendering::subpasses::ForwardSubpassC>(get_render_context(), std::move(vert_shader), std::move(frag_shader), get_scene(), camera);
111114

112-
auto render_pipeline = std::make_unique<vkb::RenderPipeline>();
115+
auto render_pipeline = std::make_unique<vkb::rendering::RenderPipelineC>();
113116
render_pipeline->add_subpass(std::move(scene_subpass));
114117
render_pipeline->prepare();
115118

@@ -130,7 +133,7 @@ bool TensorImageAliasing::prepare(const vkb::ApplicationOptions &options)
130133
prepare_data_graph_pipeline_descriptor_set();
131134

132135
// Create a RenderPipeline to blit `output_image` to the swapchain
133-
blit_pipeline = std::make_unique<vkb::RenderPipeline>();
136+
blit_pipeline = std::make_unique<vkb::rendering::RenderPipelineC>();
134137
blit_pipeline->add_subpass(std::make_unique<BlitSubpass>(get_render_context(), output_image_view.get()));
135138
blit_pipeline->prepare();
136139

samples/extensions/tensor_and_data_graph/tensor_image_aliasing/tensor_image_aliasing.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ class TensorImageAliasing : public vkb::VulkanSampleC
5757

5858
void draw_gui() override;
5959

60+
private:
61+
// from vkb::VulkanSample
62+
uint32_t get_api_version() const override;
63+
6064
private:
6165
void prepare_scene_render_target(uint32_t width, uint32_t height);
6266

@@ -109,7 +113,7 @@ class TensorImageAliasing : public vkb::VulkanSampleC
109113
std::unique_ptr<ExternallyAllocatedTensor> output_tensor;
110114
std::unique_ptr<TensorView> output_tensor_view;
111115

112-
std::unique_ptr<vkb::RenderPipeline> blit_pipeline;
116+
std::unique_ptr<vkb::rendering::RenderPipelineC> blit_pipeline;
113117

114118
VkDescriptorPool descriptor_pool = VK_NULL_HANDLE;
115119

0 commit comments

Comments
 (0)