nv50/ir: set number of threads/block for variable local size
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 6 Sep 2016 22:12:51 +0000 (00:12 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 6 Oct 2016 22:18:57 +0000 (00:18 +0200)
When a variable local size is defined as specified by
ARB_compute_variable_group_size, the fixed local size is set to 0
and a SIGFPE occurs when we compute the maximum number of regs.

This allows to use 64 GPRs/thread.

v4: - use 512 threads on Fermi, 1024 on Kepler+

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/drivers/nouveau/codegen/nv50_ir_target.h

index 4a701f7..eaf50cc 100644 (file)
@@ -175,6 +175,8 @@ public:
 
    virtual void parseDriverInfo(const struct nv50_ir_prog_info *info) {
       threads = info->prop.cp.numThreads;
+      if (threads == 0)
+         threads = info->target >= NVISA_GK104_CHIPSET ? 1024 : 512;
    }
 
    virtual bool runLegalizePass(Program *, CGStage stage) const = 0;