1
0
Fork 0
forked from wry/wry

vulkan: log information about mixed device use

This commit is contained in:
Julian Orth 2026-02-10 18:30:39 +01:00
parent 89c9b8d2e0
commit 3ef408b5b4
3 changed files with 16 additions and 1 deletions

View file

@ -101,7 +101,7 @@ pub enum QueueTransfer {
pub enum VulkanImageMemory {
DmaBuf(VulkanDmaBufImage),
Internal(VulkanShmImage),
Blend(#[expect(dead_code)] VulkanAllocation),
Blend(VulkanAllocation),
}
pub struct VulkanDmaBufImage {

View file

@ -2117,6 +2117,18 @@ impl Debug for VulkanRenderer {
impl VulkanImage {
fn assert_device(&self, device: &Device) -> Result<(), VulkanError> {
if self.renderer.device.device.handle() != device.handle() {
match &self.ty {
VulkanImageMemory::DmaBuf(v) => {
log::warn!("Mixed device use with dmabuf {}", v.template.dmabuf.id);
}
VulkanImageMemory::Internal(_v) => {
log::warn!("Mixed device use with internal image");
}
VulkanImageMemory::Blend(_v) => {
log::warn!("Mixed device use with blend buffer");
}
}
log::info!("Image address {:?}", ptr::from_ref(self));
return Err(VulkanError::MixedVulkanDeviceUse);
}
Ok(())

View file

@ -182,6 +182,9 @@ impl RendererBase<'_> {
opaque: bool,
cd: &Rc<ColorDescription>,
) {
// log::info!("rendering texture {:?}", std::ptr::from_ref(&**texture) as *const u8);
// log::info!("{:?}", backtrace::Backtrace::new());
let mut texcoord = tpoints.unwrap_or_else(SampleRect::identity);
let (twidth, theight) = if let Some(size) = tsize {