mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-23 07:51:08 +01:00
Rustfmt stable pass
This commit is contained in:
1 parent
384606f2e2
commit
a3aefe2535
29 files changed
+875
-1066
No files matched your search
@@ -4,13 +4,7 @@
|
||||
|
||||
use super::CommandBuffer;
|
||||
use crate::{
|
||||
hub::GfxBackend,
|
||||
id::DeviceId,
|
||||
track::TrackerSet,
|
||||
Features,
|
||||
LifeGuard,
|
||||
Stored,
|
||||
SubmissionIndex,
|
||||
hub::GfxBackend, id::DeviceId, track::TrackerSet, Features, LifeGuard, Stored, SubmissionIndex,
|
||||
};
|
||||
|
||||
use hal::{command::CommandBuffer as _, device::Device as _, pool::CommandPool as _};
|
||||
@@ -27,7 +21,7 @@ struct CommandPool<B: hal::Backend> {
|
||||
|
||||
impl<B: hal::Backend> CommandPool<B> {
|
||||
fn maintain(&mut self, lowest_active_index: SubmissionIndex) {
|
||||
for i in (0 .. self.pending.len()).rev() {
|
||||
for i in (0..self.pending.len()).rev() {
|
||||
let index = self.pending[i]
|
||||
.life_guard
|
||||
.submission_index
|
||||
@@ -55,7 +49,10 @@ impl<B: hal::Backend> CommandPool<B> {
|
||||
|
||||
fn allocate(&mut self) -> B::CommandBuffer {
|
||||
if self.available.is_empty() {
|
||||
unsafe { self.raw.allocate(20, hal::command::Level::Primary, &mut self.available) };
|
||||
unsafe {
|
||||
self.raw
|
||||
.allocate(20, hal::command::Level::Primary, &mut self.available)
|
||||
};
|
||||
}
|
||||
self.available.pop().unwrap()
|
||||
}
|
||||
@@ -131,7 +128,10 @@ impl<B: hal::Backend> CommandAllocator<B> {
|
||||
let pool = inner.pools.get_mut(&cmd_buf.recorded_thread_id).unwrap();
|
||||
|
||||
if pool.available.is_empty() {
|
||||
unsafe { pool.raw.allocate(20, hal::command::Level::Primary, &mut pool.available) };
|
||||
unsafe {
|
||||
pool.raw
|
||||
.allocate(20, hal::command::Level::Primary, &mut pool.available)
|
||||
};
|
||||
}
|
||||
|
||||
pool.available.pop().unwrap()
|
||||
|
||||
@@ -10,8 +10,8 @@ use crate::{
|
||||
};
|
||||
|
||||
use smallvec::{smallvec, SmallVec};
|
||||
use wgt::DynamicOffset;
|
||||
use std::slice;
|
||||
use wgt::DynamicOffset;
|
||||
|
||||
pub const DEFAULT_BIND_GROUPS: usize = 4;
|
||||
type BindGroupMask = u8;
|
||||
@@ -44,12 +44,7 @@ impl<'a> Iterator for FollowUpIter<'a> {
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
self.iter
|
||||
.next()
|
||||
.and_then(|entry| {
|
||||
Some((
|
||||
entry.actual_value()?,
|
||||
entry.dynamic_offsets.as_slice(),
|
||||
))
|
||||
})
|
||||
.and_then(|entry| Some((entry.actual_value()?, entry.dynamic_offsets.as_slice())))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +146,7 @@ impl Binder {
|
||||
}
|
||||
|
||||
pub(crate) fn reset_expectations(&mut self, length: usize) {
|
||||
for entry in self.entries[length ..].iter_mut() {
|
||||
for entry in self.entries[length..].iter_mut() {
|
||||
entry.expected_layout_id = None;
|
||||
}
|
||||
}
|
||||
@@ -185,8 +180,8 @@ impl Binder {
|
||||
Some((
|
||||
self.pipeline_layout_id?,
|
||||
FollowUpIter {
|
||||
iter: self.entries[index + 1 .. end].iter(),
|
||||
}
|
||||
iter: self.entries[index + 1..end].iter(),
|
||||
},
|
||||
))
|
||||
} else {
|
||||
log::trace!("\t\tskipping above compatible {}", compatible_count);
|
||||
|
||||
@@ -5,17 +5,16 @@
|
||||
use crate::{
|
||||
command::{
|
||||
bind::{Binder, LayoutChange},
|
||||
CommandBuffer,
|
||||
PhantomSlice,
|
||||
CommandBuffer, PhantomSlice,
|
||||
},
|
||||
device::all_buffer_stages,
|
||||
hub::{GfxBackend, Global, GlobalIdentityHandlerFactory, Token},
|
||||
id,
|
||||
};
|
||||
|
||||
use wgt::{BufferAddress, BufferUsage, DynamicOffset, BIND_BUFFER_ALIGNMENT};
|
||||
use hal::command::CommandBuffer as _;
|
||||
use peek_poke::{Peek, PeekPoke, Poke};
|
||||
use wgt::{BufferAddress, BufferUsage, DynamicOffset, BIND_BUFFER_ALIGNMENT};
|
||||
|
||||
use std::iter;
|
||||
|
||||
@@ -90,17 +89,24 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let mut pipeline_state = PipelineState::Required;
|
||||
|
||||
let mut peeker = raw_data.as_ptr();
|
||||
let raw_data_end = unsafe {
|
||||
raw_data.as_ptr().add(raw_data.len())
|
||||
};
|
||||
let raw_data_end = unsafe { raw_data.as_ptr().add(raw_data.len()) };
|
||||
let mut command = ComputeCommand::Dispatch([0; 3]); // dummy
|
||||
loop {
|
||||
assert!(unsafe { peeker.add(ComputeCommand::max_size()) } <= raw_data_end);
|
||||
peeker = unsafe { ComputeCommand::peek_from(peeker, &mut command) };
|
||||
match command {
|
||||
ComputeCommand::SetBindGroup { index, num_dynamic_offsets, bind_group_id, phantom_offsets } => {
|
||||
ComputeCommand::SetBindGroup {
|
||||
index,
|
||||
num_dynamic_offsets,
|
||||
bind_group_id,
|
||||
phantom_offsets,
|
||||
} => {
|
||||
let (new_peeker, offsets) = unsafe {
|
||||
phantom_offsets.decode_unaligned(peeker, num_dynamic_offsets as usize, raw_data_end)
|
||||
phantom_offsets.decode_unaligned(
|
||||
peeker,
|
||||
num_dynamic_offsets as usize,
|
||||
raw_data_end,
|
||||
)
|
||||
};
|
||||
peeker = new_peeker;
|
||||
|
||||
@@ -136,11 +142,14 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&*texture_guard,
|
||||
);
|
||||
|
||||
if let Some((pipeline_layout_id, follow_ups)) = binder
|
||||
.provide_entry(index as usize, bind_group_id, bind_group, offsets)
|
||||
if let Some((pipeline_layout_id, follow_ups)) =
|
||||
binder.provide_entry(index as usize, bind_group_id, bind_group, offsets)
|
||||
{
|
||||
let bind_groups = iter::once(bind_group.raw.raw())
|
||||
.chain(follow_ups.clone().map(|(bg_id, _)| bind_group_guard[bg_id].raw.raw()));
|
||||
let bind_groups = iter::once(bind_group.raw.raw()).chain(
|
||||
follow_ups
|
||||
.clone()
|
||||
.map(|(bg_id, _)| bind_group_guard[bg_id].raw.raw()),
|
||||
);
|
||||
unsafe {
|
||||
raw.bind_compute_descriptor_sets(
|
||||
&pipeline_layout_guard[pipeline_layout_id].raw,
|
||||
@@ -156,7 +165,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
ComputeCommand::SetPipeline(pipeline_id) => {
|
||||
pipeline_state = PipelineState::Set;
|
||||
let pipeline = cmb.trackers
|
||||
let pipeline = cmb
|
||||
.trackers
|
||||
.compute_pipes
|
||||
.use_extend(&*pipeline_guard, pipeline_id, (), ())
|
||||
.unwrap();
|
||||
@@ -169,8 +179,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
if binder.pipeline_layout_id != Some(pipeline.layout_id) {
|
||||
let pipeline_layout = &pipeline_layout_guard[pipeline.layout_id];
|
||||
binder.pipeline_layout_id = Some(pipeline.layout_id);
|
||||
binder
|
||||
.reset_expectations(pipeline_layout.bind_group_layout_ids.len());
|
||||
binder.reset_expectations(pipeline_layout.bind_group_layout_ids.len());
|
||||
let mut is_compatible = true;
|
||||
|
||||
for (index, (entry, &bgl_id)) in binder
|
||||
@@ -200,13 +209,21 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
}
|
||||
ComputeCommand::Dispatch(groups) => {
|
||||
assert_eq!(pipeline_state, PipelineState::Set, "Dispatch error: Pipeline is missing");
|
||||
assert_eq!(
|
||||
pipeline_state,
|
||||
PipelineState::Set,
|
||||
"Dispatch error: Pipeline is missing"
|
||||
);
|
||||
unsafe {
|
||||
raw.dispatch(groups);
|
||||
}
|
||||
}
|
||||
ComputeCommand::DispatchIndirect { buffer_id, offset } => {
|
||||
assert_eq!(pipeline_state, PipelineState::Set, "Dispatch error: Pipeline is missing");
|
||||
assert_eq!(
|
||||
pipeline_state,
|
||||
PipelineState::Set,
|
||||
"Dispatch error: Pipeline is missing"
|
||||
);
|
||||
let (src_buffer, src_pending) = cmb.trackers.buffers.use_replace(
|
||||
&*buffer_guard,
|
||||
buffer_id,
|
||||
@@ -219,7 +236,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
unsafe {
|
||||
raw.pipeline_barrier(
|
||||
all_buffer_stages() .. all_buffer_stages(),
|
||||
all_buffer_stages()..all_buffer_stages(),
|
||||
hal::memory::Dependencies::empty(),
|
||||
barriers,
|
||||
);
|
||||
@@ -234,15 +251,12 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
pub mod compute_ffi {
|
||||
use super::{
|
||||
ComputeCommand,
|
||||
super::{PhantomSlice, RawPass},
|
||||
ComputeCommand,
|
||||
};
|
||||
use crate::{
|
||||
id,
|
||||
RawString,
|
||||
};
|
||||
use wgt::{BufferAddress, DynamicOffset};
|
||||
use crate::{id, RawString};
|
||||
use std::{convert::TryInto, slice};
|
||||
use wgt::{BufferAddress, DynamicOffset};
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
@@ -264,9 +278,7 @@ use wgt::{BufferAddress, DynamicOffset};
|
||||
bind_group_id,
|
||||
phantom_offsets: PhantomSlice::default(),
|
||||
});
|
||||
pass.encode_slice(
|
||||
slice::from_raw_parts(offsets, offset_length),
|
||||
);
|
||||
pass.encode_slice(slice::from_raw_parts(offsets, offset_length));
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
@@ -293,24 +305,16 @@ use wgt::{BufferAddress, DynamicOffset};
|
||||
buffer_id: id::BufferId,
|
||||
offset: BufferAddress,
|
||||
) {
|
||||
pass.encode(&ComputeCommand::DispatchIndirect {
|
||||
buffer_id,
|
||||
offset,
|
||||
});
|
||||
pass.encode(&ComputeCommand::DispatchIndirect { buffer_id, offset });
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_compute_pass_push_debug_group(
|
||||
_pass: &mut RawPass,
|
||||
_label: RawString,
|
||||
) {
|
||||
pub extern "C" fn wgpu_compute_pass_push_debug_group(_pass: &mut RawPass, _label: RawString) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_compute_pass_pop_debug_group(
|
||||
_pass: &mut RawPass,
|
||||
) {
|
||||
pub extern "C" fn wgpu_compute_pass_pop_debug_group(_pass: &mut RawPass) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
|
||||
@@ -14,30 +14,17 @@ pub use self::render::*;
|
||||
pub use self::transfer::*;
|
||||
|
||||
use crate::{
|
||||
device::{
|
||||
MAX_COLOR_TARGETS,
|
||||
all_buffer_stages,
|
||||
all_image_stages,
|
||||
},
|
||||
device::{all_buffer_stages, all_image_stages, MAX_COLOR_TARGETS},
|
||||
hub::{GfxBackend, Global, GlobalIdentityHandlerFactory, Storage, Token},
|
||||
id,
|
||||
resource::{Buffer, Texture},
|
||||
track::TrackerSet,
|
||||
Features,
|
||||
LifeGuard,
|
||||
Stored,
|
||||
Features, LifeGuard, Stored,
|
||||
};
|
||||
|
||||
use peek_poke::PeekPoke;
|
||||
|
||||
use std::{
|
||||
marker::PhantomData,
|
||||
mem,
|
||||
ptr,
|
||||
slice,
|
||||
thread::ThreadId,
|
||||
};
|
||||
|
||||
use std::{marker::PhantomData, mem, ptr, slice, thread::ThreadId};
|
||||
|
||||
#[derive(Clone, Copy, Debug, PeekPoke)]
|
||||
struct PhantomSlice<T>(PhantomData<T>);
|
||||
@@ -50,7 +37,10 @@ impl<T> Default for PhantomSlice<T> {
|
||||
|
||||
impl<T> PhantomSlice<T> {
|
||||
unsafe fn decode_unaligned<'a>(
|
||||
self, pointer: *const u8, count: usize, bound: *const u8
|
||||
self,
|
||||
pointer: *const u8,
|
||||
count: usize,
|
||||
bound: *const u8,
|
||||
) -> (*const u8, &'a [T]) {
|
||||
let align_offset = pointer.align_offset(mem::align_of::<T>());
|
||||
let aligned = pointer.add(align_offset);
|
||||
@@ -70,10 +60,7 @@ pub struct RawPass {
|
||||
}
|
||||
|
||||
impl RawPass {
|
||||
fn from_vec<T>(
|
||||
mut vec: Vec<T>,
|
||||
encoder_id: id::CommandEncoderId,
|
||||
) -> Self {
|
||||
fn from_vec<T>(mut vec: Vec<T>, encoder_id: id::CommandEncoderId) -> Self {
|
||||
let ptr = vec.as_mut_ptr() as *mut u8;
|
||||
let capacity = vec.capacity() * mem::size_of::<T>();
|
||||
mem::forget(vec);
|
||||
@@ -89,9 +76,7 @@ impl RawPass {
|
||||
///
|
||||
/// The last command is provided, yet the encoder
|
||||
/// is guaranteed to have exactly `C::max_size()` space for it.
|
||||
unsafe fn finish<C: peek_poke::Poke>(
|
||||
&mut self, command: C
|
||||
) {
|
||||
unsafe fn finish<C: peek_poke::Poke>(&mut self, command: C) {
|
||||
self.ensure_extra_size(C::max_size());
|
||||
let extended_end = self.data.add(C::max_size());
|
||||
let end = command.poke_into(self.data);
|
||||
@@ -169,30 +154,26 @@ impl<B: GfxBackend> CommandBuffer<B> {
|
||||
debug_assert_eq!(B::VARIANT, base.backend());
|
||||
debug_assert_eq!(B::VARIANT, head.backend());
|
||||
|
||||
let buffer_barriers = base
|
||||
.buffers
|
||||
.merge_replace(&head.buffers)
|
||||
.map(|pending| {
|
||||
let buf = &buffer_guard[pending.id];
|
||||
pending.into_hal(buf)
|
||||
});
|
||||
let texture_barriers = base
|
||||
.textures
|
||||
.merge_replace(&head.textures)
|
||||
.map(|pending| {
|
||||
let tex = &texture_guard[pending.id];
|
||||
pending.into_hal(tex)
|
||||
});
|
||||
let buffer_barriers = base.buffers.merge_replace(&head.buffers).map(|pending| {
|
||||
let buf = &buffer_guard[pending.id];
|
||||
pending.into_hal(buf)
|
||||
});
|
||||
let texture_barriers = base.textures.merge_replace(&head.textures).map(|pending| {
|
||||
let tex = &texture_guard[pending.id];
|
||||
pending.into_hal(tex)
|
||||
});
|
||||
base.views.merge_extend(&head.views).unwrap();
|
||||
base.bind_groups.merge_extend(&head.bind_groups).unwrap();
|
||||
base.samplers.merge_extend(&head.samplers).unwrap();
|
||||
base.compute_pipes.merge_extend(&head.compute_pipes).unwrap();
|
||||
base.compute_pipes
|
||||
.merge_extend(&head.compute_pipes)
|
||||
.unwrap();
|
||||
base.render_pipes.merge_extend(&head.render_pipes).unwrap();
|
||||
|
||||
let stages = all_buffer_stages() | all_image_stages();
|
||||
unsafe {
|
||||
raw.pipeline_barrier(
|
||||
stages .. stages,
|
||||
stages..stages,
|
||||
hal::memory::Dependencies::empty(),
|
||||
buffer_barriers.chain(texture_barriers),
|
||||
);
|
||||
@@ -258,7 +239,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
comb.is_recording = false;
|
||||
// stop tracking the swapchain image, if used
|
||||
if let Some((ref sc_id, _)) = comb.used_swap_chain {
|
||||
let view_id = swap_chain_guard[sc_id.value].acquired_view_id
|
||||
let view_id = swap_chain_guard[sc_id.value]
|
||||
.acquired_view_id
|
||||
.as_ref()
|
||||
.expect("Used swap chain frame has already presented");
|
||||
comb.trackers.views.remove(view_id.value);
|
||||
|
||||
+147
-163
@@ -5,19 +5,12 @@
|
||||
use crate::{
|
||||
command::{
|
||||
bind::{Binder, LayoutChange},
|
||||
PassComponent,
|
||||
PhantomSlice,
|
||||
RawRenderPassColorAttachmentDescriptor,
|
||||
RawRenderPassDepthStencilAttachmentDescriptor,
|
||||
RawRenderTargets,
|
||||
PassComponent, PhantomSlice, RawRenderPassColorAttachmentDescriptor,
|
||||
RawRenderPassDepthStencilAttachmentDescriptor, RawRenderTargets,
|
||||
},
|
||||
conv,
|
||||
device::{
|
||||
FramebufferKey,
|
||||
RenderPassContext,
|
||||
RenderPassKey,
|
||||
MAX_VERTEX_BUFFERS,
|
||||
MAX_COLOR_TARGETS,
|
||||
FramebufferKey, RenderPassContext, RenderPassKey, MAX_COLOR_TARGETS, MAX_VERTEX_BUFFERS,
|
||||
},
|
||||
hub::{GfxBackend, Global, GlobalIdentityHandlerFactory, Token},
|
||||
id,
|
||||
@@ -27,31 +20,17 @@ use crate::{
|
||||
Stored,
|
||||
};
|
||||
|
||||
use wgt::{
|
||||
BufferAddress,
|
||||
BufferUsage,
|
||||
Color,
|
||||
DynamicOffset,
|
||||
IndexFormat,
|
||||
InputStepMode,
|
||||
LoadOp,
|
||||
RenderPassColorAttachmentDescriptorBase,
|
||||
RenderPassDepthStencilAttachmentDescriptorBase,
|
||||
TextureUsage,
|
||||
BIND_BUFFER_ALIGNMENT
|
||||
};
|
||||
use arrayvec::ArrayVec;
|
||||
use hal::command::CommandBuffer as _;
|
||||
use peek_poke::{Peek, PeekPoke, Poke};
|
||||
use wgt::{
|
||||
BufferAddress, BufferUsage, Color, DynamicOffset, IndexFormat, InputStepMode, LoadOp,
|
||||
RenderPassColorAttachmentDescriptorBase, RenderPassDepthStencilAttachmentDescriptorBase,
|
||||
TextureUsage, BIND_BUFFER_ALIGNMENT,
|
||||
};
|
||||
|
||||
use std::{
|
||||
borrow::Borrow,
|
||||
collections::hash_map::Entry,
|
||||
iter,
|
||||
marker::PhantomData,
|
||||
mem,
|
||||
ops::Range,
|
||||
slice,
|
||||
borrow::Borrow, collections::hash_map::Entry, iter, marker::PhantomData, mem, ops::Range, slice,
|
||||
};
|
||||
|
||||
pub type RenderPassColorAttachmentDescriptor =
|
||||
@@ -156,10 +135,10 @@ impl super::RawPass {
|
||||
};
|
||||
}
|
||||
|
||||
for (color, at) in targets.colors
|
||||
.iter_mut()
|
||||
.zip(slice::from_raw_parts(desc.color_attachments, desc.color_attachments_length))
|
||||
{
|
||||
for (color, at) in targets.colors.iter_mut().zip(slice::from_raw_parts(
|
||||
desc.color_attachments,
|
||||
desc.color_attachments_length,
|
||||
)) {
|
||||
*color = RawRenderPassColorAttachmentDescriptor {
|
||||
attachment: at.attachment.into_raw(),
|
||||
resolve_target: at.resolve_target.map_or(0, |id| id.into_raw()),
|
||||
@@ -335,25 +314,22 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let (view_guard, _) = hub.texture_views.read(&mut token);
|
||||
|
||||
let mut peeker = raw_data.as_ptr();
|
||||
let raw_data_end = unsafe {
|
||||
raw_data.as_ptr().add(raw_data.len())
|
||||
};
|
||||
let raw_data_end = unsafe { raw_data.as_ptr().add(raw_data.len()) };
|
||||
|
||||
let mut targets: RawRenderTargets = unsafe { mem::zeroed() };
|
||||
assert!(unsafe { peeker.add(RawRenderTargets::max_size()) <= raw_data_end });
|
||||
peeker = unsafe { RawRenderTargets::peek_from(peeker, &mut targets) };
|
||||
|
||||
let color_attachments = targets.colors
|
||||
let color_attachments = targets
|
||||
.colors
|
||||
.iter()
|
||||
.take_while(|at| at.attachment != 0)
|
||||
.map(|at| {
|
||||
RenderPassColorAttachmentDescriptor {
|
||||
attachment: id::TextureViewId::from_raw(at.attachment).unwrap(),
|
||||
resolve_target: id::TextureViewId::from_raw(at.resolve_target),
|
||||
load_op: at.component.load_op,
|
||||
store_op: at.component.store_op,
|
||||
clear_color: at.component.clear_value,
|
||||
}
|
||||
.map(|at| RenderPassColorAttachmentDescriptor {
|
||||
attachment: id::TextureViewId::from_raw(at.attachment).unwrap(),
|
||||
resolve_target: id::TextureViewId::from_raw(at.resolve_target),
|
||||
load_op: at.component.load_op,
|
||||
store_op: at.component.store_op,
|
||||
clear_color: at.component.clear_value,
|
||||
})
|
||||
.collect::<ArrayVec<[_; MAX_COLOR_TARGETS]>>();
|
||||
let depth_stencil_attachment_body;
|
||||
@@ -401,7 +377,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&'a hal::image::SubresourceRange,
|
||||
Option<TextureUsage>,
|
||||
);
|
||||
let mut output_attachments = ArrayVec::<[OutputAttachment; MAX_TOTAL_ATTACHMENTS]>::new();
|
||||
let mut output_attachments =
|
||||
ArrayVec::<[OutputAttachment; MAX_TOTAL_ATTACHMENTS]>::new();
|
||||
|
||||
log::trace!(
|
||||
"Encoding render pass begin in command buffer {:?}",
|
||||
@@ -427,17 +404,19 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
};
|
||||
|
||||
// Using render pass for transition.
|
||||
let consistent_usage = base_trackers.textures.query(
|
||||
source_id.value,
|
||||
view.range.clone(),
|
||||
);
|
||||
let consistent_usage = base_trackers
|
||||
.textures
|
||||
.query(source_id.value, view.range.clone());
|
||||
output_attachments.push((source_id, &view.range, consistent_usage));
|
||||
|
||||
let old_layout = match consistent_usage {
|
||||
Some(usage) => conv::map_texture_state(
|
||||
usage,
|
||||
hal::format::Aspects::DEPTH | hal::format::Aspects::STENCIL,
|
||||
).1,
|
||||
Some(usage) => {
|
||||
conv::map_texture_state(
|
||||
usage,
|
||||
hal::format::Aspects::DEPTH | hal::format::Aspects::STENCIL,
|
||||
)
|
||||
.1
|
||||
}
|
||||
None => hal::image::Layout::DepthStencilAttachmentOptimal,
|
||||
};
|
||||
|
||||
@@ -449,7 +428,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
at.stencil_load_op,
|
||||
at.stencil_store_op,
|
||||
),
|
||||
layouts: old_layout .. hal::image::Layout::DepthStencilAttachmentOptimal,
|
||||
layouts: old_layout..hal::image::Layout::DepthStencilAttachmentOptimal,
|
||||
})
|
||||
}
|
||||
None => None,
|
||||
@@ -469,25 +448,25 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
view.samples, sample_count,
|
||||
"All attachments must have the same sample_count"
|
||||
);
|
||||
let first_use = trackers.views.init(
|
||||
at.attachment,
|
||||
view.life_guard.add_ref(),
|
||||
PhantomData,
|
||||
).is_ok();
|
||||
let first_use = trackers
|
||||
.views
|
||||
.init(at.attachment, view.life_guard.add_ref(), PhantomData)
|
||||
.is_ok();
|
||||
|
||||
let layouts = match view.inner {
|
||||
TextureViewInner::Native { ref source_id, .. } => {
|
||||
let consistent_usage = base_trackers.textures.query(
|
||||
source_id.value,
|
||||
view.range.clone(),
|
||||
);
|
||||
let consistent_usage = base_trackers
|
||||
.textures
|
||||
.query(source_id.value, view.range.clone());
|
||||
output_attachments.push((source_id, &view.range, consistent_usage));
|
||||
|
||||
let old_layout = match consistent_usage {
|
||||
Some(usage) => conv::map_texture_state(usage, hal::format::Aspects::COLOR).1,
|
||||
Some(usage) => {
|
||||
conv::map_texture_state(usage, hal::format::Aspects::COLOR).1
|
||||
}
|
||||
None => hal::image::Layout::ColorAttachmentOptimal,
|
||||
};
|
||||
old_layout .. hal::image::Layout::ColorAttachmentOptimal
|
||||
old_layout..hal::image::Layout::ColorAttachmentOptimal
|
||||
}
|
||||
TextureViewInner::SwapChain { ref source_id, .. } => {
|
||||
if let Some((ref sc_id, _)) = cmb.used_swap_chain {
|
||||
@@ -503,7 +482,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
} else {
|
||||
end
|
||||
};
|
||||
start .. end
|
||||
start..end
|
||||
}
|
||||
};
|
||||
|
||||
@@ -516,35 +495,32 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
});
|
||||
}
|
||||
|
||||
for resolve_target in color_attachments
|
||||
.iter()
|
||||
.flat_map(|at| at.resolve_target)
|
||||
{
|
||||
for resolve_target in color_attachments.iter().flat_map(|at| at.resolve_target) {
|
||||
let view = &view_guard[resolve_target];
|
||||
assert_eq!(extent, Some(view.extent));
|
||||
assert_eq!(
|
||||
view.samples, 1,
|
||||
"All resolve_targets must have a sample_count of 1"
|
||||
);
|
||||
let first_use = trackers.views.init(
|
||||
resolve_target,
|
||||
view.life_guard.add_ref(),
|
||||
PhantomData,
|
||||
).is_ok();
|
||||
let first_use = trackers
|
||||
.views
|
||||
.init(resolve_target, view.life_guard.add_ref(), PhantomData)
|
||||
.is_ok();
|
||||
|
||||
let layouts = match view.inner {
|
||||
TextureViewInner::Native { ref source_id, .. } => {
|
||||
let consistent_usage = base_trackers.textures.query(
|
||||
source_id.value,
|
||||
view.range.clone(),
|
||||
);
|
||||
let consistent_usage = base_trackers
|
||||
.textures
|
||||
.query(source_id.value, view.range.clone());
|
||||
output_attachments.push((source_id, &view.range, consistent_usage));
|
||||
|
||||
let old_layout = match consistent_usage {
|
||||
Some(usage) => conv::map_texture_state(usage, hal::format::Aspects::COLOR).1,
|
||||
Some(usage) => {
|
||||
conv::map_texture_state(usage, hal::format::Aspects::COLOR).1
|
||||
}
|
||||
None => hal::image::Layout::ColorAttachmentOptimal,
|
||||
};
|
||||
old_layout .. hal::image::Layout::ColorAttachmentOptimal
|
||||
old_layout..hal::image::Layout::ColorAttachmentOptimal
|
||||
}
|
||||
TextureViewInner::SwapChain { ref source_id, .. } => {
|
||||
if let Some((ref sc_id, _)) = cmb.used_swap_chain {
|
||||
@@ -560,7 +536,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
} else {
|
||||
end
|
||||
};
|
||||
start .. end
|
||||
start..end
|
||||
}
|
||||
};
|
||||
|
||||
@@ -650,7 +626,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
);
|
||||
|
||||
let subpass = hal::pass::SubpassDesc {
|
||||
colors: &color_ids[.. color_attachments.len()],
|
||||
colors: &color_ids[..color_attachments.len()],
|
||||
resolves: &resolve_ids,
|
||||
depth_stencil: depth_stencil_attachment.map(|_| &depth_id),
|
||||
inputs: &[],
|
||||
@@ -791,7 +767,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
0,
|
||||
iter::once(hal::pso::Viewport {
|
||||
rect,
|
||||
depth: 0.0 .. 1.0,
|
||||
depth: 0.0..1.0,
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -838,9 +814,18 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
assert!(unsafe { peeker.add(RenderCommand::max_size()) } <= raw_data_end);
|
||||
peeker = unsafe { RenderCommand::peek_from(peeker, &mut command) };
|
||||
match command {
|
||||
RenderCommand::SetBindGroup { index, num_dynamic_offsets, bind_group_id, phantom_offsets } => {
|
||||
RenderCommand::SetBindGroup {
|
||||
index,
|
||||
num_dynamic_offsets,
|
||||
bind_group_id,
|
||||
phantom_offsets,
|
||||
} => {
|
||||
let (new_peeker, offsets) = unsafe {
|
||||
phantom_offsets.decode_unaligned(peeker, num_dynamic_offsets as usize, raw_data_end)
|
||||
phantom_offsets.decode_unaligned(
|
||||
peeker,
|
||||
num_dynamic_offsets as usize,
|
||||
raw_data_end,
|
||||
)
|
||||
};
|
||||
peeker = new_peeker;
|
||||
|
||||
@@ -864,11 +849,17 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
trackers.merge_extend(&bind_group.used);
|
||||
|
||||
if let Some((pipeline_layout_id, follow_ups)) = state.binder
|
||||
.provide_entry(index as usize, bind_group_id, bind_group, offsets)
|
||||
{
|
||||
let bind_groups = iter::once(bind_group.raw.raw())
|
||||
.chain(follow_ups.clone().map(|(bg_id, _)| bind_group_guard[bg_id].raw.raw()));
|
||||
if let Some((pipeline_layout_id, follow_ups)) = state.binder.provide_entry(
|
||||
index as usize,
|
||||
bind_group_id,
|
||||
bind_group,
|
||||
offsets,
|
||||
) {
|
||||
let bind_groups = iter::once(bind_group.raw.raw()).chain(
|
||||
follow_ups
|
||||
.clone()
|
||||
.map(|(bg_id, _)| bind_group_guard[bg_id].raw.raw()),
|
||||
);
|
||||
unsafe {
|
||||
raw.bind_graphics_descriptor_sets(
|
||||
&&pipeline_layout_guard[pipeline_layout_id].raw,
|
||||
@@ -877,7 +868,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
offsets
|
||||
.iter()
|
||||
.chain(follow_ups.flat_map(|(_, offsets)| offsets))
|
||||
.cloned()
|
||||
.cloned(),
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -898,9 +889,11 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
"The render pipeline and renderpass have mismatching sample_count"
|
||||
);
|
||||
|
||||
state.blend_color
|
||||
state
|
||||
.blend_color
|
||||
.require(pipeline.flags.contains(PipelineFlags::BLEND_COLOR));
|
||||
state.stencil_reference
|
||||
state
|
||||
.stencil_reference
|
||||
.require(pipeline.flags.contains(PipelineFlags::STENCIL_REFERENCE));
|
||||
|
||||
unsafe {
|
||||
@@ -911,7 +904,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
if state.binder.pipeline_layout_id != Some(pipeline.layout_id) {
|
||||
let pipeline_layout = &pipeline_layout_guard[pipeline.layout_id];
|
||||
state.binder.pipeline_layout_id = Some(pipeline.layout_id);
|
||||
state.binder
|
||||
state
|
||||
.binder
|
||||
.reset_expectations(pipeline_layout.bind_group_layout_ids.len());
|
||||
let mut is_compatible = true;
|
||||
|
||||
@@ -968,30 +962,35 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
}
|
||||
// Update vertex buffer limits
|
||||
for (vbs, &(stride, rate)) in state
|
||||
.vertex
|
||||
.inputs
|
||||
.iter_mut()
|
||||
.zip(&pipeline.vertex_strides)
|
||||
for (vbs, &(stride, rate)) in
|
||||
state.vertex.inputs.iter_mut().zip(&pipeline.vertex_strides)
|
||||
{
|
||||
vbs.stride = stride;
|
||||
vbs.rate = rate;
|
||||
}
|
||||
for vbs in state.vertex.inputs[pipeline.vertex_strides.len() ..].iter_mut() {
|
||||
for vbs in state.vertex.inputs[pipeline.vertex_strides.len()..].iter_mut() {
|
||||
vbs.stride = 0;
|
||||
vbs.rate = InputStepMode::Vertex;
|
||||
}
|
||||
state.vertex.update_limits();
|
||||
}
|
||||
RenderCommand::SetIndexBuffer { buffer_id, offset, size } => {
|
||||
RenderCommand::SetIndexBuffer {
|
||||
buffer_id,
|
||||
offset,
|
||||
size,
|
||||
} => {
|
||||
let buffer = trackers
|
||||
.buffers
|
||||
.use_extend(&*buffer_guard, buffer_id, (), BufferUsage::INDEX)
|
||||
.unwrap();
|
||||
assert!(buffer.usage.contains(BufferUsage::INDEX));
|
||||
|
||||
let end = if size != 0 { offset + size } else { buffer.size };
|
||||
state.index.bound_buffer_view = Some((buffer_id, offset .. end));
|
||||
let end = if size != 0 {
|
||||
offset + size
|
||||
} else {
|
||||
buffer.size
|
||||
};
|
||||
state.index.bound_buffer_view = Some((buffer_id, offset..end));
|
||||
state.index.update_limit();
|
||||
|
||||
let view = hal::buffer::IndexBufferView {
|
||||
@@ -1007,7 +1006,12 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
raw.bind_index_buffer(view);
|
||||
}
|
||||
}
|
||||
RenderCommand::SetVertexBuffer { slot, buffer_id, offset, size } => {
|
||||
RenderCommand::SetVertexBuffer {
|
||||
slot,
|
||||
buffer_id,
|
||||
offset,
|
||||
size,
|
||||
} => {
|
||||
let buffer = trackers
|
||||
.buffers
|
||||
.use_extend(&*buffer_guard, buffer_id, (), BufferUsage::VERTEX)
|
||||
@@ -1040,7 +1044,11 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
raw.set_stencil_reference(hal::pso::Face::all(), value);
|
||||
}
|
||||
}
|
||||
RenderCommand::SetViewport { ref rect, depth_min, depth_max } => {
|
||||
RenderCommand::SetViewport {
|
||||
ref rect,
|
||||
depth_min,
|
||||
depth_max,
|
||||
} => {
|
||||
use std::{convert::TryFrom, i16};
|
||||
let r = hal::pso::Rect {
|
||||
x: i16::try_from(rect.x.round() as i64).unwrap_or(0),
|
||||
@@ -1053,7 +1061,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
0,
|
||||
iter::once(hal::pso::Viewport {
|
||||
rect: r,
|
||||
depth: depth_min .. depth_max,
|
||||
depth: depth_min..depth_max,
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -1067,13 +1075,15 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
h: i16::try_from(rect.h).unwrap_or(i16::MAX),
|
||||
};
|
||||
unsafe {
|
||||
raw.set_scissors(
|
||||
0,
|
||||
iter::once(r),
|
||||
);
|
||||
raw.set_scissors(0, iter::once(r));
|
||||
}
|
||||
}
|
||||
RenderCommand::Draw { vertex_count, instance_count, first_vertex, first_instance } => {
|
||||
RenderCommand::Draw {
|
||||
vertex_count,
|
||||
instance_count,
|
||||
first_vertex,
|
||||
first_instance,
|
||||
} => {
|
||||
state.is_ready().unwrap();
|
||||
assert!(
|
||||
first_vertex + vertex_count <= state.vertex.vertex_limit,
|
||||
@@ -1086,12 +1096,18 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
unsafe {
|
||||
raw.draw(
|
||||
first_vertex .. first_vertex + vertex_count,
|
||||
first_instance .. first_instance + instance_count,
|
||||
first_vertex..first_vertex + vertex_count,
|
||||
first_instance..first_instance + instance_count,
|
||||
);
|
||||
}
|
||||
}
|
||||
RenderCommand::DrawIndexed { index_count, instance_count, first_index, base_vertex, first_instance } => {
|
||||
RenderCommand::DrawIndexed {
|
||||
index_count,
|
||||
instance_count,
|
||||
first_index,
|
||||
base_vertex,
|
||||
first_instance,
|
||||
} => {
|
||||
state.is_ready().unwrap();
|
||||
|
||||
//TODO: validate that base_vertex + max_index() is within the provided range
|
||||
@@ -1106,9 +1122,9 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
unsafe {
|
||||
raw.draw_indexed(
|
||||
first_index .. first_index + index_count,
|
||||
first_index..first_index + index_count,
|
||||
base_vertex,
|
||||
first_instance .. first_instance + instance_count,
|
||||
first_instance..first_instance + instance_count,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1117,12 +1133,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
let buffer = trackers
|
||||
.buffers
|
||||
.use_extend(
|
||||
&*buffer_guard,
|
||||
buffer_id,
|
||||
(),
|
||||
BufferUsage::INDIRECT,
|
||||
)
|
||||
.use_extend(&*buffer_guard, buffer_id, (), BufferUsage::INDIRECT)
|
||||
.unwrap();
|
||||
assert!(buffer.usage.contains(BufferUsage::INDIRECT));
|
||||
|
||||
@@ -1135,12 +1146,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
let buffer = trackers
|
||||
.buffers
|
||||
.use_extend(
|
||||
&*buffer_guard,
|
||||
buffer_id,
|
||||
(),
|
||||
BufferUsage::INDIRECT,
|
||||
)
|
||||
.use_extend(&*buffer_guard, buffer_id, (), BufferUsage::INDIRECT)
|
||||
.unwrap();
|
||||
assert!(buffer.usage.contains(BufferUsage::INDIRECT));
|
||||
|
||||
@@ -1169,15 +1175,12 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
pub mod render_ffi {
|
||||
use super::{
|
||||
RenderCommand,
|
||||
super::{PhantomSlice, RawPass, Rect},
|
||||
RenderCommand,
|
||||
};
|
||||
use crate::{
|
||||
id,
|
||||
RawString,
|
||||
};
|
||||
use wgt::{BufferAddress, Color, DynamicOffset};
|
||||
use crate::{id, RawString};
|
||||
use std::{convert::TryInto, slice};
|
||||
use wgt::{BufferAddress, Color, DynamicOffset};
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
@@ -1199,9 +1202,7 @@ pub mod render_ffi {
|
||||
bind_group_id,
|
||||
phantom_offsets: PhantomSlice::default(),
|
||||
});
|
||||
pass.encode_slice(
|
||||
slice::from_raw_parts(offsets, offset_length),
|
||||
);
|
||||
pass.encode_slice(slice::from_raw_parts(offsets, offset_length));
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
@@ -1243,10 +1244,7 @@ pub mod render_ffi {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_render_pass_set_blend_color(
|
||||
pass: &mut RawPass,
|
||||
color: &Color,
|
||||
) {
|
||||
pub unsafe extern "C" fn wgpu_render_pass_set_blend_color(pass: &mut RawPass, color: &Color) {
|
||||
pass.encode(&RenderCommand::SetBlendColor(*color));
|
||||
}
|
||||
|
||||
@@ -1326,10 +1324,7 @@ pub mod render_ffi {
|
||||
buffer_id: id::BufferId,
|
||||
offset: BufferAddress,
|
||||
) {
|
||||
pass.encode(&RenderCommand::DrawIndirect {
|
||||
buffer_id,
|
||||
offset,
|
||||
});
|
||||
pass.encode(&RenderCommand::DrawIndirect { buffer_id, offset });
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
@@ -1338,10 +1333,7 @@ pub mod render_ffi {
|
||||
buffer_id: id::BufferId,
|
||||
offset: BufferAddress,
|
||||
) {
|
||||
pass.encode(&RenderCommand::DrawIndexedIndirect {
|
||||
buffer_id,
|
||||
offset,
|
||||
});
|
||||
pass.encode(&RenderCommand::DrawIndexedIndirect { buffer_id, offset });
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
@@ -1354,25 +1346,17 @@ pub mod render_ffi {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_render_pass_push_debug_group(
|
||||
_pass: &mut RawPass,
|
||||
_label: RawString,
|
||||
) {
|
||||
pub extern "C" fn wgpu_render_pass_push_debug_group(_pass: &mut RawPass, _label: RawString) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_render_pass_pop_debug_group(
|
||||
_pass: &mut RawPass,
|
||||
) {
|
||||
pub extern "C" fn wgpu_render_pass_pop_debug_group(_pass: &mut RawPass) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_render_pass_insert_debug_marker(
|
||||
_pass: &mut RawPass,
|
||||
_label: RawString,
|
||||
) {
|
||||
pub extern "C" fn wgpu_render_pass_insert_debug_marker(_pass: &mut RawPass, _label: RawString) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ use crate::{
|
||||
id::{BufferId, CommandEncoderId, TextureId},
|
||||
};
|
||||
|
||||
use wgt::{BufferAddress, BufferUsage, Extent3d, Origin3d, TextureUsage};
|
||||
use hal::command::CommandBuffer as _;
|
||||
use wgt::{BufferAddress, BufferUsage, Extent3d, Origin3d, TextureUsage};
|
||||
|
||||
use std::iter;
|
||||
|
||||
@@ -47,8 +47,8 @@ impl TextureCopyView {
|
||||
{
|
||||
hal::image::SubresourceRange {
|
||||
aspects,
|
||||
levels: level .. level + 1,
|
||||
layers: layer .. layer + 1,
|
||||
levels: level..level + 1,
|
||||
layers: layer..layer + 1,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ impl TextureCopyView {
|
||||
hal::image::SubresourceLayers {
|
||||
aspects,
|
||||
level: self.mip_level as hal::image::Level,
|
||||
layers: layer .. layer + 1,
|
||||
layers: layer..layer + 1,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let cmb_raw = cmb.raw.last_mut().unwrap();
|
||||
unsafe {
|
||||
cmb_raw.pipeline_barrier(
|
||||
all_buffer_stages() .. all_buffer_stages(),
|
||||
all_buffer_stages()..all_buffer_stages(),
|
||||
hal::memory::Dependencies::empty(),
|
||||
barriers,
|
||||
);
|
||||
@@ -172,7 +172,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let stages = all_buffer_stages() | all_image_stages();
|
||||
unsafe {
|
||||
cmb_raw.pipeline_barrier(
|
||||
stages .. stages,
|
||||
stages..stages,
|
||||
hal::memory::Dependencies::empty(),
|
||||
src_barriers.chain(dst_barriers),
|
||||
);
|
||||
@@ -236,7 +236,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let stages = all_buffer_stages() | all_image_stages();
|
||||
unsafe {
|
||||
cmb_raw.pipeline_barrier(
|
||||
stages .. stages,
|
||||
stages..stages,
|
||||
hal::memory::Dependencies::empty(),
|
||||
src_barriers.chain(dst_barrier),
|
||||
);
|
||||
@@ -297,7 +297,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let cmb_raw = cmb.raw.last_mut().unwrap();
|
||||
unsafe {
|
||||
cmb_raw.pipeline_barrier(
|
||||
all_image_stages() .. all_image_stages(),
|
||||
all_image_stages()..all_image_stages(),
|
||||
hal::memory::Dependencies::empty(),
|
||||
barriers,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user