mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-05 15:56:49 +00:00
vk/dma: Simplify map_dma interface
This commit is contained in:
parent
4b858648e5
commit
3632412c48
@ -157,7 +157,7 @@ namespace vk
|
||||
return inheritance_info.parent->head();
|
||||
}
|
||||
|
||||
void dma_block::set_parent(const command_buffer& cmd, dma_block* parent)
|
||||
void dma_block::set_parent(dma_block* parent)
|
||||
{
|
||||
ensure(parent);
|
||||
ensure(parent->base_address < base_address);
|
||||
@ -178,7 +178,7 @@ namespace vk
|
||||
}
|
||||
}
|
||||
|
||||
void dma_block::extend(const command_buffer& cmd, const render_device& dev, usz new_size)
|
||||
void dma_block::extend(const render_device& dev, usz new_size)
|
||||
{
|
||||
ensure(allocated_memory);
|
||||
if (new_size <= allocated_memory->size())
|
||||
@ -278,7 +278,7 @@ namespace vk
|
||||
block->init(*g_render_device, base_address, expected_length);
|
||||
}
|
||||
|
||||
std::pair<u32, vk::buffer*> map_dma(const command_buffer& cmd, u32 local_address, u32 length)
|
||||
std::pair<u32, vk::buffer*> map_dma(u32 local_address, u32 length)
|
||||
{
|
||||
// Not much contention expected here, avoid searching twice
|
||||
std::lock_guard lock(g_dma_mutex);
|
||||
@ -338,7 +338,7 @@ namespace vk
|
||||
else if (entry)
|
||||
{
|
||||
ensure((entry->end() & s_dma_block_mask) <= last_block);
|
||||
entry->set_parent(cmd, block_head);
|
||||
entry->set_parent(block_head);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
namespace vk
|
||||
{
|
||||
std::pair<u32, vk::buffer*> map_dma(const command_buffer& cmd, u32 local_address, u32 length);
|
||||
std::pair<u32, vk::buffer*> map_dma(u32 local_address, u32 length);
|
||||
void load_dma(u32 local_address, u32 length);
|
||||
void flush_dma(u32 local_address, u32 length);
|
||||
void unmap_dma(u32 local_address, u32 length);
|
||||
@ -46,8 +46,8 @@ namespace vk
|
||||
|
||||
dma_block* head();
|
||||
const dma_block* head() const;
|
||||
virtual void set_parent(const command_buffer& cmd, dma_block* parent);
|
||||
virtual void extend(const command_buffer& cmd, const render_device& dev, usz new_size);
|
||||
virtual void set_parent(dma_block* parent);
|
||||
virtual void extend(const render_device& dev, usz new_size);
|
||||
};
|
||||
|
||||
class dma_block_EXT: public dma_block
|
||||
|
@ -906,7 +906,7 @@ namespace vk
|
||||
src_address = uptr(base_addr) - uptr(vm::g_base_addr);
|
||||
}
|
||||
|
||||
auto dma_mapping = vk::map_dma(cmd, static_cast<u32>(src_address), static_cast<u32>(data_length));
|
||||
auto dma_mapping = vk::map_dma(static_cast<u32>(src_address), static_cast<u32>(data_length));
|
||||
|
||||
ensure(dma_mapping.second->size() >= (dma_mapping.first + data_length));
|
||||
vk::load_dma(::narrow<u32>(src_address), data_length);
|
||||
|
@ -45,7 +45,7 @@ namespace vk
|
||||
const auto task_length = transfer_pitch * src_area.height();
|
||||
|
||||
auto working_buffer = vk::get_scratch_buffer(task_length);
|
||||
auto final_mapping = vk::map_dma(cmd, valid_range.start, section_length);
|
||||
auto final_mapping = vk::map_dma(valid_range.start, section_length);
|
||||
|
||||
VkBufferImageCopy region = {};
|
||||
region.imageSubresource = { src->aspect(), 0, 0, 1 };
|
||||
@ -129,7 +129,7 @@ namespace vk
|
||||
region.imageOffset = { src_area.x1, src_area.y1, 0 };
|
||||
region.imageExtent = { transfer_width, transfer_height, 1 };
|
||||
|
||||
auto mapping = vk::map_dma(cmd, valid_range.start, valid_range.length());
|
||||
auto mapping = vk::map_dma(valid_range.start, valid_range.length());
|
||||
region.bufferOffset = mapping.first;
|
||||
vkCmdCopyImageToBuffer(cmd, src->value, src->current_layout, mapping.second->value, 1, ®ion);
|
||||
}
|
||||
|
@ -911,7 +911,7 @@ namespace vk
|
||||
|
||||
if (memory_load)
|
||||
{
|
||||
vk::map_dma(cmd, rsx_range.start, rsx_range.length());
|
||||
vk::map_dma(rsx_range.start, rsx_range.length());
|
||||
vk::load_dma(rsx_range.start, rsx_range.length());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user