mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 20:25:10 +01:00
Fix descriptor copies to be one per descriptor type
This commit is contained in:
parent
d482e0ea98
commit
040db37a28
@ -237,6 +237,14 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
|||||||
|
|
||||||
descCb(desc, descIdx);
|
descCb(desc, descIdx);
|
||||||
|
|
||||||
|
descriptorInfo.copyDescs.push_back(vk::CopyDescriptorSet{
|
||||||
|
.srcBinding = bindingIndex,
|
||||||
|
.srcArrayElement = 0,
|
||||||
|
.dstBinding = bindingIndex,
|
||||||
|
.dstArrayElement = 0,
|
||||||
|
.descriptorCount = desc.count,
|
||||||
|
});
|
||||||
|
|
||||||
descriptorInfo.descriptorSetLayoutBindings.push_back(vk::DescriptorSetLayoutBinding{
|
descriptorInfo.descriptorSetLayoutBindings.push_back(vk::DescriptorSetLayoutBinding{
|
||||||
.binding = bindingIndex++,
|
.binding = bindingIndex++,
|
||||||
.descriptorType = type,
|
.descriptorType = type,
|
||||||
@ -271,8 +279,6 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
|||||||
pushBindings(vk::DescriptorType::eStorageImage, stage.info.image_descriptors, stageDescInfo.storageImageDescCount, [](const auto &, u32) {});
|
pushBindings(vk::DescriptorType::eStorageImage, stage.info.image_descriptors, stageDescInfo.storageImageDescCount, [](const auto &, u32) {});
|
||||||
descriptorInfo.totalImageDescCount += stageDescInfo.combinedImageSamplerDescCount + stageDescInfo.storageImageDescCount;
|
descriptorInfo.totalImageDescCount += stageDescInfo.combinedImageSamplerDescCount + stageDescInfo.storageImageDescCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
descriptorInfo.totalElemCount = descriptorInfo.totalBufferDescCount + descriptorInfo.totalTexelBufferDescCount + descriptorInfo.totalImageDescCount;
|
|
||||||
return descriptorInfo;
|
return descriptorInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -686,24 +692,16 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
|||||||
|
|
||||||
const auto &shaderInfo{shaderStages[stageIndex].info};
|
const auto &shaderInfo{shaderStages[stageIndex].info};
|
||||||
auto &stageConstantBuffers{constantBuffers[stageIndex]};
|
auto &stageConstantBuffers{constantBuffers[stageIndex]};
|
||||||
auto copies{ctx.executor.allocator->AllocateUntracked<vk::CopyDescriptorSet>(1)};
|
|
||||||
|
u32 writeIdx{};
|
||||||
auto writes{ctx.executor.allocator->AllocateUntracked<vk::WriteDescriptorSet>(cbufUsageInfo.writeDescCount)};
|
auto writes{ctx.executor.allocator->AllocateUntracked<vk::WriteDescriptorSet>(cbufUsageInfo.writeDescCount)};
|
||||||
|
|
||||||
size_t writeIdx{};
|
u32 bufferIdx{};
|
||||||
size_t bufferIdx{};
|
|
||||||
size_t imageIdx{};
|
|
||||||
|
|
||||||
auto bufferDescs{ctx.executor.allocator->AllocateUntracked<vk::DescriptorBufferInfo>(cbufUsageInfo.totalBufferDescCount)};
|
auto bufferDescs{ctx.executor.allocator->AllocateUntracked<vk::DescriptorBufferInfo>(cbufUsageInfo.totalBufferDescCount)};
|
||||||
auto bufferDescDynamicBindings{ctx.executor.allocator->AllocateUntracked<DynamicBufferBinding>(cbufUsageInfo.totalBufferDescCount)};
|
auto bufferDescDynamicBindings{ctx.executor.allocator->AllocateUntracked<DynamicBufferBinding>(cbufUsageInfo.totalBufferDescCount)};
|
||||||
|
|
||||||
// TODO: opt this to do partial copy and avoid updating twice
|
u32 imageIdx{};
|
||||||
copies[0] = vk::CopyDescriptorSet{
|
auto imageDescs{ctx.executor.allocator->AllocateUntracked<vk::DescriptorImageInfo>(cbufUsageInfo.totalImageDescCount)};
|
||||||
.srcBinding = 0,
|
|
||||||
.srcArrayElement = 0,
|
|
||||||
.dstBinding = 0,
|
|
||||||
.dstArrayElement = 0,
|
|
||||||
.descriptorCount = descriptorInfo.totalElemCount,
|
|
||||||
};
|
|
||||||
|
|
||||||
auto writeBufferDescs{[&](vk::DescriptorType type, const auto &usages, const auto &descs, auto getBufferCb) {
|
auto writeBufferDescs{[&](vk::DescriptorType type, const auto &usages, const auto &descs, auto getBufferCb) {
|
||||||
for (const auto &usage : usages) {
|
for (const auto &usage : usages) {
|
||||||
@ -736,7 +734,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return ctx.executor.allocator->EmplaceUntracked<DescriptorUpdateInfo>(DescriptorUpdateInfo{
|
return ctx.executor.allocator->EmplaceUntracked<DescriptorUpdateInfo>(DescriptorUpdateInfo{
|
||||||
.copies = copies,
|
.copies = descriptorInfo.copyDescs,
|
||||||
.writes = writes.first(writeIdx),
|
.writes = writes.first(writeIdx),
|
||||||
.bufferDescs = bufferDescs.first(bufferIdx),
|
.bufferDescs = bufferDescs.first(bufferIdx),
|
||||||
.bufferDescDynamicBindings = bufferDescDynamicBindings.first(bufferIdx),
|
.bufferDescDynamicBindings = bufferDescDynamicBindings.first(bufferIdx),
|
||||||
|
Loading…
Reference in New Issue
Block a user