Expose color and depth attachments to Draw

This commit is contained in:
Billy Laws 2022-09-18 15:32:51 +01:00
parent aae957819e
commit 6a1615a104
4 changed files with 17 additions and 2 deletions

View File

@ -381,6 +381,15 @@ namespace skyline::gpu::interconnect::maxwell3d {
return pipeline.Get().pipeline;
}
span<TextureView *> ActiveState::GetColorAttachments() {
return pipeline.Get().colorAttachments;
}
TextureView *ActiveState::GetDepthAttachment() {
return pipeline.Get().depthAttachment;
}
std::shared_ptr<TextureView> ActiveState::GetColorRenderTargetForClear(InterconnectContext &ctx, size_t index) {
return pipeline.Get().GetColorRenderTargetForClear(ctx, index);
}

View File

@ -258,6 +258,10 @@ namespace skyline::gpu::interconnect::maxwell3d {
Pipeline *GetPipeline();
span<TextureView *> GetColorAttachments();
TextureView *GetDepthAttachment();
std::shared_ptr<TextureView> GetColorRenderTargetForClear(InterconnectContext &ctx, size_t index);
std::shared_ptr<TextureView> GetDepthRenderTargetForClear(InterconnectContext &ctx);

View File

@ -493,12 +493,12 @@ namespace skyline::gpu::interconnect::maxwell3d {
shaderBinaries[i] = stage.binary;
}
boost::container::static_vector<TextureView *, engine::ColorTargetCount> colorAttachments;
colorAttachments.clear();
for (auto &colorRenderTarget : colorRenderTargets)
if (auto view{colorRenderTarget.UpdateGet(ctx, packedState).view})
colorAttachments.push_back(view.get());
TextureView *depthAttachment{depthRenderTarget.UpdateGet(ctx, packedState).view.get()};
depthAttachment = depthRenderTarget.UpdateGet(ctx, packedState).view.get();
vertexInput.Update(packedState);
directState.inputAssembly.Update(packedState);

View File

@ -308,6 +308,8 @@ namespace skyline::gpu::interconnect::maxwell3d {
public:
DirectPipelineState directState;
Pipeline *pipeline{};
boost::container::static_vector<TextureView *, engine::ColorTargetCount> colorAttachments;
TextureView *depthAttachment{};
PipelineState(dirty::Handle dirtyHandle, DirtyManager &manager, const EngineRegisters &engine);