Skip to content

Commit

Permalink
[renderer_vulkan2] some extra profiling instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
harrand committed Sep 16, 2023
1 parent cb64df3 commit 894a66f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tz/gl/impl/vulkan/renderer2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ namespace tz::gl
resource_staging_buffers.reserve(renderer_resource_manager::resource_count());
for(std::size_t i = 0; i < renderer_resource_manager::resource_count(); i++)
{
TZ_PROFZONE("Initialise Static Resource", 0xFFAAAA00);
const icomponent* cmp = renderer_resource_manager::get_component(static_cast<tz::hanval>(i));
tz::assert(cmp != nullptr);
const iresource* res = cmp->get_resource();
Expand All @@ -949,16 +950,20 @@ namespace tz::gl
{
// create staging buffers and copy over spans.
case tz::gl::resource_type::buffer:
{
TZ_PROFZONE("Staging Buffer - Buffer", 0xFFAAAA00);
resource_staging_buffers.push_back
({{
.device = &tz::gl::get_device().vk_get_logical_device(),
.size_bytes = res->data().size_bytes(),
.usage = {vk2::BufferUsage::TransferSource},
.residency = vk2::MemoryResidency::CPU
}});
}
break;
case tz::gl::resource_type::image:
{
TZ_PROFZONE("Staging Buffer - Image", 0xFFAAAA00);
auto* img = static_cast<const image_component_vulkan*>(cmp);
tz::assert(img != nullptr);
resource_staging_buffers.push_back
Expand All @@ -979,6 +984,7 @@ namespace tz::gl
tz::assert(new_buf.size() == res->data().size_bytes());
// write resource data
{
TZ_PROFZONE("Resource Span Map/Write/Unmap", 0xFFAAAA00);
void* mapped_ptr = new_buf.map();
std::memcpy(mapped_ptr, res->data().data(), res->data().size_bytes());
new_buf.unmap();
Expand Down

0 comments on commit 894a66f

Please sign in to comment.