vulkan: ignore paint region if framebuffer is undefined
This commit is contained in:
parent
1d9bd404d6
commit
52624455b3
2 changed files with 13 additions and 7 deletions
|
|
@ -283,6 +283,11 @@ pub trait GfxFramebuffer: Debug {
|
|||
) -> Result<Option<SyncFile>, GfxError>;
|
||||
|
||||
fn format(&self) -> &'static Format;
|
||||
|
||||
fn full_region(&self) -> Region {
|
||||
let (width, height) = self.physical_size();
|
||||
Region::new2(Rect::new_sized_unchecked(0, 0, width, height))
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GfxInternalFramebuffer: GfxFramebuffer {
|
||||
|
|
@ -319,11 +324,6 @@ impl dyn GfxFramebuffer {
|
|||
)
|
||||
}
|
||||
|
||||
fn full_region(&self) -> Region {
|
||||
let (width, height) = self.physical_size();
|
||||
Region::new2(Rect::new_sized_unchecked(0, 0, width, height))
|
||||
}
|
||||
|
||||
pub fn clear(
|
||||
self: &Rc<Self>,
|
||||
acquire_sync: AcquireSync,
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ use {
|
|||
cpu_worker::PendingJob,
|
||||
format::XRGB8888,
|
||||
gfx_api::{
|
||||
AcquireSync, BufferResv, BufferResvUser, GfxApiOpt, GfxFormat, GfxTexture,
|
||||
GfxWriteModifier, ReleaseSync, SyncFile,
|
||||
AcquireSync, BufferResv, BufferResvUser, GfxApiOpt, GfxFormat, GfxFramebuffer,
|
||||
GfxTexture, GfxWriteModifier, ReleaseSync, SyncFile,
|
||||
},
|
||||
gfx_apis::vulkan::{
|
||||
VulkanError,
|
||||
|
|
@ -1075,6 +1075,12 @@ impl VulkanRenderer {
|
|||
}
|
||||
|
||||
fn create_paint_regions(&self, fb: &VulkanImage, region: &Region) {
|
||||
let mut region = region;
|
||||
let region_owned;
|
||||
if fb.contents_are_undefined.get() {
|
||||
region_owned = fb.full_region();
|
||||
region = ®ion_owned;
|
||||
}
|
||||
let memory = &mut *self.memory.borrow_mut();
|
||||
memory.paint_regions.clear();
|
||||
for rect in region.rects() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue