text_renderer: clear VkImage before growing, implement island padding in texture atlas (fix graphical artifacts)
This commit is contained in:
@@ -4,11 +4,11 @@ use vulkano::{
|
||||
DeviceSize,
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
AutoCommandBufferBuilder, CommandBufferExecFuture, CopyBufferToImageInfo, CopyImageInfo, PrimaryAutoCommandBuffer,
|
||||
PrimaryCommandBufferAbstract, RenderingAttachmentInfo, RenderingInfo, SubpassContents,
|
||||
AutoCommandBufferBuilder, ClearColorImageInfo, CommandBufferExecFuture, CopyBufferToImageInfo, CopyImageInfo,
|
||||
PrimaryAutoCommandBuffer, PrimaryCommandBufferAbstract, RenderingAttachmentInfo, RenderingInfo, SubpassContents,
|
||||
},
|
||||
device::Queue,
|
||||
format::{ClearValue, Format},
|
||||
format::{ClearColorValue, ClearValue, Format},
|
||||
image::{Image, ImageCreateInfo, ImageType, ImageUsage, view::ImageView},
|
||||
memory::allocator::{AllocationCreateInfo, MemoryTypeFilter},
|
||||
render_pass::{AttachmentLoadOp, AttachmentStoreOp},
|
||||
@@ -128,6 +128,16 @@ impl WCommandBuffer<CmdBufXfer> {
|
||||
Ok(image)
|
||||
}
|
||||
|
||||
pub fn clear_image(&mut self, image: &Arc<Image>) -> anyhow::Result<()> {
|
||||
let clear_info = ClearColorImageInfo {
|
||||
clear_value: ClearColorValue::Uint([0, 0, 0, 0]),
|
||||
..ClearColorImageInfo::image(image.clone())
|
||||
};
|
||||
|
||||
self.command_buffer.clear_color_image(clear_info)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn update_image(
|
||||
&mut self,
|
||||
image: &Arc<Image>,
|
||||
|
||||
Reference in New Issue
Block a user