1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-13 16:08:50 +01:00

[dxvk] Add feedback loop aspect flags to bindRenderTargets

This commit is contained in:
Joshua Ashton 2022-08-05 23:09:40 +00:00 committed by Joshie
parent dff514c924
commit 31d17efb48
5 changed files with 13 additions and 7 deletions

View File

@ -3161,7 +3161,7 @@ namespace dxvk {
EmitCs([ EmitCs([
cAttachments = std::move(attachments) cAttachments = std::move(attachments)
] (DxvkContext* ctx) mutable { ] (DxvkContext* ctx) mutable {
ctx->bindRenderTargets(Forwarder::move(cAttachments)); ctx->bindRenderTargets(Forwarder::move(cAttachments), 0u);
}); });
// If necessary, update push constant for the sample count // If necessary, update push constant for the sample count
@ -3813,7 +3813,7 @@ namespace dxvk {
cUsedBindings = GetMaxUsedBindings() cUsedBindings = GetMaxUsedBindings()
] (DxvkContext* ctx) { ] (DxvkContext* ctx) {
// Reset render targets // Reset render targets
ctx->bindRenderTargets(DxvkRenderTargets()); ctx->bindRenderTargets(DxvkRenderTargets(), 0u);
// Reset vertex input state // Reset vertex input state
ctx->setInputLayout(0, nullptr, 0, nullptr); ctx->setInputLayout(0, nullptr, 0, nullptr);

View File

@ -1198,7 +1198,7 @@ namespace dxvk {
rt.color[0].view = cView; rt.color[0].view = cView;
rt.color[0].layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; rt.color[0].layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
ctx->bindRenderTargets(std::move(rt)); ctx->bindRenderTargets(std::move(rt), 0u);
ctx->bindShader(VK_SHADER_STAGE_VERTEX_BIT, Rc<DxvkShader>(m_vs)); ctx->bindShader(VK_SHADER_STAGE_VERTEX_BIT, Rc<DxvkShader>(m_vs));
ctx->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, Rc<DxvkShader>(m_fs)); ctx->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, Rc<DxvkShader>(m_fs));
ctx->bindResourceBuffer(VK_SHADER_STAGE_FRAGMENT_BIT, 0, DxvkBufferSlice(m_ubo)); ctx->bindResourceBuffer(VK_SHADER_STAGE_FRAGMENT_BIT, 0, DxvkBufferSlice(m_ubo));
@ -1312,7 +1312,7 @@ namespace dxvk {
void D3D11VideoContext::UnbindResources() { void D3D11VideoContext::UnbindResources() {
m_ctx->EmitCs([this] (DxvkContext* ctx) { m_ctx->EmitCs([this] (DxvkContext* ctx) {
ctx->bindRenderTargets(DxvkRenderTargets()); ctx->bindRenderTargets(DxvkRenderTargets(), 0u);
ctx->bindShader(VK_SHADER_STAGE_VERTEX_BIT, nullptr); ctx->bindShader(VK_SHADER_STAGE_VERTEX_BIT, nullptr);
ctx->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, nullptr); ctx->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, nullptr);

View File

@ -5465,7 +5465,7 @@ namespace dxvk {
EmitCs([ EmitCs([
cAttachments = std::move(attachments) cAttachments = std::move(attachments)
] (DxvkContext* ctx) mutable { ] (DxvkContext* ctx) mutable {
ctx->bindRenderTargets(std::move(cAttachments)); ctx->bindRenderTargets(std::move(cAttachments), 0u);
}); });
} }

View File

@ -87,10 +87,16 @@ namespace dxvk {
* \param [in] targets Render targets to bind * \param [in] targets Render targets to bind
*/ */
void bindRenderTargets( void bindRenderTargets(
DxvkRenderTargets&& targets) { DxvkRenderTargets&& targets,
VkImageAspectFlags feedbackLoop) {
// Set up default render pass ops // Set up default render pass ops
m_state.om.renderTargets = std::move(targets); m_state.om.renderTargets = std::move(targets);
if (unlikely(m_state.gp.state.om.feedbackLoop() != feedbackLoop)) {
m_state.gp.state.om.setFeedbackLoop(feedbackLoop);
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
}
this->resetRenderPassOps( this->resetRenderPassOps(
m_state.om.renderTargets, m_state.om.renderTargets,
m_state.om.renderPassOps); m_state.om.renderPassOps);

View File

@ -180,7 +180,7 @@ namespace dxvk {
renderTargets.color[0].view = dstView; renderTargets.color[0].view = dstView;
renderTargets.color[0].layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; renderTargets.color[0].layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
ctx->bindRenderTargets(std::move(renderTargets)); ctx->bindRenderTargets(std::move(renderTargets), 0u);
VkExtent2D dstExtent = { VkExtent2D dstExtent = {
dstView->imageInfo().extent.width, dstView->imageInfo().extent.width,