summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_drawpixels.c
diff options
context:
space:
mode:
authorBryan Cain <[email protected]>2011-08-04 10:15:54 -0500
committerBryan Cain <[email protected]>2011-08-04 13:52:09 -0500
commit9adcab9cd464d659288e31e6767efb5dee3894ff (patch)
tree6c898d2efb5f906aea50c42f3216dff7aeba8ec1 /src/mesa/state_tracker/st_cb_drawpixels.c
parentb7e89115310628310bf458a33f2df2bf23384cf3 (diff)
st/mesa: replace duplicated create_color_map_texture() function with shared function
Diffstat (limited to 'src/mesa/state_tracker/st_cb_drawpixels.c')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index f4dd2a42847..0c4dc23ccf7 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -94,27 +94,6 @@ is_passthrough_program(const struct gl_fragment_program *prog)
}
-/* XXX copied verbatim from st_atom_pixeltransfer.c */
-static struct pipe_resource *
-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,
- 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;
-}
-
-
/**
* Returns a fragment program which implements the current pixel transfer ops.
*/
@@ -142,7 +121,7 @@ get_glsl_pixel_transfer_program(struct st_context *st,
if (pixelMaps) {
/* create the colormap/texture now if not already done */
if (!st->pixel_xfer.pixelmap_texture) {
- st->pixel_xfer.pixelmap_texture = create_color_map_texture(ctx);
+ st->pixel_xfer.pixelmap_texture = st_create_color_map_texture(ctx);
st->pixel_xfer.pixelmap_sampler_view =
st_create_texture_sampler_view(st->pipe,
st->pixel_xfer.pixelmap_texture);