plug in texture/sampler state update

This commit is contained in:
Brian
2007-08-07 15:12:22 -06:00
parent 28d64d398b
commit d78dab1267
6 changed files with 28 additions and 7 deletions

View File

@@ -54,6 +54,8 @@ static const struct st_tracked_state *atoms[] =
&st_update_scissor, &st_update_scissor,
&st_update_blend, &st_update_blend,
&st_update_stencil, &st_update_stencil,
&st_update_sampler,
&st_update_texture,
/* will be patched out at runtime */ /* will be patched out at runtime */
/* &st_update_constants */ /* &st_update_constants */
}; };

View File

@@ -57,6 +57,8 @@ const struct st_tracked_state st_update_constants;
const struct st_tracked_state st_update_scissor; const struct st_tracked_state st_update_scissor;
const struct st_tracked_state st_update_blend; const struct st_tracked_state st_update_blend;
const struct st_tracked_state st_update_stencil; const struct st_tracked_state st_update_stencil;
const struct st_tracked_state st_update_sampler;
const struct st_tracked_state st_update_texture;
#endif #endif

View File

@@ -103,14 +103,16 @@ update_samplers(struct st_context *st)
memset(&sampler, 0, sizeof(sampler)); memset(&sampler, 0, sizeof(sampler));
sampler.wrap_s = gl_wrap_to_sp(texobj->WrapS); if (texobj) {
sampler.wrap_t = gl_wrap_to_sp(texobj->WrapT); sampler.wrap_s = gl_wrap_to_sp(texobj->WrapS);
sampler.wrap_r = gl_wrap_to_sp(texobj->WrapR); sampler.wrap_t = gl_wrap_to_sp(texobj->WrapT);
sampler.wrap_r = gl_wrap_to_sp(texobj->WrapR);
sampler.min_filter = gl_filter_to_sp(texobj->MinFilter); sampler.min_filter = gl_filter_to_sp(texobj->MinFilter);
sampler.mag_filter = gl_filter_to_sp(texobj->MagFilter); sampler.mag_filter = gl_filter_to_sp(texobj->MagFilter);
/* XXX more sampler state here */ /* XXX more sampler state here */
}
if (memcmp(&sampler, &st->state.sampler[u], sizeof(sampler)) != 0) { if (memcmp(&sampler, &st->state.sampler[u], sizeof(sampler)) != 0) {
/* state has changed */ /* state has changed */

View File

@@ -39,7 +39,10 @@
#include "pipe/p_defines.h" #include "pipe/p_defines.h"
/**
* XXX This needs some work yet....
* Need to "upload" texture images at appropriate times.
*/
static void static void
update_textures(struct st_context *st) update_textures(struct st_context *st)
{ {

View File

@@ -104,6 +104,14 @@ st_texture_image(struct gl_texture_image *img)
} }
struct pipe_mipmap_tree *
st_get_texobj_mipmap_tree(struct gl_texture_object *texObj)
{
struct st_texture_object *stObj = st_texture_object(texObj);
return stObj->mt;
}
static int static int
intel_compressed_num_bytes(GLuint mesaFormat) intel_compressed_num_bytes(GLuint mesaFormat)
{ {

View File

@@ -2,6 +2,10 @@
#define ST_CB_TEXTURE_H #define ST_CB_TEXTURE_H
extern struct pipe_mipmap_tree *
st_get_texobj_mipmap_tree(struct gl_texture_object *texObj);
extern GLuint extern GLuint
st_finalize_mipmap_tree(GLcontext *ctx, st_finalize_mipmap_tree(GLcontext *ctx,
struct pipe_context *pipe, GLuint unit, struct pipe_context *pipe, GLuint unit,