mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 14:56:42 +00:00
Treat atomic writes in shaders as write accesses (#1989)
This commit is contained in:
parent
8f99ceab32
commit
0bab019d10
@ -442,7 +442,7 @@ mod linux {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let surface = WindowBuilder::new()
|
let surface = WindowBuilder::new()
|
||||||
.build_vk_surface(&event_loop, instance.clone())
|
.build_vk_surface(event_loop, instance.clone())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let device_extensions = DeviceExtensions {
|
let device_extensions = DeviceExtensions {
|
||||||
|
@ -293,8 +293,23 @@ fn inspect_entry_point(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
match instruction {
|
match instruction {
|
||||||
&Instruction::AtomicLoad { pointer, .. }
|
&Instruction::AtomicLoad { pointer, .. } => {
|
||||||
| &Instruction::AtomicStore { pointer, .. }
|
// Storage buffer
|
||||||
|
instruction_chain(result, global, spirv, [], pointer);
|
||||||
|
|
||||||
|
// Storage image
|
||||||
|
if let Some((variable, Some(index))) = instruction_chain(
|
||||||
|
result,
|
||||||
|
global,
|
||||||
|
spirv,
|
||||||
|
[inst_image_texel_pointer],
|
||||||
|
pointer,
|
||||||
|
) {
|
||||||
|
variable.reqs.storage_image_atomic.insert(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&Instruction::AtomicStore { pointer, .. }
|
||||||
| &Instruction::AtomicExchange { pointer, .. }
|
| &Instruction::AtomicExchange { pointer, .. }
|
||||||
| &Instruction::AtomicCompareExchange { pointer, .. }
|
| &Instruction::AtomicCompareExchange { pointer, .. }
|
||||||
| &Instruction::AtomicCompareExchangeWeak { pointer, .. }
|
| &Instruction::AtomicCompareExchangeWeak { pointer, .. }
|
||||||
@ -315,7 +330,11 @@ fn inspect_entry_point(
|
|||||||
| &Instruction::AtomicFMaxEXT { pointer, .. }
|
| &Instruction::AtomicFMaxEXT { pointer, .. }
|
||||||
| &Instruction::AtomicFAddEXT { pointer, .. } => {
|
| &Instruction::AtomicFAddEXT { pointer, .. } => {
|
||||||
// Storage buffer
|
// Storage buffer
|
||||||
instruction_chain(result, global, spirv, [], pointer);
|
if let Some((variable, Some(index))) =
|
||||||
|
instruction_chain(result, global, spirv, [], pointer)
|
||||||
|
{
|
||||||
|
variable.reqs.storage_write.insert(index);
|
||||||
|
}
|
||||||
|
|
||||||
// Storage image
|
// Storage image
|
||||||
if let Some((variable, Some(index))) = instruction_chain(
|
if let Some((variable, Some(index))) = instruction_chain(
|
||||||
@ -325,6 +344,7 @@ fn inspect_entry_point(
|
|||||||
[inst_image_texel_pointer],
|
[inst_image_texel_pointer],
|
||||||
pointer,
|
pointer,
|
||||||
) {
|
) {
|
||||||
|
variable.reqs.storage_write.insert(index);
|
||||||
variable.reqs.storage_image_atomic.insert(index);
|
variable.reqs.storage_image_atomic.insert(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user