{
struct pipe_winsys *ws = nv50->pipe.winsys;
struct nv50_program_exec *e;
+ boolean upload = FALSE;
unsigned *map;
- if (!p->buffer)
+ if (!p->buffer) {
p->buffer = ws->buffer_create(ws, 0x100, 0, p->exec_size * 4);
+ upload = TRUE;
+ }
if (p->data && p->data->start != p->data_start) {
for (e = p->exec_head; e; e = e->next) {
}
p->data_start = p->data->start;
+ upload = TRUE;
}
+ if (!upload)
+ return FALSE;
+
map = ws->buffer_map(ws, p->buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
for (e = p->exec_head; e; e = e->next) {
#ifdef NV50_PROGRAM_DUMP
if (nv50->dirty & NV50_NEW_ZSA)
so_emit(nvws, nv50->zsa->so);
- if (nv50->dirty & NV50_NEW_VERTPROG)
+ if (nv50->dirty & (NV50_NEW_VERTPROG | NV50_NEW_VERTPROG_CB))
nv50_vertprog_validate(nv50);
- if (nv50->dirty & NV50_NEW_FRAGPROG)
+ if (nv50->dirty & (NV50_NEW_FRAGPROG | NV50_NEW_FRAGPROG_CB))
nv50_fragprog_validate(nv50);
if (nv50->dirty & NV50_NEW_RASTERIZER)
so_ref(NULL, &so);
}
- if (nv50->dirty & NV50_NEW_VERTPROG_CB) {
- so = so_new(4, 2);
- so_method(so, tesla, 0x1280, 3);
- so_reloc (so, nv50->constbuf[PIPE_SHADER_VERTEX], 0,
- NOUVEAU_BO_HIGH | NOUVEAU_BO_RD | NOUVEAU_BO_VRAM,
- 0, 0);
- so_reloc (so, nv50->constbuf[PIPE_SHADER_VERTEX], 0,
- NOUVEAU_BO_LOW | NOUVEAU_BO_RD | NOUVEAU_BO_VRAM,
- 0, 0);
- so_data (so, (NV50_CB_PVP << 16) | 0x1000);
- so_emit(nvws, so);
- so_ref(NULL, &so);
- }
-
- if (nv50->dirty & NV50_NEW_FRAGPROG_CB) {
- so = so_new(4, 2);
- so_method(so, tesla, 0x1280, 3);
- so_reloc (so, nv50->constbuf[PIPE_SHADER_FRAGMENT], 0,
- NOUVEAU_BO_HIGH | NOUVEAU_BO_RD | NOUVEAU_BO_VRAM,
- 0, 0);
- so_reloc (so, nv50->constbuf[PIPE_SHADER_FRAGMENT], 0,
- NOUVEAU_BO_LOW | NOUVEAU_BO_RD | NOUVEAU_BO_VRAM,
- 0, 0);
- so_data (so, (NV50_CB_PFP << 16) | 0x1000);
- so_emit(nvws, so);
- so_ref(NULL, &so);
- }
-
-
if (nv50->dirty & NV50_NEW_ARRAYS)
nv50_vbo_validate(nv50);