From de12c6cb5470eb51f71b5392efe012a10230d3d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Thu, 19 Apr 2012 10:35:31 +0200 Subject: [PATCH] radeonsi: Fix sampler offsets for shader intrinsic. The sampler number is in TGSI source register 1, and the S_LOAD_DWORD* instructions take offsets in DWORDs, not bytes. --- src/gallium/drivers/radeonsi/radeonsi_shader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c index 50f2e39314f..33ba1cd7698 100644 --- a/src/gallium/drivers/radeonsi/radeonsi_shader.c +++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c @@ -450,12 +450,12 @@ static void tex_fetch_args( /* Resource */ emit_data->args[2] = use_sgpr(bld_base->base.gallivm, SGPR_I64, 2); emit_data->args[3] = lp_build_const_int32(bld_base->base.gallivm, - 32 * emit_data->inst->Src[2].Register.Index); + 8 * emit_data->inst->Src[1].Register.Index); /* Sampler */ emit_data->args[4] = use_sgpr(bld_base->base.gallivm, SGPR_I64, 1); emit_data->args[5] = lp_build_const_int32(bld_base->base.gallivm, - 16 * emit_data->inst->Src[2].Register.Index); + 4 * emit_data->inst->Src[1].Register.Index); /* Dimensions */ /* XXX: We might want to pass this information to the shader at some. */ -- 2.30.2