nv50: fix code heap after pipe_shader_enum change
Instead of keying the shader heaps with the TGSI enum, do it with our nv50
one, so we won't run into issues like this in the future.
Fixes: 27f46465c7 ("gallium/tgsi: reorder pipe shader type defines.")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18236>
This commit is contained in:
@@ -506,10 +506,10 @@ nv50_program_upload_code(struct nv50_context *nv50, struct nv50_program *prog)
|
||||
|
||||
if (prog->type == PIPE_SHADER_COMPUTE) {
|
||||
/* CP code must be uploaded in FP code segment. */
|
||||
prog_type = 1;
|
||||
prog_type = NV50_SHADER_STAGE_FRAGMENT;
|
||||
} else {
|
||||
prog->code_base = prog->mem->start;
|
||||
prog_type = prog->type;
|
||||
prog_type = nv50_context_shader_stage(prog->type);
|
||||
}
|
||||
|
||||
ret = nv50_tls_realloc(nv50->screen, prog->tls_space);
|
||||
|
||||
@@ -785,16 +785,16 @@ nv50_screen_init_hwctx(struct nv50_screen *screen)
|
||||
PUSH_DATA (push, 0x3f);
|
||||
|
||||
BEGIN_NV04(push, NV50_3D(VP_ADDRESS_HIGH), 2);
|
||||
PUSH_DATAh(push, screen->code->offset + (0 << NV50_CODE_BO_SIZE_LOG2));
|
||||
PUSH_DATA (push, screen->code->offset + (0 << NV50_CODE_BO_SIZE_LOG2));
|
||||
PUSH_DATAh(push, screen->code->offset + (NV50_SHADER_STAGE_VERTEX << NV50_CODE_BO_SIZE_LOG2));
|
||||
PUSH_DATA (push, screen->code->offset + (NV50_SHADER_STAGE_VERTEX << NV50_CODE_BO_SIZE_LOG2));
|
||||
|
||||
BEGIN_NV04(push, NV50_3D(FP_ADDRESS_HIGH), 2);
|
||||
PUSH_DATAh(push, screen->code->offset + (1 << NV50_CODE_BO_SIZE_LOG2));
|
||||
PUSH_DATA (push, screen->code->offset + (1 << NV50_CODE_BO_SIZE_LOG2));
|
||||
PUSH_DATAh(push, screen->code->offset + (NV50_SHADER_STAGE_FRAGMENT << NV50_CODE_BO_SIZE_LOG2));
|
||||
PUSH_DATA (push, screen->code->offset + (NV50_SHADER_STAGE_FRAGMENT << NV50_CODE_BO_SIZE_LOG2));
|
||||
|
||||
BEGIN_NV04(push, NV50_3D(GP_ADDRESS_HIGH), 2);
|
||||
PUSH_DATAh(push, screen->code->offset + (2 << NV50_CODE_BO_SIZE_LOG2));
|
||||
PUSH_DATA (push, screen->code->offset + (2 << NV50_CODE_BO_SIZE_LOG2));
|
||||
PUSH_DATAh(push, screen->code->offset + (NV50_SHADER_STAGE_GEOMETRY << NV50_CODE_BO_SIZE_LOG2));
|
||||
PUSH_DATA (push, screen->code->offset + (NV50_SHADER_STAGE_GEOMETRY << NV50_CODE_BO_SIZE_LOG2));
|
||||
|
||||
BEGIN_NV04(push, NV50_3D(LOCAL_ADDRESS_HIGH), 3);
|
||||
PUSH_DATAh(push, screen->tls_bo->offset);
|
||||
|
||||
Reference in New Issue
Block a user