summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50/nv50_shader_state.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-03-03 12:25:12 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-03-03 12:32:40 +0100
commit7048ad62f89289c9e642203c009dca38ce8753f8 (patch)
tree4222749c13b89194fb8376e975bc890f79448f11 /src/gallium/drivers/nv50/nv50_shader_state.c
parent6b4e3e8941f41b6d15ac557e3d47bf4f1aa8b185 (diff)
nv50: increase size of shader code bo
512 KiB should be quite enough, but dynamic resize might be nicer.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_shader_state.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_shader_state.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/nv50/nv50_shader_state.c b/src/gallium/drivers/nv50/nv50_shader_state.c
index f7d78a3b11..bea9c095bb 100644
--- a/src/gallium/drivers/nv50/nv50_shader_state.c
+++ b/src/gallium/drivers/nv50/nv50_shader_state.c
@@ -138,6 +138,7 @@ nv50_program_validate(struct nv50_context *nv50, struct nv50_program *prog)
return FALSE;
if (prog->type == PIPE_SHADER_FRAGMENT) heap = nv50->screen->fp_code_heap;
+ else
if (prog->type == PIPE_SHADER_GEOMETRY) heap = nv50->screen->gp_code_heap;
else
heap = nv50->screen->vp_code_heap;
@@ -145,14 +146,16 @@ nv50_program_validate(struct nv50_context *nv50, struct nv50_program *prog)
size = align(prog->code_size, 0x100);
ret = nouveau_resource_alloc(heap, size, prog, &prog->res);
- if (ret)
+ if (ret) {
+ NOUVEAU_ERR("out of code space for shader type %i\n", prog->type);
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,
+ (prog->type << NV50_CODE_BO_SIZE_LOG2) + prog->code_base,
NOUVEAU_BO_VRAM, prog->code_size, prog->code);
BEGIN_RING(nv50->screen->base.channel, RING_3D(CODE_CB_FLUSH), 1);