summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_sampler.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-08-14 15:38:09 -0600
committerBrian Paul <[email protected]>2008-08-14 15:44:28 -0600
commit8f6d9e12be0be086ca2aab0b56dff8d2181addd9 (patch)
tree5f9b28a792eed3a01d00d1577617c97c40095bfd /src/mesa/state_tracker/st_atom_sampler.c
parent6c46b49d12b33b04546bee137f75ca7649e9a4ef (diff)
gallium: use a default texture in update_textures(), update_samplers() when needed
The default texture is used when the current fragment shader has texture sample instructions but the user has not provided/bound a texture.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_sampler.c')
-rw-r--r--src/mesa/state_tracker/st_atom_sampler.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
index 3ba6a971f6f..cef61fb55c5 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -35,6 +35,7 @@
#include "main/macros.h"
#include "st_context.h"
+#include "st_cb_texture.h"
#include "st_atom.h"
#include "st_program.h"
#include "pipe/p_context.h"
@@ -125,6 +126,8 @@ update_samplers(struct st_context *st)
st->state.num_samplers = 0;
+ /*printf("%s samplers used = 0x%x\n", __FUNCTION__, fs->Base.Base.SamplersUsed);*/
+
/* loop over sampler units (aka tex image units) */
for (su = 0; su < st->ctx->Const.MaxTextureImageUnits; su++) {
struct pipe_sampler_state *sampler = st->state.samplers + su;
@@ -136,8 +139,9 @@ update_samplers(struct st_context *st)
const struct gl_texture_object *texobj
= st->ctx->Texture.Unit[texUnit]._Current;
- if (!texobj)
- continue;
+ if (!texobj) {
+ texobj = st_get_default_texture(st);
+ }
sampler->wrap_s = gl_wrap_to_sp(texobj->WrapS);
sampler->wrap_t = gl_wrap_to_sp(texobj->WrapT);
@@ -184,11 +188,11 @@ update_samplers(struct st_context *st)
st->state.num_samplers = su + 1;
- /* XXX more sampler state here */
-
+ /*printf("%s su=%u non-null\n", __FUNCTION__, su);*/
cso_single_sampler(st->cso_context, su, sampler);
}
else {
+ /*printf("%s su=%u null\n", __FUNCTION__, su);*/
cso_single_sampler(st->cso_context, su, NULL);
}
}