mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-02-19 18:33:30 +00:00
Fix VK and GL renderdoc captures
This commit is contained in:
parent
4122444581
commit
99f03daf23
@ -1,5 +1,9 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
### Unreleased
|
||||||
|
- GL & Vulkan:
|
||||||
|
- Fix renderdoc device pointers.
|
||||||
|
|
||||||
### wgpu-hal-0.10.7 (2021-09-14)
|
### wgpu-hal-0.10.7 (2021-09-14)
|
||||||
- Metal:
|
- Metal:
|
||||||
- fix stencil back-face state
|
- fix stencil back-face state
|
||||||
|
@ -1041,9 +1041,8 @@ impl crate::Device<super::Api> for super::Device {
|
|||||||
unsafe fn start_capture(&self) -> bool {
|
unsafe fn start_capture(&self) -> bool {
|
||||||
#[cfg(feature = "renderdoc")]
|
#[cfg(feature = "renderdoc")]
|
||||||
{
|
{
|
||||||
//Note: it doesn't look like the device pointer is used by RD
|
|
||||||
self.render_doc
|
self.render_doc
|
||||||
.start_frame_capture(ptr::null_mut(), ptr::null_mut())
|
.start_frame_capture(self.shared.context.egl_context.as_ptr(), ptr::null_mut())
|
||||||
}
|
}
|
||||||
#[cfg(not(feature = "renderdoc"))]
|
#[cfg(not(feature = "renderdoc"))]
|
||||||
false
|
false
|
||||||
|
@ -236,7 +236,7 @@ pub struct AdapterContext {
|
|||||||
glow_context: Mutex<glow::Context>,
|
glow_context: Mutex<glow::Context>,
|
||||||
egl: Arc<egl::DynamicInstance<egl::EGL1_4>>,
|
egl: Arc<egl::DynamicInstance<egl::EGL1_4>>,
|
||||||
egl_display: egl::Display,
|
egl_display: egl::Display,
|
||||||
egl_context: egl::Context,
|
pub(super) egl_context: egl::Context,
|
||||||
egl_pbuffer: Option<egl::Surface>,
|
egl_pbuffer: Option<egl::Surface>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1535,20 +1535,27 @@ impl crate::Device<super::Api> for super::Device {
|
|||||||
unsafe fn start_capture(&self) -> bool {
|
unsafe fn start_capture(&self) -> bool {
|
||||||
#[cfg(feature = "renderdoc")]
|
#[cfg(feature = "renderdoc")]
|
||||||
{
|
{
|
||||||
self.render_doc.start_frame_capture(
|
// Renderdoc requires us to give us the pointer that vkInstance _points to_.
|
||||||
ash::vk::Handle::as_raw(self.shared.raw.handle()) as *mut _,
|
let raw_vk_instance =
|
||||||
ptr::null_mut(),
|
ash::vk::Handle::as_raw(self.shared.instance.raw.handle()) as *mut *mut _;
|
||||||
)
|
let raw_vk_instance_dispatch_table = *raw_vk_instance;
|
||||||
|
self.render_doc
|
||||||
|
.start_frame_capture(raw_vk_instance_dispatch_table, ptr::null_mut())
|
||||||
}
|
}
|
||||||
#[cfg(not(feature = "renderdoc"))]
|
#[cfg(not(feature = "renderdoc"))]
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
unsafe fn stop_capture(&self) {
|
unsafe fn stop_capture(&self) {
|
||||||
#[cfg(feature = "renderdoc")]
|
#[cfg(feature = "renderdoc")]
|
||||||
self.render_doc.end_frame_capture(
|
{
|
||||||
ash::vk::Handle::as_raw(self.shared.raw.handle()) as *mut _,
|
// Renderdoc requires us to give us the pointer that vkInstance _points to_.
|
||||||
ptr::null_mut(),
|
let raw_vk_instance =
|
||||||
)
|
ash::vk::Handle::as_raw(self.shared.instance.raw.handle()) as *mut *mut _;
|
||||||
|
let raw_vk_instance_dispatch_table = *raw_vk_instance;
|
||||||
|
|
||||||
|
self.render_doc
|
||||||
|
.end_frame_capture(raw_vk_instance_dispatch_table, ptr::null_mut())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user