diff options
author | Bryan Cain <[email protected]> | 2011-08-04 15:43:34 -0500 |
---|---|---|
committer | Bryan Cain <[email protected]> | 2011-08-04 15:43:34 -0500 |
commit | 4683529048ee133481b2d8f1cae1685aa1736f9a (patch) | |
tree | e02d90f4164e4dc6259000c358d65e6af84a3a31 /src/mesa/state_tracker/st_texture.c | |
parent | 50073563b2bfe3716b3dc8b1ed2f91381ba24305 (diff) | |
parent | 9adcab9cd464d659288e31e6767efb5dee3894ff (diff) |
Merge branch 'glsl-to-tgsi'
Conflicts:
src/mesa/state_tracker/st_atom_pixeltransfer.c
src/mesa/state_tracker/st_program.c
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r-- | src/mesa/state_tracker/st_texture.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index ffe7e256a56..0e857fddcdd 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -396,3 +396,23 @@ st_texture_image_copy(struct pipe_context *pipe, } } + +struct pipe_resource * +st_create_color_map_texture(struct gl_context *ctx) +{ + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + struct pipe_resource *pt; + enum pipe_format format; + const uint texSize = 256; /* simple, and usually perfect */ + + /* find an RGBA texture format */ + format = st_choose_format(pipe->screen, GL_RGBA, GL_NONE, GL_NONE, + PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW); + + /* create texture for color map/table */ + pt = st_texture_create(st, PIPE_TEXTURE_2D, format, 0, + texSize, texSize, 1, 1, PIPE_BIND_SAMPLER_VIEW); + return pt; +} + |