gallium: change st->state.sampler_texture[] to store pipe_texture pointers
This is a better fix for the previous check-in. Fixes texadd.c conform test, and probably other bugs.
This commit is contained in:
@@ -55,6 +55,7 @@ update_textures(struct st_context *st)
|
|||||||
const GLuint su = fprog->Base.SamplerUnits[unit];
|
const GLuint su = fprog->Base.SamplerUnits[unit];
|
||||||
struct gl_texture_object *texObj = st->ctx->Texture.Unit[su]._Current;
|
struct gl_texture_object *texObj = st->ctx->Texture.Unit[su]._Current;
|
||||||
struct st_texture_object *stObj = st_texture_object(texObj);
|
struct st_texture_object *stObj = st_texture_object(texObj);
|
||||||
|
struct pipe_texture *pt;
|
||||||
|
|
||||||
if (texObj) {
|
if (texObj) {
|
||||||
GLboolean flush, retval;
|
GLboolean flush, retval;
|
||||||
@@ -67,18 +68,15 @@ update_textures(struct st_context *st)
|
|||||||
* this table before being deleted, otherwise the pointer
|
* this table before being deleted, otherwise the pointer
|
||||||
* comparison below could fail.
|
* comparison below could fail.
|
||||||
*/
|
*/
|
||||||
if (st->state.sampler_texture[unit] != stObj ||
|
|
||||||
(stObj && stObj->dirtyData)) {
|
pt = st_get_stobj_texture(stObj);
|
||||||
/* should really test if the bound 'pt' is changing */
|
|
||||||
struct pipe_texture *pt = st_get_stobj_texture(stObj);
|
if (st->state.sampler_texture[unit] != pt) {
|
||||||
st->state.sampler_texture[unit] = stObj;
|
st->state.sampler_texture[unit] = pt;
|
||||||
st->pipe->set_sampler_texture(st->pipe, unit, pt);
|
st->pipe->set_sampler_texture(st->pipe, unit, pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
stObj = st->state.sampler_texture[unit];
|
|
||||||
|
|
||||||
if (stObj && stObj->dirtyData) {
|
if (stObj && stObj->dirtyData) {
|
||||||
struct pipe_texture *pt = st_get_stobj_texture(stObj);
|
|
||||||
st->pipe->texture_update(st->pipe, pt);
|
st->pipe->texture_update(st->pipe, pt);
|
||||||
stObj->dirtyData = GL_FALSE;
|
stObj->dirtyData = GL_FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -727,8 +727,7 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
|
|||||||
pipe->bind_rasterizer_state(pipe, ctx->st->state.rasterizer->data);
|
pipe->bind_rasterizer_state(pipe, ctx->st->state.rasterizer->data);
|
||||||
pipe->bind_fs_state(pipe, ctx->st->state.fs->data);
|
pipe->bind_fs_state(pipe, ctx->st->state.fs->data);
|
||||||
pipe->bind_vs_state(pipe, ctx->st->state.vs->cso->data);
|
pipe->bind_vs_state(pipe, ctx->st->state.vs->cso->data);
|
||||||
pipe->set_sampler_texture(pipe, unit,
|
pipe->set_sampler_texture(pipe, unit, ctx->st->state.sampler_texture[unit]);
|
||||||
st_get_stobj_texture(ctx->st->state.sampler_texture[unit]));
|
|
||||||
pipe->bind_sampler_state(pipe, unit, ctx->st->state.sampler[unit]->data);
|
pipe->bind_sampler_state(pipe, unit, ctx->st->state.sampler[unit]->data);
|
||||||
pipe->set_viewport_state(pipe, &ctx->st->state.viewport);
|
pipe->set_viewport_state(pipe, &ctx->st->state.viewport);
|
||||||
}
|
}
|
||||||
|
@@ -86,7 +86,7 @@ struct st_context
|
|||||||
struct pipe_clip_state clip;
|
struct pipe_clip_state clip;
|
||||||
struct pipe_constant_buffer constants[2];
|
struct pipe_constant_buffer constants[2];
|
||||||
struct pipe_framebuffer_state framebuffer;
|
struct pipe_framebuffer_state framebuffer;
|
||||||
struct st_texture_object *sampler_texture[PIPE_MAX_SAMPLERS];
|
struct pipe_texture *sampler_texture[PIPE_MAX_SAMPLERS];
|
||||||
struct pipe_poly_stipple poly_stipple;
|
struct pipe_poly_stipple poly_stipple;
|
||||||
struct pipe_scissor_state scissor;
|
struct pipe_scissor_state scissor;
|
||||||
struct pipe_viewport_state viewport;
|
struct pipe_viewport_state viewport;
|
||||||
|
@@ -312,8 +312,7 @@ st_render_mipmap(struct st_context *st,
|
|||||||
pipe->bind_vs_state(pipe, st->state.vs->cso->data);
|
pipe->bind_vs_state(pipe, st->state.vs->cso->data);
|
||||||
if (st->state.sampler[0])
|
if (st->state.sampler[0])
|
||||||
pipe->bind_sampler_state(pipe, 0, st->state.sampler[0]->data);
|
pipe->bind_sampler_state(pipe, 0, st->state.sampler[0]->data);
|
||||||
pipe->set_sampler_texture(pipe, 0,
|
pipe->set_sampler_texture(pipe, 0, st->state.sampler_texture[0]);
|
||||||
st_get_stobj_texture(st->state.sampler_texture[0]));
|
|
||||||
pipe->set_viewport_state(pipe, &st->state.viewport);
|
pipe->set_viewport_state(pipe, &st->state.viewport);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Reference in New Issue
Block a user