From 153779d93a0894dccd280b3e0737e98bf41c2628 Mon Sep 17 00:00:00 2001 From: knokko Date: Sat, 12 Oct 2024 17:18:19 +0200 Subject: [PATCH] Add compute ResourceUsage --- .../knokko/boiler/synchronization/ResourceUsage.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/github/knokko/boiler/synchronization/ResourceUsage.java b/src/main/java/com/github/knokko/boiler/synchronization/ResourceUsage.java index dd00b06..3a430d0 100644 --- a/src/main/java/com/github/knokko/boiler/synchronization/ResourceUsage.java +++ b/src/main/java/com/github/knokko/boiler/synchronization/ResourceUsage.java @@ -41,6 +41,14 @@ public static ResourceUsage shaderRead(int stageMask) { return new ResourceUsage(VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_ACCESS_SHADER_READ_BIT, stageMask); } + public static ResourceUsage compute(int imageLayout, int accessMask) { + return new ResourceUsage(imageLayout, accessMask, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT); + } + + public static ResourceUsage computeBuffer(int accessMask) { + return compute(0, accessMask); + } + public static ResourceUsage fromPresent(int stageMask) { return new ResourceUsage(VK_IMAGE_LAYOUT_UNDEFINED, 0, stageMask); }