mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 13:56:59 +01:00
graphics: derive pixel stage activity from shader outputs
This commit is contained in:
@@ -653,22 +653,11 @@ RenderState RenderExecutor::AcquireRenderTargets(CommandBuffer& buffer, RenderCo
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool DrawHasActivePixelShader(const RenderCommandBuffer& buffer,
|
static bool DrawHasActivePixelShader(const RenderCommandBuffer& buffer) {
|
||||||
const DrawRenderState& state, const DrawCallInfo& draw) {
|
const auto& ctx = buffer.GetRegisters();
|
||||||
EXIT_IF(draw.name == nullptr);
|
const auto& sh_regs = ctx.GetShaderRegisters();
|
||||||
const auto& ctx = buffer.GetRegisters();
|
const bool has_color_output = (ctx.GetRenderTargetMask() & sh_regs.m_cbShaderMask) != 0;
|
||||||
const auto& sh_ctx = buffer.GetShaders();
|
return has_color_output || PixelShaderHasDepthOrCoverageSideEffects(sh_regs);
|
||||||
|
|
||||||
const bool with_depth = (state.depth_info.format != vk::Format::eUndefined &&
|
|
||||||
static_cast<bool>(state.depth_info.image_id));
|
|
||||||
if (state.color_count != 0 || !with_depth) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto& sh_regs = ctx.GetShaderRegisters();
|
|
||||||
const auto& ps = sh_ctx.GetPs();
|
|
||||||
return ShaderAddressValid(ps.ps_regs.data_addr) &&
|
|
||||||
PixelShaderHasDepthOrCoverageSideEffects(sh_regs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class CbColorMode : uint8_t {
|
enum class CbColorMode : uint8_t {
|
||||||
@@ -951,7 +940,7 @@ bool RenderExecutor::PrepareDrawRenderState(uint64_t submit_id, RenderCommandBuf
|
|||||||
draw.index_count, draw.flags);
|
draw.index_count, draw.flags);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
state.ps_active = DrawHasActivePixelShader(buffer, state, draw);
|
state.ps_active = DrawHasActivePixelShader(buffer);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user