From 79a6dd111ef7f75e1738b0beba228b3dff5b2218 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 23 Nov 2018 14:39:33 +0100 Subject: [PATCH] [dxbc] Store workgroup size for compute shaders --- src/dxbc/dxbc_compiler.cpp | 4 ++++ src/dxbc/dxbc_compiler.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 730b0b30e..e7073ccfd 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -1305,6 +1305,10 @@ namespace dxvk { // (imm0) Number of threads in X dimension // (imm1) Number of threads in Y dimension // (imm2) Number of threads in Z dimension + m_cs.workgroupSizeX = ins.imm[0].u32; + m_cs.workgroupSizeY = ins.imm[1].u32; + m_cs.workgroupSizeZ = ins.imm[2].u32; + m_module.setLocalSize(m_entryPointId, ins.imm[0].u32, ins.imm[1].u32, ins.imm[2].u32); } diff --git a/src/dxbc/dxbc_compiler.h b/src/dxbc/dxbc_compiler.h index a7dd4fcaf..25d1c16f7 100644 --- a/src/dxbc/dxbc_compiler.h +++ b/src/dxbc/dxbc_compiler.h @@ -187,6 +187,10 @@ namespace dxvk { */ struct DxbcCompilerCsPart { uint32_t functionId = 0; + + uint32_t workgroupSizeX = 0; + uint32_t workgroupSizeY = 0; + uint32_t workgroupSizeZ = 0; uint32_t builtinGlobalInvocationId = 0; uint32_t builtinLocalInvocationId = 0;