Skip to content

Commit

Permalink
Ch5: reduce the number of thread groups in 09_ComputeMesh so that i…
Browse files Browse the repository at this point in the history
…t can run on Intel GPUs
  • Loading branch information
corporateshark committed Apr 12, 2024
1 parent 03fcfee commit 0e74afa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Chapter05/09_ComputeMesh/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ float g_AnimationSpeed = 1.0f;

bool g_UseColoredMesh = false;

constexpr uint32_t kNumU = 1024;
constexpr uint32_t kNumV = 1024;
constexpr uint32_t kNumU = 768;
constexpr uint32_t kNumV = 768;

void generateIndices(uint32_t* indices)
{
Expand Down Expand Up @@ -234,7 +234,7 @@ int main()

buf.cmdBindComputePipeline(pipelineComputeMesh);
buf.cmdPushConstants(pc);
buf.cmdDispatchThreadGroups({ .width = (kNumU * kNumV) / 2 }, { .buffers = { { lvk::BufferHandle(bufferVertex) } } });
buf.cmdDispatchThreadGroups({ .width = (kNumU * kNumV) / 16 }, { .buffers = { { lvk::BufferHandle(bufferVertex) } } });
if (!g_UseColoredMesh) {
buf.cmdBindComputePipeline(pipelineComputeTexture);
buf.cmdDispatchThreadGroups({ .width = 1024 / 16, .height = 1024 / 16 }, { .textures = { { lvk::TextureHandle(texture) } } });
Expand Down
2 changes: 1 addition & 1 deletion Chapter05/09_ComputeMesh/src/main_mesh.comp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
layout (local_size_x = 2, local_size_y = 1, local_size_z = 1) in;
layout (local_size_x = 16, local_size_y = 1, local_size_z = 1) in;

#include <Chapter05/09_ComputeMesh/src/common.sp>

Expand Down

0 comments on commit 0e74afa

Please sign in to comment.