mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 06:45:23 +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()
|
||||
.build_vk_surface(&event_loop, instance.clone())
|
||||
.build_vk_surface(event_loop, instance.clone())
|
||||
.unwrap();
|
||||
|
||||
let device_extensions = DeviceExtensions {
|
||||
|
@ -293,8 +293,23 @@ fn inspect_entry_point(
|
||||
}
|
||||
} else {
|
||||
match instruction {
|
||||
&Instruction::AtomicLoad { pointer, .. }
|
||||
| &Instruction::AtomicStore { pointer, .. }
|
||||
&Instruction::AtomicLoad { 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::AtomicCompareExchange { pointer, .. }
|
||||
| &Instruction::AtomicCompareExchangeWeak { pointer, .. }
|
||||
@ -315,7 +330,11 @@ fn inspect_entry_point(
|
||||
| &Instruction::AtomicFMaxEXT { pointer, .. }
|
||||
| &Instruction::AtomicFAddEXT { pointer, .. } => {
|
||||
// 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
|
||||
if let Some((variable, Some(index))) = instruction_chain(
|
||||
@ -325,6 +344,7 @@ fn inspect_entry_point(
|
||||
[inst_image_texel_pointer],
|
||||
pointer,
|
||||
) {
|
||||
variable.reqs.storage_write.insert(index);
|
||||
variable.reqs.storage_image_atomic.insert(index);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user