diff --git a/piet-gpu/shader/backdrop.comp b/piet-gpu/shader/backdrop.comp index afe4d62..beba683 100644 --- a/piet-gpu/shader/backdrop.comp +++ b/piet-gpu/shader/backdrop.comp @@ -15,7 +15,7 @@ #include "setup.h" -#define LG_BACKDROP_WG 8 +#define LG_BACKDROP_WG (7 + LG_WG_FACTOR) #define BACKDROP_WG (1 << LG_BACKDROP_WG) layout(local_size_x = BACKDROP_WG, local_size_y = 1) in; diff --git a/piet-gpu/shader/coarse.comp b/piet-gpu/shader/coarse.comp index 56b3c07..57cbc8b 100644 --- a/piet-gpu/shader/coarse.comp +++ b/piet-gpu/shader/coarse.comp @@ -41,7 +41,7 @@ layout(set = 0, binding = 4) buffer PtclBuf { #include "tile.h" #include "ptcl.h" -#define LG_N_PART_READ 8 +#define LG_N_PART_READ (7 + LG_WG_FACTOR) #define N_PART_READ (1 << LG_N_PART_READ) shared uint sh_elements[N_TILE]; diff --git a/piet-gpu/shader/elements.spv b/piet-gpu/shader/elements.spv index 5bd0650..54c5cc0 100644 Binary files a/piet-gpu/shader/elements.spv and b/piet-gpu/shader/elements.spv differ diff --git a/piet-gpu/shader/setup.h b/piet-gpu/shader/setup.h index 6c778ca..6bdde03 100644 --- a/piet-gpu/shader/setup.h +++ b/piet-gpu/shader/setup.h @@ -3,6 +3,11 @@ // Much of this will be made dynamic in various ways, but for now it's easiest // to hardcode and keep all in one place. +// A LG_WG_FACTOR of n scales workgroup sizes by 2^n. Use 0 for a +// maximum workgroup size of 128, or 1 for a maximum size of 256. +#define LG_WG_FACTOR 1 +#define WG_FACTOR (1<