mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 14:45:07 +01:00
Keep track of combined image samplers for quick bind
This commit is contained in:
parent
040db37a28
commit
6bb2853ca0
@ -275,7 +275,18 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
pushBindings(vk::DescriptorType::eStorageTexelBuffer, stage.info.image_buffer_descriptors, stageDescInfo.storageTexelBufferDescCount, [](const auto &, u32) {});
|
||||
descriptorInfo.totalTexelBufferDescCount += stageDescInfo.uniformTexelBufferDescCount + stageDescInfo.storageTexelBufferDescCount;
|
||||
|
||||
pushBindings(vk::DescriptorType::eCombinedImageSampler, stage.info.texture_descriptors, stageDescInfo.combinedImageSamplerDescCount, [](const auto &, u32) {}, needsIndividualTextureBindingWrites);
|
||||
pushBindings(vk::DescriptorType::eCombinedImageSampler, stage.info.texture_descriptors, stageDescInfo.combinedImageSamplerDescCount, [&](const Shader::TextureDescriptor &desc, u32 descIdx) {
|
||||
auto addUsage{[&](auto idx) {
|
||||
auto &usage{stageDescInfo.cbufUsages[desc.cbuf_index]};
|
||||
usage.combinedImageSamplers.push_back({bindingIndex, descIdx});
|
||||
usage.totalImageDescCount += desc.count;
|
||||
usage.writeDescCount++;
|
||||
}};
|
||||
|
||||
addUsage(desc.cbuf_index);
|
||||
if (desc.has_secondary)
|
||||
addUsage(desc.secondary_cbuf_index);
|
||||
}, needsIndividualTextureBindingWrites);
|
||||
pushBindings(vk::DescriptorType::eStorageImage, stage.info.image_descriptors, stageDescInfo.storageImageDescCount, [](const auto &, u32) {});
|
||||
descriptorInfo.totalImageDescCount += stageDescInfo.combinedImageSamplerDescCount + stageDescInfo.storageImageDescCount;
|
||||
}
|
||||
|
@ -63,13 +63,16 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
|
||||
boost::container::small_vector<Usage, 2> uniformBuffers;
|
||||
boost::container::small_vector<Usage, 2> storageBuffers;
|
||||
boost::container::small_vector<Usage, 2> combinedImageSamplers;
|
||||
u32 totalBufferDescCount;
|
||||
u32 totalImageDescCount;
|
||||
u32 writeDescCount;
|
||||
};
|
||||
|
||||
std::array<ConstantBufferDescriptorUsages, engine::ShaderStageConstantBufferCount> cbufUsages;
|
||||
};
|
||||
|
||||
std::vector<vk::CopyDescriptorSet> copyDescs;
|
||||
std::array<StageDescriptorInfo, 5> stages;
|
||||
|
||||
u32 totalStorageBufferCount;
|
||||
@ -78,7 +81,6 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
u32 totalBufferDescCount;
|
||||
u32 totalTexelBufferDescCount;
|
||||
u32 totalImageDescCount;
|
||||
u32 totalElemCount;
|
||||
};
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user