mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-01 15:02:40 +00:00
Removed the skip for draw calls without RTs
This commit is contained in:
parent
cd75c4f1a2
commit
fa4934686a
@ -32,10 +32,6 @@ Rasterizer::~Rasterizer() = default;
|
|||||||
void Rasterizer::Draw(bool is_indexed, u32 index_offset) {
|
void Rasterizer::Draw(bool is_indexed, u32 index_offset) {
|
||||||
RENDERER_TRACE;
|
RENDERER_TRACE;
|
||||||
|
|
||||||
if (!HasRenderTargets()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto cmdbuf = scheduler.CommandBuffer();
|
const auto cmdbuf = scheduler.CommandBuffer();
|
||||||
const auto& regs = liverpool->regs;
|
const auto& regs = liverpool->regs;
|
||||||
const GraphicsPipeline* pipeline = pipeline_cache.GetGraphicsPipeline();
|
const GraphicsPipeline* pipeline = pipeline_cache.GetGraphicsPipeline();
|
||||||
@ -242,25 +238,6 @@ void Rasterizer::UpdateDepthStencilState() {
|
|||||||
cmdbuf.setDepthBoundsTestEnable(depth.depth_bounds_enable);
|
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) {
|
void Rasterizer::ScopeMarkerBegin(const std::string_view& str) {
|
||||||
if (!Config::isMarkersEnabled()) {
|
if (!Config::isMarkersEnabled()) {
|
||||||
return;
|
return;
|
||||||
|
@ -52,7 +52,6 @@ private:
|
|||||||
void UpdateDynamicState(const GraphicsPipeline& pipeline);
|
void UpdateDynamicState(const GraphicsPipeline& pipeline);
|
||||||
void UpdateViewportScissorState();
|
void UpdateViewportScissorState();
|
||||||
void UpdateDepthStencilState();
|
void UpdateDepthStencilState();
|
||||||
bool HasRenderTargets();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const Instance& instance;
|
const Instance& instance;
|
||||||
|
@ -29,15 +29,22 @@ void Scheduler::BeginRendering(const RenderState& new_state) {
|
|||||||
is_rendering = true;
|
is_rendering = true;
|
||||||
render_state = new_state;
|
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 = {
|
const vk::RenderingInfo rendering_info = {
|
||||||
.renderArea =
|
.renderArea =
|
||||||
{
|
{
|
||||||
.offset = {0, 0},
|
.offset = {0, 0},
|
||||||
.extent = {render_state.width, render_state.height},
|
.extent = {witdh, height},
|
||||||
},
|
},
|
||||||
.layerCount = 1,
|
.layerCount = 1,
|
||||||
.colorAttachmentCount = render_state.num_color_attachments,
|
.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,
|
.pDepthAttachment = render_state.has_depth ? &render_state.depth_attachment : nullptr,
|
||||||
.pStencilAttachment = render_state.has_stencil ? &render_state.depth_attachment : nullptr,
|
.pStencilAttachment = render_state.has_stencil ? &render_state.depth_attachment : nullptr,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user