mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
Fix read-write buffer barrier
This commit is contained in:
parent
d23288e455
commit
663f64c571
@ -1252,7 +1252,7 @@ impl<A: HalApi> Device<A> {
|
||||
if read_only {
|
||||
hal::BufferUses::STORAGE_READ
|
||||
} else {
|
||||
hal::BufferUses::STORAGE_WRITE
|
||||
hal::BufferUses::STORAGE_READ | hal::BufferUses::STORAGE_WRITE
|
||||
},
|
||||
limits.max_storage_buffer_binding_size,
|
||||
),
|
||||
|
@ -323,12 +323,11 @@ pub fn map_buffer_usage_to_state(usage: crate::BufferUses) -> d3d12::D3D12_RESOU
|
||||
if usage.intersects(Bu::VERTEX | Bu::UNIFORM) {
|
||||
state |= d3d12::D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER;
|
||||
}
|
||||
if usage.intersects(Bu::STORAGE_READ) {
|
||||
state |= d3d12::D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE
|
||||
| d3d12::D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE;
|
||||
}
|
||||
if usage.intersects(Bu::STORAGE_WRITE) {
|
||||
state |= d3d12::D3D12_RESOURCE_STATE_UNORDERED_ACCESS;
|
||||
} else if usage.intersects(Bu::STORAGE_READ) {
|
||||
state |= d3d12::D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE
|
||||
| d3d12::D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE;
|
||||
}
|
||||
if usage.intersects(Bu::INDIRECT) {
|
||||
state |= d3d12::D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT;
|
||||
|
@ -609,6 +609,7 @@ bitflags::bitflags! {
|
||||
Self::INDEX.bits | Self::VERTEX.bits | Self::UNIFORM.bits |
|
||||
Self::STORAGE_READ.bits | Self::INDIRECT.bits;
|
||||
/// The combination of exclusive usages (write-only and read-write).
|
||||
/// These usages may still show up with others, but can't automatically be combined.
|
||||
const EXCLUSIVE = Self::MAP_WRITE.bits | Self::COPY_DST.bits | Self::STORAGE_WRITE.bits;
|
||||
/// The combination of all usages that the are guaranteed to be be ordered by the hardware.
|
||||
/// If a usage is not ordered, then even if it doesn't change between draw calls, there
|
||||
@ -631,6 +632,7 @@ bitflags::bitflags! {
|
||||
/// The combination of usages that can be used together (read-only).
|
||||
const INCLUSIVE = Self::COPY_SRC.bits | Self::RESOURCE.bits | Self::DEPTH_STENCIL_READ.bits;
|
||||
/// The combination of exclusive usages (write-only and read-write).
|
||||
/// These usages may still show up with others, but can't automatically be combined.
|
||||
const EXCLUSIVE = Self::COPY_DST.bits | Self::COLOR_TARGET.bits | Self::DEPTH_STENCIL_WRITE.bits | Self::STORAGE_READ.bits | Self::STORAGE_WRITE.bits;
|
||||
/// The combination of all usages that the are guaranteed to be be ordered by the hardware.
|
||||
/// If a usage is not ordered, then even if it doesn't change between draw calls, there
|
||||
|
Loading…
Reference in New Issue
Block a user