if (!draw_pt_init( draw ))
goto fail;
+#ifndef PIPE_ARCH_X86
if (!draw_vs_init( draw ))
goto fail;
+#endif
return draw;
//struct pipe_buffer *constbuf[PIPE_SHADER_TYPES];
float *constbuf[PIPE_SHADER_TYPES][32][4];
+ unsigned constbuf_nr[PIPE_SHADER_TYPES];
struct vertex_info vertex_info;
if (buf->size && (mapped = ws->buffer_map(ws, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ)))
{
memcpy(nv10->constbuf[shader], mapped, buf->size);
+ nv10->constbuf_nr[shader] =
+ buf->size / (4 * sizeof(float));
ws->buffer_unmap(ws, buf->buffer);
}
}
draw_set_mapped_element_buffer(draw, 0, NULL);
}
- draw_set_mapped_constant_buffer(draw, nv10->constbuf[PIPE_SHADER_VERTEX]);
+ draw_set_mapped_constant_buffer(draw,
+ nv10->constbuf[PIPE_SHADER_VERTEX],
+ nv10->constbuf_nr[PIPE_SHADER_VERTEX]);
/* draw! */
draw_arrays(nv10->draw, prim, start, count);
return FALSE;
}
- fpc->attrib_map[fdec->u.DeclarationRange.First] = hw;
+ fpc->attrib_map[fdec->DeclarationRange.First] = hw;
return TRUE;
}
{
switch (fdec->Semantic.SemanticName) {
case TGSI_SEMANTIC_POSITION:
- fpc->depth_id = fdec->u.DeclarationRange.First;
+ fpc->depth_id = fdec->DeclarationRange.First;
break;
case TGSI_SEMANTIC_COLOR:
- fpc->colour_id = fdec->u.DeclarationRange.First;
+ fpc->colour_id = fdec->DeclarationRange.First;
break;
default:
NOUVEAU_ERR("bad output semantic\n");
return FALSE;
}
- vpc->output_map[fdec->u.DeclarationRange.First] = hw;
+ vpc->output_map[fdec->DeclarationRange.First] = hw;
return TRUE;
}
struct nv40_vertex_program *vertprog;
struct nv40_fragment_program *fragprog;
struct pipe_buffer *constbuf[PIPE_SHADER_TYPES];
+ unsigned constbuf_nr[PIPE_SHADER_TYPES];
struct nv40_rasterizer_state *rasterizer;
struct nv40_zsa_state *zsa;
struct nv40_blend_state *blend;
}
if (nv40->constbuf[PIPE_SHADER_VERTEX]) {
+ const unsigned nr = nv40->constbuf_nr[PIPE_SHADER_VERTEX];
+
map = ws->buffer_map(ws, nv40->constbuf[PIPE_SHADER_VERTEX],
PIPE_BUFFER_USAGE_CPU_READ);
- draw_set_mapped_constant_buffer(nv40->draw, map);
+ draw_set_mapped_constant_buffer(nv40->draw, map, nr);
}
draw_arrays(nv40->draw, mode, start, count);
return FALSE;
}
- fpc->attrib_map[fdec->u.DeclarationRange.First] = hw;
+ fpc->attrib_map[fdec->DeclarationRange.First] = hw;
return TRUE;
}
nv40_fragprog_parse_decl_output(struct nv40_fpc *fpc,
const struct tgsi_full_declaration *fdec)
{
- unsigned idx = fdec->u.DeclarationRange.First;
+ unsigned idx = fdec->DeclarationRange.First;
unsigned hw;
switch (fdec->Semantic.SemanticName) {
goto out_err;
break;
case TGSI_FILE_TEMPORARY:
- if (fdec->u.DeclarationRange.Last > high_temp) {
+ if (fdec->DeclarationRange.Last > high_temp) {
high_temp =
- fdec->u.DeclarationRange.Last;
+ fdec->DeclarationRange.Last;
}
break;
default:
{
struct nv40_context *nv40 = nv40_context(pipe);
+ nv40->constbuf[shader] = buf->buffer;
+ nv40->constbuf_nr[shader] = buf->size / (4 * sizeof(float));
+
if (shader == PIPE_SHADER_VERTEX) {
- nv40->constbuf[PIPE_SHADER_VERTEX] = buf->buffer;
nv40->dirty |= NV40_NEW_VERTPROG;
} else
if (shader == PIPE_SHADER_FRAGMENT) {
- nv40->constbuf[PIPE_SHADER_FRAGMENT] = buf->buffer;
nv40->dirty |= NV40_NEW_FRAGPROG;
}
}
nv40_vertprog_parse_decl_output(struct nv40_vpc *vpc,
const struct tgsi_full_declaration *fdec)
{
- unsigned idx = fdec->u.DeclarationRange.First;
+ unsigned idx = fdec->DeclarationRange.First;
int hw;
switch (fdec->Semantic.SemanticName) {
fdec = &p.FullToken.FullDeclaration;
switch (fdec->Declaration.File) {
case TGSI_FILE_TEMPORARY:
- if (fdec->u.DeclarationRange.Last > high_temp) {
+ if (fdec->DeclarationRange.Last > high_temp) {
high_temp =
- fdec->u.DeclarationRange.Last;
+ fdec->DeclarationRange.Last;
}
break;
#if 0 /* this would be nice.. except gallium doesn't track it */
case TGSI_FILE_ADDRESS:
- if (fdec->u.DeclarationRange.Last > high_addr) {
+ if (fdec->DeclarationRange.Last > high_addr) {
high_addr =
- fdec->u.DeclarationRange.Last;
+ fdec->DeclarationRange.Last;
}
break;
#endif