Removed the skip for draw calls without RTs

This commit is contained in:
Vladislav Mikhalin 2024-08-21 21:08:47 +03:00
parent cd75c4f1a2
commit fa4934686a
3 changed files with 9 additions and 26 deletions

View File

@ -32,10 +32,6 @@ Rasterizer::~Rasterizer() = default;
void Rasterizer::Draw(bool is_indexed, u32 index_offset) {
RENDERER_TRACE;
if (!HasRenderTargets()) {
return;
}
const auto cmdbuf = scheduler.CommandBuffer();
const auto& regs = liverpool->regs;
const GraphicsPipeline* pipeline = pipeline_cache.GetGraphicsPipeline();
@ -242,25 +238,6 @@ void Rasterizer::UpdateDepthStencilState() {
cmdbuf.setDepthBoundsTestEnable(depth.depth_bounds_enable);
}
bool Rasterizer::HasRenderTargets() {
const auto& regs = liverpool->regs;
using ZFormat = AmdGpu::Liverpool::DepthBuffer::ZFormat;
using StencilFormat = AmdGpu::Liverpool::DepthBuffer::StencilFormat;
for (auto col_buf_id = 0u; col_buf_id < Liverpool::NumColorBuffers; ++col_buf_id) {
const auto& col_buf = regs.color_buffers[col_buf_id];
if (col_buf && regs.color_target_mask.GetMask(col_buf_id)) {
return true;
}
}
if (regs.depth_buffer.Address() != 0 &&
((regs.depth_control.depth_enable && regs.depth_buffer.z_info.format != ZFormat::Invalid) ||
regs.depth_control.stencil_enable &&
regs.depth_buffer.stencil_info.format != StencilFormat::Invalid)) {
return true;
}
return false;
}
void Rasterizer::ScopeMarkerBegin(const std::string_view& str) {
if (!Config::isMarkersEnabled()) {
return;

View File

@ -52,7 +52,6 @@ private:
void UpdateDynamicState(const GraphicsPipeline& pipeline);
void UpdateViewportScissorState();
void UpdateDepthStencilState();
bool HasRenderTargets();
private:
const Instance& instance;

View File

@ -29,15 +29,22 @@ void Scheduler::BeginRendering(const RenderState& new_state) {
is_rendering = true;
render_state = new_state;
const auto witdh =
render_state.width != std::numeric_limits<u32>::max() ? render_state.width : 1;
const auto height =
render_state.height != std::numeric_limits<u32>::max() ? render_state.height : 1;
const vk::RenderingInfo rendering_info = {
.renderArea =
{
.offset = {0, 0},
.extent = {render_state.width, render_state.height},
.extent = {witdh, height},
},
.layerCount = 1,
.colorAttachmentCount = render_state.num_color_attachments,
.pColorAttachments = render_state.color_attachments.data(),
.pColorAttachments = render_state.num_color_attachments > 0
? render_state.color_attachments.data()
: nullptr,
.pDepthAttachment = render_state.has_depth ? &render_state.depth_attachment : nullptr,
.pStencilAttachment = render_state.has_stencil ? &render_state.depth_attachment : nullptr,
};