hal/egl: add coherence preference, hook up EGL_KHR_debug message callbacks

This commit is contained in:
Dzmitry Malyshau 2021-06-25 16:58:01 -04:00 committed by Dzmitry Malyshau
parent 8fd6b36e6c
commit cf10138c64
2 changed files with 4 additions and 5 deletions

View File

@ -36,7 +36,8 @@ impl CompilationContext<'_> {
let slot = self.layout.get_slot(br);
let name = reflection_info.uniforms[&handle].clone();
log::debug!("Rebind buffer: {:?} -> {}", var.name.as_ref(), &name);
log::debug!("Rebind buffer: {:?} -> {}, register={:?}, slot={}",
var.name.as_ref(), &name, register, slot);
self.name_binding_map.insert(name, (register, slot));
}
@ -200,10 +201,7 @@ impl super::Device {
log::warn!("\tLink: {}", msg);
}
if !self
.shared
.private_caps
.contains(super::PrivateCapability::EXPLICIT_LAYOUTS_IN_SHADER)
//TODO: check for `PrivateCapability::EXPLICIT_LAYOUTS_IN_SHADER`?
{
gl.use_program(Some(program));
for (ref name, (register, slot)) in name_binding_map {

View File

@ -557,6 +557,7 @@ impl crate::Device<super::Api> for super::Device {
.intersects(crate::BufferUse::MAP_READ | crate::BufferUse::MAP_WRITE)
{
let mut flags = gpu_alloc::UsageFlags::HOST_ACCESS;
//TODO: find a way to use `crate::MemoryFlag::PREFER_COHERENT`
flags.set(
gpu_alloc::UsageFlags::COHERENT,
desc.memory_flags