nv50: apply relocations to shader code
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 2 Mar 2011 14:39:57 +0000 (15:39 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 2 Mar 2011 19:59:53 +0000 (20:59 +0100)
On nv50, branches are absolute, so we need to adjust them according
to the shader's position in the code buffer.

src/gallium/drivers/nv50/nv50_shader_state.c

index 7d4b12bde1711c7da6cb02925bf290b39bcf312c..f5685c1cd7d62c7b8f302e5ae5a5e38306cca957 100644 (file)
@@ -149,6 +149,8 @@ nv50_program_validate(struct nv50_context *nv50, struct nv50_program *prog)
       return FALSE;
    prog->code_base = prog->res->start;
 
+   nv50_relocate_program(prog, prog->code_base, 0);
+
    nv50_sifc_linear_u8(&nv50->base, nv50->screen->code,
                        (prog->type << 16) + prog->code_base,
                        NOUVEAU_BO_VRAM, prog->code_size, prog->code);