Only include active RTs in pipeline state key

This was causing a buildup of many redundant pipelines in SMO as a depth-only shader was being called without previous RTs being unbound.
This commit is contained in:
Billy Laws 2023-01-18 20:07:36 +00:00
parent 9d3a9f63d5
commit 6333a92b53
2 changed files with 7 additions and 1 deletions

View File

@ -35,6 +35,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
void ColorRenderTargetState::Flush(InterconnectContext &ctx, PackedPipelineState &packedState) {
auto &target{engine->colorTarget};
format = target.format;
packedState.SetColorRenderTargetFormat(index, target.format);
if (target.format == engine::ColorTarget::Format::Disabled) {
@ -78,6 +79,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
view = ctx.gpu.texture.FindOrCreate(guest, ctx.executor.tag);
} else {
format = engine::ColorTarget::Format::Disabled;
packedState.SetColorRenderTargetFormat(index, engine::ColorTarget::Format::Disabled);
view = {};
}
@ -391,9 +393,12 @@ namespace skyline::gpu::interconnect::maxwell3d {
}
colorAttachments.clear();
packedState.colorRenderTargetFormats = {};
for (size_t i{}; i < engine::ColorTargetCount; i++) {
if (i < ctSelect.count) {
const auto &view{colorRenderTargets[ctSelect[i]].UpdateGet(ctx, packedState).view.get()};
const auto &rt{colorRenderTargets[ctSelect[i]].UpdateGet(ctx, packedState)};
const auto view{rt.view.get()};
packedState.SetColorRenderTargetFormat(ctSelect[i], rt.format);
colorAttachments.push_back(view);
if (view)

View File

@ -28,6 +28,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
ColorRenderTargetState(dirty::Handle dirtyHandle, DirtyManager &manager, const EngineRegisters &engine, size_t index);
std::shared_ptr<TextureView> view;
engine::ColorTarget::Format format{engine::ColorTarget::Format::Disabled};
void Flush(InterconnectContext &ctx, PackedPipelineState &packedState);
};