1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-13 19:29:14 +01:00

[dxvk] Don't use dynamic storage buffers

Doesn't really help in pracrice, but getting rid of them reduces
the number of dynamic offsets we have to update per draw/dispatch.
This commit is contained in:
Philip Rebohle 2019-10-11 14:21:49 +02:00
parent 0068740341
commit d8c3002b92
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 6 additions and 26 deletions

View File

@ -3860,18 +3860,6 @@ namespace dxvk {
descriptors[i].buffer = m_common->dummyResources().bufferDescriptor();
} break;
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
if (res.bufferSlice.defined()) {
descriptors[i] = res.bufferSlice.getDescriptor();
descriptors[i].buffer.offset = 0;
if (m_rcTracked.set(binding.slot))
m_cmd->trackResource<DxvkAccess::Write>(res.bufferSlice.buffer());
} else {
bindMask.clr(i);
descriptors[i].buffer = m_common->dummyResources().bufferDescriptor();
} break;
default:
Logger::err(str::format("DxvkContext: Unhandled descriptor type: ", binding.type));
}
@ -4236,7 +4224,6 @@ namespace dxvk {
switch (binding.type) {
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
if (binding.access & VK_ACCESS_SHADER_WRITE_BIT)
dstAccess.set(DxvkAccess::Write);
/* fall through */
@ -4305,7 +4292,6 @@ namespace dxvk {
switch (binding.type) {
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
if (binding.access & VK_ACCESS_SHADER_WRITE_BIT)
access |= VK_ACCESS_SHADER_WRITE_BIT;
/* fall through */

View File

@ -7,7 +7,7 @@ namespace dxvk {
: m_vkd(vkd) {
constexpr uint32_t MaxSets = 2048;
std::array<VkDescriptorPoolSize, 10> pools = {{
std::array<VkDescriptorPoolSize, 9> pools = {{
{ VK_DESCRIPTOR_TYPE_SAMPLER, MaxSets * 2 },
{ VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, MaxSets * 3 },
{ VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, MaxSets / 8 },
@ -16,7 +16,6 @@ namespace dxvk {
{ VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, MaxSets * 3 },
{ VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, MaxSets / 8 },
{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, MaxSets * 3 },
{ VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, MaxSets / 8 },
{ VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, MaxSets * 2 } }};
VkDescriptorPoolCreateInfo info;

View File

@ -57,9 +57,6 @@ namespace dxvk {
uint32_t storageBuffers) {
if (this->countDescriptors(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) <= uniformBuffers)
this->replaceDescriptors(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC);
if (this->countDescriptors(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) <= storageBuffers)
this->replaceDescriptors(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC);
}
@ -115,8 +112,7 @@ namespace dxvk {
tEntries[i].offset = sizeof(DxvkDescriptorInfo) * i;
tEntries[i].stride = 0;
if (bindingInfos[i].type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC
|| bindingInfos[i].type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
if (bindingInfos[i].type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC)
m_dynamicSlots.push_back(i);
m_descriptorTypes.set(bindingInfos[i].type);

View File

@ -235,13 +235,12 @@ namespace dxvk {
* \brief Checks for static buffer bindings
*
* Returns \c true if there is at least one
* descriptor of the static uniform or storage
* buffer type.
* descriptor of the static uniform buffer
* type.
*/
bool hasStaticBufferBindings() const {
return m_descriptorTypes.any(
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER);
return m_descriptorTypes.test(
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
}
/**