mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-12-06 07:12:28 +01:00
vk: Use unique resource ids on buffer views
This commit is contained in:
parent
5a91ed01eb
commit
eb453462c1
|
|
@ -816,8 +816,8 @@ void VKGSRender::emit_geometry(u32 sub_index)
|
|||
m_current_command_buffer->flags |= (vk::command_buffer::cb_has_occlusion_task | vk::command_buffer::cb_has_open_query);
|
||||
}
|
||||
|
||||
auto persistent_buffer = m_persistent_attribute_storage ? m_persistent_attribute_storage->value : null_buffer_view->value;
|
||||
auto volatile_buffer = m_volatile_attribute_storage ? m_volatile_attribute_storage->value : null_buffer_view->value;
|
||||
VkDescriptorBufferViewEx persistent_buffer = m_persistent_attribute_storage ? *m_persistent_attribute_storage : *null_buffer_view;
|
||||
VkDescriptorBufferViewEx volatile_buffer = m_volatile_attribute_storage ? *m_volatile_attribute_storage : *null_buffer_view;
|
||||
bool update_descriptors = false;
|
||||
|
||||
if (m_current_draw.subdraw_id == 0)
|
||||
|
|
|
|||
|
|
@ -17,11 +17,7 @@ namespace vk
|
|||
bool operator == (const descriptor_slot_t& a, const VkDescriptorImageInfoEx& b)
|
||||
{
|
||||
const auto ptr = std::get_if<VkDescriptorImageInfoEx>(&a);
|
||||
return !!ptr &&
|
||||
ptr->imageView == b.imageView &&
|
||||
ptr->resourceId == b.resourceId &&
|
||||
ptr->sampler == b.sampler &&
|
||||
ptr->imageLayout == b.imageLayout;
|
||||
return !!ptr && ptr->resourceId == b.resourceId;
|
||||
}
|
||||
|
||||
bool operator == (const descriptor_slot_t& a, const VkDescriptorBufferInfo& b)
|
||||
|
|
@ -33,10 +29,10 @@ namespace vk
|
|||
ptr->range == b.range;
|
||||
}
|
||||
|
||||
bool operator == (const descriptor_slot_t& a, const VkBufferView& b)
|
||||
bool operator == (const descriptor_slot_t& a, const VkDescriptorBufferViewEx& b)
|
||||
{
|
||||
const auto ptr = std::get_if<VkBufferView>(&a);
|
||||
return !!ptr && *ptr == b;
|
||||
const auto ptr = std::get_if<VkDescriptorBufferViewEx>(&a);
|
||||
return !!ptr && ptr->resourceId == b.resourceId;
|
||||
}
|
||||
|
||||
bool operator == (const descriptor_slot_t& a, const std::span<const VkDescriptorImageInfoEx>& b)
|
||||
|
|
@ -334,7 +330,7 @@ namespace vk
|
|||
m_sets[set_id].notify_descriptor_slot_updated(binding_point, buffer_descriptor);
|
||||
}
|
||||
|
||||
void program::bind_uniform(const VkBufferView &buffer_view, u32 set_id, u32 binding_point)
|
||||
void program::bind_uniform(const VkDescriptorBufferViewEx& buffer_view, u32 set_id, u32 binding_point)
|
||||
{
|
||||
if (m_sets[set_id].m_descriptor_slots[binding_point] == buffer_view)
|
||||
{
|
||||
|
|
@ -492,9 +488,9 @@ namespace vk
|
|||
return;
|
||||
}
|
||||
|
||||
if (auto ptr = std::get_if<VkBufferView>(&slot))
|
||||
if (auto ptr = std::get_if<VkDescriptorBufferViewEx>(&slot))
|
||||
{
|
||||
m_descriptor_set.push(*ptr, type, idx);
|
||||
m_descriptor_set.push(ptr->view, type, idx);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -543,9 +539,9 @@ namespace vk
|
|||
return;
|
||||
}
|
||||
|
||||
if (auto ptr = std::get_if<VkBufferView>(&slot))
|
||||
if (auto ptr = std::get_if<VkDescriptorBufferViewEx>(&slot))
|
||||
{
|
||||
m_descriptor_template[idx].pTexelBufferView = m_descriptor_set.store(*ptr);
|
||||
m_descriptor_template[idx].pTexelBufferView = m_descriptor_set.store(ptr->view);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ namespace vk
|
|||
};
|
||||
|
||||
using descriptor_image_array_t = rsx::simple_array<VkDescriptorImageInfoEx>;
|
||||
using descriptor_slot_t = std::variant<VkDescriptorImageInfoEx, VkDescriptorBufferInfo, VkBufferView, descriptor_image_array_t>;
|
||||
using descriptor_slot_t = std::variant<VkDescriptorImageInfoEx, VkDescriptorBufferInfo, VkDescriptorBufferViewEx, descriptor_image_array_t>;
|
||||
|
||||
struct descriptor_table_t
|
||||
{
|
||||
|
|
@ -202,9 +202,9 @@ namespace vk
|
|||
std::pair<u32, u32> get_uniform_location(::glsl::program_domain domain, program_input_type type, const std::string& uniform_name);
|
||||
|
||||
void bind_uniform(const VkDescriptorImageInfoEx& image_descriptor, u32 set_id, u32 binding_point);
|
||||
void bind_uniform(const VkDescriptorBufferInfo &buffer_descriptor, u32 set_id, u32 binding_point);
|
||||
void bind_uniform(const VkBufferView &buffer_view, u32 set_id, u32 binding_point);
|
||||
void bind_uniform(const VkBufferView &buffer_view, ::glsl::program_domain domain, program_input_type type, const std::string &binding_name);
|
||||
void bind_uniform(const VkDescriptorBufferInfo& buffer_descriptor, u32 set_id, u32 binding_point);
|
||||
void bind_uniform(const VkDescriptorBufferViewEx& buffer_view, u32 set_id, u32 binding_point);
|
||||
void bind_uniform(const VkDescriptorBufferViewEx& buffer_view, ::glsl::program_domain domain, program_input_type type, const std::string &binding_name);
|
||||
|
||||
void bind_uniform_array(const std::span<const VkDescriptorImageInfoEx>& image_descriptors,u32 set_id, u32 binding_point);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue