diff options
author | Christoph Bumiller <[email protected]> | 2012-05-16 20:52:41 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2012-05-17 15:24:58 +0200 |
commit | fcb28682101dfa127486373411043d5d97a0ff8f (patch) | |
tree | 178155b68e55c7d7278c70cff3569c985677d428 /src/gallium/drivers/nvc0/nvc0_context.h | |
parent | 07323a80a258372875e61f73a4f745374bea6bda (diff) |
nv50,nvc0: handle user constbufs without wrapping them in a resource
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_context.h')
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_context.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_context.h b/src/gallium/drivers/nvc0/nvc0_context.h index d2dee03a19e..261cfb11007 100644 --- a/src/gallium/drivers/nvc0/nvc0_context.h +++ b/src/gallium/drivers/nvc0/nvc0_context.h @@ -121,7 +121,7 @@ struct nvc0_context { struct nvc0_program *gmtyprog; struct nvc0_program *fragprog; - struct pipe_resource *constbuf[5][16]; + struct nvc0_constbuf constbuf[5][NVC0_MAX_PIPE_CONSTBUFS]; uint16_t constbuf_dirty[5]; struct pipe_vertex_buffer vtxbuf[PIPE_MAX_ATTRIBS]; @@ -168,6 +168,23 @@ nvc0_context(struct pipe_context *pipe) return (struct nvc0_context *)pipe; } +static INLINE unsigned +nvc0_shader_stage(unsigned pipe) +{ + switch (pipe) { + case PIPE_SHADER_VERTEX: return 0; +/* case PIPE_SHADER_TESSELLATION_CONTROL: return 1; */ +/* case PIPE_SHADER_TESSELLATION_EVALUATION: return 2; */ + case PIPE_SHADER_GEOMETRY: return 3; + case PIPE_SHADER_FRAGMENT: return 4; + case PIPE_SHADER_COMPUTE: return 5; + default: + assert(!"invalid PIPE_SHADER type"); + return 0; + } +} + + /* nvc0_context.c */ struct pipe_context *nvc0_create(struct pipe_screen *, void *); void nvc0_bufctx_fence(struct nvc0_context *, struct nouveau_bufctx *, |