From 1b0fec444fd23b99345b2818fcbe29d406709b0d Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 2 Oct 2020 17:41:15 -0500 Subject: [PATCH] iris: Fix the constant data address calculation In 536727c46517, we switched iris to patching the constant data address into the shader but, thanks to my lack of understanding how iris works, I got the calculation wrong. I didn't realize, we needed to call iris_bo_offset_from_base_address to get the BO offset from the start of instruction state base address. Fixes: 536727c465170c "iris: Patch constant data pointers into shaders" Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3596 Reviewed-by: Kenneth Graunke Part-of: --- src/gallium/drivers/iris/iris_program_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_program_cache.c b/src/gallium/drivers/iris/iris_program_cache.c index 82feab3f3d7..5a0758569f0 100644 --- a/src/gallium/drivers/iris/iris_program_cache.c +++ b/src/gallium/drivers/iris/iris_program_cache.c @@ -229,7 +229,8 @@ iris_upload_shader(struct iris_context *ice, &shader->map); memcpy(shader->map, assembly, prog_data->program_size); - uint64_t shader_data_addr = IRIS_MEMZONE_SHADER_START + + struct iris_resource *res = (void *) shader->assembly.res; + uint64_t shader_data_addr = res->bo->gtt_offset + shader->assembly.offset + prog_data->const_data_offset;