mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-12 12:45:56 +00:00
vk_rasterizer: Set render area to max when no framebuffers are bound (#3227)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / linux-qt-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / linux-qt-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
This commit is contained in:
parent
8bc30270c8
commit
b403e1be33
4 changed files with 16 additions and 9 deletions
|
@ -324,11 +324,21 @@ public:
|
||||||
return properties.limits.maxViewportDimensions[0];
|
return properties.limits.maxViewportDimensions[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the maximum viewport height.
|
/// Returns the maximum viewport height.
|
||||||
u32 GetMaxViewportHeight() const {
|
u32 GetMaxViewportHeight() const {
|
||||||
return properties.limits.maxViewportDimensions[1];
|
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.
|
/// Returns the sample count flags supported by framebuffers.
|
||||||
vk::SampleCountFlags GetFramebufferSampleCounts() const {
|
vk::SampleCountFlags GetFramebufferSampleCounts() const {
|
||||||
return properties.limits.framebufferColorSampleCounts &
|
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
|
// Prefetch color and depth buffers to let texture cache handle possible overlaps with bound
|
||||||
// textures (e.g. mipgen)
|
// textures (e.g. mipgen)
|
||||||
RenderState state;
|
RenderState state;
|
||||||
|
state.width = instance.GetMaxFramebufferWidth();
|
||||||
|
state.height = instance.GetMaxFramebufferHeight();
|
||||||
|
|
||||||
cb_descs.clear();
|
cb_descs.clear();
|
||||||
db_desc.reset();
|
db_desc.reset();
|
||||||
|
|
|
@ -34,16 +34,11 @@ void Scheduler::BeginRendering(const RenderState& new_state) {
|
||||||
is_rendering = true;
|
is_rendering = true;
|
||||||
render_state = new_state;
|
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 = {
|
const vk::RenderingInfo rendering_info = {
|
||||||
.renderArea =
|
.renderArea =
|
||||||
{
|
{
|
||||||
.offset = {0, 0},
|
.offset = {0, 0},
|
||||||
.extent = {width, height},
|
.extent = {render_state.width, render_state.height},
|
||||||
},
|
},
|
||||||
.layerCount = 1,
|
.layerCount = 1,
|
||||||
.colorAttachmentCount = render_state.num_color_attachments,
|
.colorAttachmentCount = render_state.num_color_attachments,
|
||||||
|
|
|
@ -26,8 +26,8 @@ struct RenderState {
|
||||||
u32 num_color_attachments{};
|
u32 num_color_attachments{};
|
||||||
bool has_depth{};
|
bool has_depth{};
|
||||||
bool has_stencil{};
|
bool has_stencil{};
|
||||||
u32 width = std::numeric_limits<u32>::max();
|
u32 width{};
|
||||||
u32 height = std::numeric_limits<u32>::max();
|
u32 height{};
|
||||||
|
|
||||||
bool operator==(const RenderState& other) const noexcept {
|
bool operator==(const RenderState& other) const noexcept {
|
||||||
return std::memcmp(this, &other, sizeof(RenderState)) == 0;
|
return std::memcmp(this, &other, sizeof(RenderState)) == 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue