#define NV40_WRAP(n) \
case PIPE_TEX_WRAP_##n: ret = NV40_3D_TEX_WRAP_S_##n; break
-static INLINE unsigned
+static inline unsigned
wrap_mode(unsigned pipe)
{
unsigned ret = NV30_3D_TEX_WRAP_S_REPEAT;
return ret >> NV30_3D_TEX_WRAP_S__SHIFT;
}
-static INLINE unsigned
+static inline unsigned
filter_mode(const struct pipe_sampler_state *cso)
{
unsigned filter;
return filter;
}
-static INLINE unsigned
+static inline unsigned
compare_mode(const struct pipe_sampler_state *cso)
{
if (cso->compare_mode != PIPE_TEX_COMPARE_R_TO_TEXTURE)
FREE(hwcso);
}
-static INLINE uint32_t
+static void
+nv30_bind_sampler_states(struct pipe_context *pipe,
+ enum pipe_shader_type shader, unsigned start_slot,
+ unsigned num_samplers, void **samplers)
+{
+ switch (shader) {
+ case PIPE_SHADER_VERTEX:
+ nv40_verttex_sampler_states_bind(pipe, num_samplers, samplers);
+ break;
+ case PIPE_SHADER_FRAGMENT:
+ nv30_fragtex_sampler_states_bind(pipe, num_samplers, samplers);
+ break;
+ default:
+ assert(!"unexpected shader type");
+ break;
+ }
+}
+
+static inline uint32_t
swizzle(const struct nv30_texfmt *fmt, unsigned cmp, unsigned swz)
{
uint32_t data = fmt->swz[swz].src << 8;
- if (swz <= PIPE_SWIZZLE_ALPHA)
+ if (swz <= PIPE_SWIZZLE_W)
data |= fmt->swz[swz].cmp;
else
data |= fmt->swz[cmp].cmp;
so->npot_size0 = (pt->width0 << 16) | pt->height0;
if (eng3d->oclass >= NV40_3D_CLASS) {
so->npot_size1 = (pt->depth0 << 20) | mt->uniform_pitch;
- if (!mt->swizzled)
+ if (mt->uniform_pitch)
so->fmt |= NV40_3D_TEX_FORMAT_LINEAR;
so->fmt |= 0x00008000;
so->fmt |= (pt->last_level + 1) << NV40_3D_TEX_FORMAT_MIPMAP_COUNT__SHIFT;
{
pipe->create_sampler_state = nv30_sampler_state_create;
pipe->delete_sampler_state = nv30_sampler_state_delete;
+ pipe->bind_sampler_states = nv30_bind_sampler_states;
+
pipe->create_sampler_view = nv30_sampler_view_create;
pipe->sampler_view_destroy = nv30_sampler_view_destroy;
}