allocator: don't require render usage for bridged buffers
This commit is contained in:
parent
1bacaa7b02
commit
bf65da4c76
15 changed files with 152 additions and 54 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use {
|
||||
crate::{
|
||||
format::{formats, Format},
|
||||
gfx_api::GfxFormat,
|
||||
gfx_api::{GfxFormat, GfxWriteModifier},
|
||||
gfx_apis::gl::{
|
||||
egl::{
|
||||
context::EglContext,
|
||||
|
|
@ -173,13 +173,18 @@ impl EglDisplay {
|
|||
continue;
|
||||
}
|
||||
let mut read_modifiers = IndexSet::new();
|
||||
let mut write_modifiers = IndexSet::new();
|
||||
let mut write_modifiers = IndexMap::new();
|
||||
for modifier in format.modifiers.values() {
|
||||
if modifier.external_only && !supports_external_only {
|
||||
continue;
|
||||
}
|
||||
if !modifier.external_only {
|
||||
write_modifiers.insert(modifier.modifier);
|
||||
write_modifiers.insert(
|
||||
modifier.modifier,
|
||||
GfxWriteModifier {
|
||||
needs_render_usage: true,
|
||||
},
|
||||
);
|
||||
}
|
||||
read_modifiers.insert(modifier.modifier);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use {
|
|||
format::{Format, XRGB8888},
|
||||
gfx_api::{
|
||||
AcquireSync, BufferResv, BufferResvUser, GfxApiOpt, GfxFormat, GfxFramebuffer,
|
||||
GfxTexture, ReleaseSync, SyncFile,
|
||||
GfxTexture, GfxWriteModifier, ReleaseSync, SyncFile,
|
||||
},
|
||||
gfx_apis::vulkan::{
|
||||
allocator::VulkanAllocator,
|
||||
|
|
@ -158,7 +158,14 @@ impl VulkanDevice {
|
|||
.modifiers
|
||||
.values()
|
||||
.filter(|m| m.render_limits.is_some())
|
||||
.map(|m| m.modifier)
|
||||
.map(|m| {
|
||||
(
|
||||
m.modifier,
|
||||
GfxWriteModifier {
|
||||
needs_render_usage: !m.render_needs_bridge,
|
||||
},
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
},
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue