Debug markers for command encoders (#775)

This commit is contained in:
Dzmitry Malyshau 2020-07-10 10:18:06 -04:00 committed by GitHub
parent 7e1fe247fc
commit 8a3ed611d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 14 deletions

8
Cargo.lock generated
View File

@ -653,7 +653,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "wgpu-core" name = "wgpu-core"
version = "0.5.5" version = "0.5.6"
dependencies = [ dependencies = [
"arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"battery 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "battery 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -679,7 +679,7 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-native" name = "wgpu-native"
version = "0.5.0" version = "0.5.1"
dependencies = [ dependencies = [
"arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -687,7 +687,7 @@ dependencies = [
"objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"wgpu-core 0.5.5", "wgpu-core 0.5.6",
"wgpu-types 0.5.1", "wgpu-types 0.5.1",
] ]
@ -697,7 +697,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"wgpu-core 0.5.5", "wgpu-core 0.5.6",
"wgpu-types 0.5.1", "wgpu-types 0.5.1",
] ]

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Generated with cbindgen:0.14.1 */ /* Generated with cbindgen:0.14.3 */
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen. /* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
* To generate this file: * To generate this file:
@ -416,10 +416,10 @@ typedef struct {
uint32_t todo; uint32_t todo;
} WGPUCommandBufferDescriptor; } WGPUCommandBufferDescriptor;
typedef WGPURawPass *WGPUComputePassId;
typedef const char *WGPURawString; typedef const char *WGPURawString;
typedef WGPURawPass *WGPUComputePassId;
typedef uint32_t WGPUDynamicOffset; typedef uint32_t WGPUDynamicOffset;
typedef WGPUNonZeroU64 WGPUId_ComputePipeline_Dummy; typedef WGPUNonZeroU64 WGPUId_ComputePipeline_Dummy;
@ -794,6 +794,16 @@ void wgpu_command_encoder_destroy(WGPUCommandEncoderId command_encoder_id);
WGPUCommandBufferId wgpu_command_encoder_finish(WGPUCommandEncoderId encoder_id, WGPUCommandBufferId wgpu_command_encoder_finish(WGPUCommandEncoderId encoder_id,
const WGPUCommandBufferDescriptor *desc); const WGPUCommandBufferDescriptor *desc);
void wgpu_command_encoder_insert_debug_marker(WGPUCommandEncoderId command_encoder_id,
WGPURawString label,
uint32_t _color);
void wgpu_command_encoder_pop_debug_group(WGPUCommandEncoderId command_encoder_id);
void wgpu_command_encoder_push_debug_group(WGPUCommandEncoderId command_encoder_id,
WGPURawString label,
uint32_t _color);
void wgpu_compute_pass_destroy(WGPURawPass *pass); void wgpu_compute_pass_destroy(WGPURawPass *pass);
void wgpu_compute_pass_dispatch(WGPURawPass *pass, void wgpu_compute_pass_dispatch(WGPURawPass *pass,
@ -809,11 +819,11 @@ void wgpu_compute_pass_end_pass(WGPUComputePassId pass_id);
const uint8_t *wgpu_compute_pass_finish(WGPURawPass *pass, uintptr_t *length); const uint8_t *wgpu_compute_pass_finish(WGPURawPass *pass, uintptr_t *length);
void wgpu_compute_pass_insert_debug_marker(WGPURawPass *_pass, WGPURawString _label); void wgpu_compute_pass_insert_debug_marker(WGPURawPass *pass, WGPURawString label, uint32_t color);
void wgpu_compute_pass_pop_debug_group(WGPURawPass *_pass); void wgpu_compute_pass_pop_debug_group(WGPURawPass *pass);
void wgpu_compute_pass_push_debug_group(WGPURawPass *_pass, WGPURawString _label); void wgpu_compute_pass_push_debug_group(WGPURawPass *pass, WGPURawString label, uint32_t color);
/** /**
* # Safety * # Safety
@ -934,11 +944,11 @@ void wgpu_render_pass_execute_bundles(WGPURawPass *_pass,
const uint8_t *wgpu_render_pass_finish(WGPURawPass *pass, uintptr_t *length); const uint8_t *wgpu_render_pass_finish(WGPURawPass *pass, uintptr_t *length);
void wgpu_render_pass_insert_debug_marker(WGPURawPass *_pass, WGPURawString _label); void wgpu_render_pass_insert_debug_marker(WGPURawPass *pass, WGPURawString label, uint32_t color);
void wgpu_render_pass_pop_debug_group(WGPURawPass *_pass); void wgpu_render_pass_pop_debug_group(WGPURawPass *pass);
void wgpu_render_pass_push_debug_group(WGPURawPass *_pass, WGPURawString _label); void wgpu_render_pass_push_debug_group(WGPURawPass *pass, WGPURawString label, uint32_t color);
/** /**
* # Safety * # Safety

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wgpu-native" name = "wgpu-native"
version = "0.5.0" version = "0.5.1"
authors = [ authors = [
"Dzmitry Malyshau <kvark@mozilla.com>", "Dzmitry Malyshau <kvark@mozilla.com>",
"Joshua Groves <josh@joshgroves.com>", "Joshua Groves <josh@joshgroves.com>",

View File

@ -130,3 +130,30 @@ pub unsafe extern "C" fn wgpu_compute_pass_end_pass(pass_id: id::ComputePassId)
pub unsafe extern "C" fn wgpu_compute_pass_destroy(pass: *mut core::command::RawPass) { pub unsafe extern "C" fn wgpu_compute_pass_destroy(pass: *mut core::command::RawPass) {
let _ = Box::from_raw(pass).into_vec(); let _ = Box::from_raw(pass).into_vec();
} }
#[no_mangle]
pub unsafe extern "C" fn wgpu_command_encoder_push_debug_group(
command_encoder_id: id::CommandEncoderId,
label: core::RawString,
_color: u32,
) {
let string = std::ffi::CStr::from_ptr(label).to_string_lossy();
gfx_select!(command_encoder_id => GLOBAL.command_encoder_push_debug_group(command_encoder_id, &string));
}
#[no_mangle]
pub unsafe extern "C" fn wgpu_command_encoder_pop_debug_group(
command_encoder_id: id::CommandEncoderId,
) {
gfx_select!(command_encoder_id => GLOBAL.command_encoder_pop_debug_group(command_encoder_id));
}
#[no_mangle]
pub unsafe extern "C" fn wgpu_command_encoder_insert_debug_marker(
command_encoder_id: id::CommandEncoderId,
label: core::RawString,
_color: u32,
) {
let string = std::ffi::CStr::from_ptr(label).to_string_lossy();
gfx_select!(command_encoder_id => GLOBAL.command_encoder_insert_debug_marker(command_encoder_id, &string));
}