Go to the source code of this file.
Functions | |
void * | softpipe_create_sampler_state (struct pipe_context *pipe, const struct pipe_sampler_state *sampler) |
void | softpipe_bind_sampler_states (struct pipe_context *pipe, unsigned num, void **sampler) |
void | softpipe_set_sampler_textures (struct pipe_context *pipe, unsigned num, struct pipe_texture **texture) |
void | softpipe_delete_sampler_state (struct pipe_context *pipe, void *sampler) |
void softpipe_bind_sampler_states | ( | struct pipe_context * | pipe, | |
unsigned | num, | |||
void ** | sampler | |||
) |
Definition at line 55 of file sp_state_sampler.c.
References assert, softpipe_context::dirty, softpipe_context::draw, draw_flush(), softpipe_context::num_samplers, PIPE_MAX_SAMPLERS, softpipe_context::sampler, softpipe_context(), and SP_NEW_SAMPLER.
00057 { 00058 struct softpipe_context *softpipe = softpipe_context(pipe); 00059 unsigned i; 00060 00061 assert(num <= PIPE_MAX_SAMPLERS); 00062 00063 /* Check for no-op */ 00064 if (num == softpipe->num_samplers && 00065 !memcmp(softpipe->sampler, sampler, num * sizeof(void *))) 00066 return; 00067 00068 draw_flush(softpipe->draw); 00069 00070 for (i = 0; i < num; ++i) 00071 softpipe->sampler[i] = sampler[i]; 00072 for (i = num; i < PIPE_MAX_SAMPLERS; ++i) 00073 softpipe->sampler[i] = NULL; 00074 00075 softpipe->num_samplers = num; 00076 00077 softpipe->dirty |= SP_NEW_SAMPLER; 00078 }
void* softpipe_create_sampler_state | ( | struct pipe_context * | pipe, | |
const struct pipe_sampler_state * | sampler | |||
) |
Definition at line 47 of file sp_state_sampler.c.
References mem_dup().
00049 { 00050 return mem_dup(sampler, sizeof(*sampler)); 00051 }
void softpipe_delete_sampler_state | ( | struct pipe_context * | pipe, | |
void * | sampler | |||
) |
void softpipe_set_sampler_textures | ( | struct pipe_context * | pipe, | |
unsigned | num, | |||
struct pipe_texture ** | texture | |||
) |
Definition at line 82 of file sp_state_sampler.c.
References assert, softpipe_context::dirty, softpipe_context::draw, draw_flush(), softpipe_context::num_textures, PIPE_MAX_SAMPLERS, pipe_texture_reference(), softpipe_context(), SP_NEW_TEXTURE, sp_tile_cache_set_texture(), softpipe_context::tex_cache, and softpipe_context::texture.
00084 { 00085 struct softpipe_context *softpipe = softpipe_context(pipe); 00086 uint i; 00087 00088 assert(num <= PIPE_MAX_SAMPLERS); 00089 00090 /* Check for no-op */ 00091 if (num == softpipe->num_textures && 00092 !memcmp(softpipe->texture, texture, num * sizeof(struct pipe_texture *))) 00093 return; 00094 00095 draw_flush(softpipe->draw); 00096 00097 for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { 00098 struct pipe_texture *tex = i < num ? texture[i] : NULL; 00099 00100 pipe_texture_reference(&softpipe->texture[i], tex); 00101 sp_tile_cache_set_texture(pipe, softpipe->tex_cache[i], tex); 00102 } 00103 00104 softpipe->num_textures = num; 00105 00106 softpipe->dirty |= SP_NEW_TEXTURE; 00107 }