summaryrefslogtreecommitdiffstats
path: root/third_party/rust/wgpu-core/src/command/bundle.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /third_party/rust/wgpu-core/src/command/bundle.rs
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/wgpu-core/src/command/bundle.rs')
-rw-r--r--third_party/rust/wgpu-core/src/command/bundle.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/third_party/rust/wgpu-core/src/command/bundle.rs b/third_party/rust/wgpu-core/src/command/bundle.rs
index ab2d18bc59..47beda8ec6 100644
--- a/third_party/rust/wgpu-core/src/command/bundle.rs
+++ b/third_party/rust/wgpu-core/src/command/bundle.rs
@@ -99,6 +99,7 @@ use crate::{
pipeline::{PipelineFlags, RenderPipeline, VertexStep},
resource::{Buffer, Resource, ResourceInfo, ResourceType},
resource_log,
+ snatch::SnatchGuard,
track::RenderBundleScope,
validation::check_buffer_usage,
Label, LabelHelpers,
@@ -165,7 +166,7 @@ fn validate_indexed_draw<A: HalApi>(
) -> Result<(), DrawError> {
let last_index = first_index as u64 + index_count as u64;
let index_limit = index_state.limit();
- if last_index <= index_limit {
+ if last_index > index_limit {
return Err(DrawError::IndexBeyondLimit {
last_index,
index_limit,
@@ -894,7 +895,11 @@ impl<A: HalApi> RenderBundle<A> {
/// Note that the function isn't expected to fail, generally.
/// All the validation has already been done by this point.
/// The only failure condition is if some of the used buffers are destroyed.
- pub(super) unsafe fn execute(&self, raw: &mut A::CommandEncoder) -> Result<(), ExecutionError> {
+ pub(super) unsafe fn execute(
+ &self,
+ raw: &mut A::CommandEncoder,
+ snatch_guard: &SnatchGuard,
+ ) -> Result<(), ExecutionError> {
let mut offsets = self.base.dynamic_offsets.as_slice();
let mut pipeline_layout = None::<Arc<PipelineLayout<A>>>;
if !self.discard_hal_labels {
@@ -903,8 +908,6 @@ impl<A: HalApi> RenderBundle<A> {
}
}
- let snatch_guard = self.device.snatchable_lock.read();
-
use ArcRenderCommand as Cmd;
for command in self.base.commands.iter() {
match command {
@@ -914,7 +917,7 @@ impl<A: HalApi> RenderBundle<A> {
bind_group,
} => {
let raw_bg = bind_group
- .raw(&snatch_guard)
+ .raw(snatch_guard)
.ok_or(ExecutionError::InvalidBindGroup(bind_group.info.id()))?;
unsafe {
raw.set_bind_group(
@@ -938,7 +941,7 @@ impl<A: HalApi> RenderBundle<A> {
size,
} => {
let buffer: &A::Buffer = buffer
- .raw(&snatch_guard)
+ .raw(snatch_guard)
.ok_or(ExecutionError::DestroyedBuffer(buffer.info.id()))?;
let bb = hal::BufferBinding {
buffer,
@@ -954,7 +957,7 @@ impl<A: HalApi> RenderBundle<A> {
size,
} => {
let buffer = buffer
- .raw(&snatch_guard)
+ .raw(snatch_guard)
.ok_or(ExecutionError::DestroyedBuffer(buffer.info.id()))?;
let bb = hal::BufferBinding {
buffer,
@@ -1041,7 +1044,7 @@ impl<A: HalApi> RenderBundle<A> {
indexed: false,
} => {
let buffer = buffer
- .raw(&snatch_guard)
+ .raw(snatch_guard)
.ok_or(ExecutionError::DestroyedBuffer(buffer.info.id()))?;
unsafe { raw.draw_indirect(buffer, *offset, 1) };
}
@@ -1052,7 +1055,7 @@ impl<A: HalApi> RenderBundle<A> {
indexed: true,
} => {
let buffer = buffer
- .raw(&snatch_guard)
+ .raw(snatch_guard)
.ok_or(ExecutionError::DestroyedBuffer(buffer.info.id()))?;
unsafe { raw.draw_indexed_indirect(buffer, *offset, 1) };
}