Refresh pipeline cached storage buffer bindings after each execution

This commit is contained in:
Billy Laws 2022-09-29 21:16:31 +01:00
parent 6bb2853ca0
commit 13970a5644
2 changed files with 12 additions and 0 deletions

View File

@ -565,6 +565,15 @@ namespace skyline::gpu::interconnect::maxwell3d {
storageBufferViews.resize(descriptorInfo.totalStorageBufferCount);
}
void Pipeline::SyncCachedStorageBufferViews(u32 executionNumber) {
if (lastExecutionNumber != executionNumber) {
for (auto &view : storageBufferViews)
view.PurgeCaches();
lastExecutionNumber = executionNumber;
}
}
Pipeline *Pipeline::LookupNext(const PackedPipelineState &packedState) {
auto it{std::find_if(transitionCache.begin(), transitionCache.end(), [&packedState](auto pipeline) {
if (pipeline && pipeline->sourcePackedState == packedState)

View File

@ -85,6 +85,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
private:
std::vector<CachedMappedBufferView> storageBufferViews;
u32 lastExecutionNumber{}; //!< The last execution number this pipeline was used at
std::array<ShaderStage, engine::ShaderStageCount> shaderStages;
DescriptorInfo descriptorInfo;
cache::GraphicsPipelineCache::CompiledPipeline compiledPipeline;
@ -94,6 +95,8 @@ namespace skyline::gpu::interconnect::maxwell3d {
tsl::robin_map<Pipeline *, bool> bindingMatchCache; //!< Cache of which pipelines have bindings that match this pipeline
void SyncCachedStorageBufferViews(u32 executionNumber);
public:
PackedPipelineState sourcePackedState;