diff options
author | Christoph Bumiller <[email protected]> | 2011-03-04 22:15:17 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-03-05 00:51:07 +0100 |
commit | 1f5d6fc59bd899e211c70026eb74cd2219858008 (patch) | |
tree | e00a5abe3158dff9e80cd6391b92496a31f51986 /src/gallium/drivers/nv50 | |
parent | e4c968cdbbdc020afbf869d12b536c0a0dbf9de8 (diff) |
nv50,nvc0: share sampler state creation
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_stateobj.h | 25 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_stateobj_tex.h | 34 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_tex.c | 1 |
4 files changed, 38 insertions, 24 deletions
diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 3d6423b2238..980bc369293 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -380,7 +380,7 @@ nv50_tsc_wrap_mode(unsigned wrap) } } -static void * +void * nv50_sampler_state_create(struct pipe_context *pipe, const struct pipe_sampler_state *cso) { diff --git a/src/gallium/drivers/nv50/nv50_stateobj.h b/src/gallium/drivers/nv50/nv50_stateobj.h index f4e458b0c05..cf5b92ef1a8 100644 --- a/src/gallium/drivers/nv50/nv50_stateobj.h +++ b/src/gallium/drivers/nv50/nv50_stateobj.h @@ -16,35 +16,14 @@ #define SB_DATA(so, u) (so)->state[(so)->size++] = (u) +#include "nv50_stateobj_tex.h" + struct nv50_blend_stateobj { struct pipe_blend_state pipe; int size; uint32_t state[78]; }; -struct nv50_tsc_entry { - int id; - uint32_t tsc[8]; -}; - -static INLINE struct nv50_tsc_entry * -nv50_tsc_entry(void *hwcso) -{ - return (struct nv50_tsc_entry *)hwcso; -} - -struct nv50_tic_entry { - struct pipe_sampler_view pipe; - int id; - uint32_t tic[8]; -}; - -static INLINE struct nv50_tic_entry * -nv50_tic_entry(struct pipe_sampler_view *view) -{ - return (struct nv50_tic_entry *)view; -} - struct nv50_rasterizer_stateobj { struct pipe_rasterizer_state pipe; int size; diff --git a/src/gallium/drivers/nv50/nv50_stateobj_tex.h b/src/gallium/drivers/nv50/nv50_stateobj_tex.h new file mode 100644 index 00000000000..99548cbdb42 --- /dev/null +++ b/src/gallium/drivers/nv50/nv50_stateobj_tex.h @@ -0,0 +1,34 @@ + +#ifndef __NV50_STATEOBJ_TEX_H__ +#define __NV50_STATEOBJ_TEX_H__ + +#include "pipe/p_state.h" + +struct nv50_tsc_entry { + int id; + uint32_t tsc[8]; +}; + +static INLINE struct nv50_tsc_entry * +nv50_tsc_entry(void *hwcso) +{ + return (struct nv50_tsc_entry *)hwcso; +} + +struct nv50_tic_entry { + struct pipe_sampler_view pipe; + int id; + uint32_t tic[8]; +}; + +static INLINE struct nv50_tic_entry * +nv50_tic_entry(struct pipe_sampler_view *view) +{ + return (struct nv50_tic_entry *)view; +} + +extern void * +nv50_sampler_state_create(struct pipe_context *, + const struct pipe_sampler_state *); + +#endif /* __NV50_STATEOBJ_TEX_H__ */ diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c index cb1f2620786..e9d6e5f2016 100644 --- a/src/gallium/drivers/nv50/nv50_tex.c +++ b/src/gallium/drivers/nv50/nv50_tex.c @@ -148,6 +148,7 @@ nv50_create_sampler_view(struct pipe_context *pipe, break; case PIPE_BUFFER: tic[2] |= NV50_TIC_2_TARGET_BUFFER | NV50_TIC_2_LINEAR; + break; default: NOUVEAU_ERR("invalid texture target: %d\n", mt->base.base.target); return FALSE; |