mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-22 18:15:14 +00:00
vk_rasterizer: Set render area to max when no framebuffers are bound
This commit is contained in:
parent
88abb93669
commit
e2a79dabc3
@ -329,6 +329,16 @@ public:
|
||||
return properties.limits.maxViewportDimensions[1];
|
||||
}
|
||||
|
||||
/// Returns the maximum render area width.
|
||||
u32 GetMaxFramebufferWidth() const {
|
||||
return properties.limits.maxFramebufferWidth;
|
||||
}
|
||||
|
||||
/// Returns the maximum render area height.
|
||||
u32 GetMaxFramebufferHeight() const {
|
||||
return properties.limits.maxFramebufferHeight;
|
||||
}
|
||||
|
||||
/// Returns the sample count flags supported by framebuffers.
|
||||
vk::SampleCountFlags GetFramebufferSampleCounts() const {
|
||||
return properties.limits.framebufferColorSampleCounts &
|
||||
|
@ -113,6 +113,8 @@ RenderState Rasterizer::PrepareRenderState(u32 mrt_mask) {
|
||||
// Prefetch color and depth buffers to let texture cache handle possible overlaps with bound
|
||||
// textures (e.g. mipgen)
|
||||
RenderState state;
|
||||
state.width = instance.GetMaxFramebufferWidth();
|
||||
state.height = instance.GetMaxFramebufferHeight();
|
||||
|
||||
cb_descs.clear();
|
||||
db_desc.reset();
|
||||
|
@ -34,16 +34,11 @@ void Scheduler::BeginRendering(const RenderState& new_state) {
|
||||
is_rendering = true;
|
||||
render_state = new_state;
|
||||
|
||||
const auto width =
|
||||
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 = {width, height},
|
||||
.extent = {render_state.width, render_state.height},
|
||||
},
|
||||
.layerCount = 1,
|
||||
.colorAttachmentCount = render_state.num_color_attachments,
|
||||
|
@ -26,8 +26,8 @@ struct RenderState {
|
||||
u32 num_color_attachments{};
|
||||
bool has_depth{};
|
||||
bool has_stencil{};
|
||||
u32 width = std::numeric_limits<u32>::max();
|
||||
u32 height = std::numeric_limits<u32>::max();
|
||||
u32 width{};
|
||||
u32 height{};
|
||||
|
||||
bool operator==(const RenderState& other) const noexcept {
|
||||
return std::memcmp(this, &other, sizeof(RenderState)) == 0;
|
||||
|
Loading…
Reference in New Issue
Block a user