mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Add # Safery docs to wgpu-core
This commit is contained in:
@@ -225,6 +225,12 @@ pub mod compute_ffi {
|
||||
};
|
||||
use std::{convert::TryInto, slice};
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
/// This function is unsafe as there is no guarantee that the given pointer is
|
||||
/// valid for `offset_length` elements.
|
||||
// TODO: There might be other safety issues, such as using the unsafe
|
||||
// `RawPass::encode` and `RawPass::encode_slice`.
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_compute_pass_set_bind_group(
|
||||
pass: &mut RawPass,
|
||||
|
||||
@@ -197,7 +197,7 @@ pub struct CommandBufferDescriptor {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_command_encoder_begin_compute_pass(
|
||||
pub extern "C" fn wgpu_command_encoder_begin_compute_pass(
|
||||
encoder_id: id::CommandEncoderId,
|
||||
_desc: Option<&ComputePassDescriptor>,
|
||||
) -> *mut RawPass {
|
||||
@@ -220,6 +220,11 @@ pub struct RawRenderPass {
|
||||
targets: RawRenderTargets,
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
/// This function is unsafe as there is no guarantee that the given pointer
|
||||
/// (`RenderPassDescriptor::color_attachments`) is valid for
|
||||
/// `RenderPassDescriptor::color_attachments_length` elements.
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_command_encoder_begin_render_pass(
|
||||
encoder_id: id::CommandEncoderId,
|
||||
|
||||
@@ -1127,6 +1127,12 @@ pub mod render_ffi {
|
||||
};
|
||||
use std::{convert::TryInto, slice};
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
/// This function is unsafe as there is no guarantee that the given pointer is
|
||||
/// valid for `offset_length` elements.
|
||||
// TODO: There might be other safety issues, such as using the unsafe
|
||||
// `RawPass::encode` and `RawPass::encode_slice`.
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_render_pass_set_bind_group(
|
||||
pass: &mut RawRenderPass,
|
||||
@@ -1166,6 +1172,12 @@ pub mod render_ffi {
|
||||
});
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
/// This function is unsafe as there is no guarantee that the given pointers
|
||||
/// (`buffer_ids` and `offsets`) are valid for `length` elements.
|
||||
// TODO: There might be other safety issues, such as using the unsafe
|
||||
// `RawPass::encode` and `RawPass::encode_slice`.
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_render_pass_set_vertex_buffers(
|
||||
pass: &mut RawRenderPass,
|
||||
|
||||
Reference in New Issue
Block a user