#include "nv_object.xml.h"
#include "nv04_3d.xml.h"
#include "nv04_driver.h"
+#include "main/samplerobj.h"
static uint32_t
get_tex_format(struct gl_texture_image *ti)
if (ctx->Texture.Unit[i]._ReallyEnabled) {
struct gl_texture_object *t = ctx->Texture.Unit[i]._Current;
struct gl_texture_image *ti = t->Image[0][t->BaseLevel];
+ const struct gl_sampler_object *sa = _mesa_get_samplerobj(ctx, i);
int lod_max = 1, lod_bias = 0;
if (!nouveau_texture_validate(ctx, t))
s = &to_nouveau_texture(t)->surfaces[t->BaseLevel];
- if (t->Sampler.MinFilter != GL_NEAREST &&
- t->Sampler.MinFilter != GL_LINEAR) {
- lod_max = CLAMP(MIN2(t->Sampler.MaxLod, t->_MaxLambda),
+ if (sa->MinFilter != GL_NEAREST &&
+ sa->MinFilter != GL_LINEAR) {
+ lod_max = CLAMP(MIN2(sa->MaxLod, t->_MaxLambda),
0, 15) + 1;
lod_bias = CLAMP(ctx->Texture.Unit[i].LodBias +
- t->Sampler.LodBias, -16, 15) * 8;
+ sa->LodBias, -16, 15) * 8;
}
- format |= nvgl_wrap_mode(t->Sampler.WrapT) << 28 |
- nvgl_wrap_mode(t->Sampler.WrapS) << 24 |
+ format |= nvgl_wrap_mode(sa->WrapT) << 28 |
+ nvgl_wrap_mode(sa->WrapS) << 24 |
ti->HeightLog2 << 20 |
ti->WidthLog2 << 16 |
lod_max << 12 |
get_tex_format(ti);
- filter |= log2i(t->Sampler.MaxAnisotropy) << 31 |
- nvgl_filter_mode(t->Sampler.MagFilter) << 28 |
- log2i(t->Sampler.MaxAnisotropy) << 27 |
- nvgl_filter_mode(t->Sampler.MinFilter) << 24 |
+ filter |= log2i(sa->MaxAnisotropy) << 31 |
+ nvgl_filter_mode(sa->MagFilter) << 28 |
+ log2i(sa->MaxAnisotropy) << 27 |
+ nvgl_filter_mode(sa->MinFilter) << 24 |
(lod_bias & 0xff) << 16;
} else {