From 5777e87bed9de5db9ab08a1388265978507bc88e Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 7 Mar 2016 18:26:43 +0100 Subject: [PATCH] nvc0/ir: make sure that thread count immediate for BAR fit The limit of the thread count immediate value is 12 bits. Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp index 7bd7c732c49..8b9328b6296 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp @@ -1482,6 +1482,7 @@ CodeEmitterNVC0::emitBAR(const Instruction *i) } else { ImmediateValue *imm = i->getSrc(1)->asImm(); assert(imm); + assert(imm->reg.data.u32 <= 0xfff); code[0] |= imm->reg.data.u32 << 26; code[1] |= imm->reg.data.u32 >> 6; code[1] |= 0x4000; -- 2.30.2