From 1f5d6fc59bd899e211c70026eb74cd2219858008 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Fri, 4 Mar 2011 22:15:17 +0100 Subject: nv50,nvc0: share sampler state creation --- src/gallium/drivers/nv50/nv50_state.c | 2 +- src/gallium/drivers/nv50/nv50_stateobj.h | 25 ++------------------ src/gallium/drivers/nv50/nv50_stateobj_tex.h | 34 ++++++++++++++++++++++++++++ src/gallium/drivers/nv50/nv50_tex.c | 1 + 4 files changed, 38 insertions(+), 24 deletions(-) create mode 100644 src/gallium/drivers/nv50/nv50_stateobj_tex.h (limited to 'src/gallium/drivers/nv50') diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 3d6423b223..980bc36929 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 f4e458b0c0..cf5b92ef1a 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 0000000000..99548cbdb4 --- /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 cb1f262078..e9d6e5f201 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; -- cgit v1.2.3