summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-08-10 13:11:47 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-08-10 13:11:47 -0600
commit6ccdd5bb15d03b7eadc0f1e3ddba8848de4f146e (patch)
tree2d537f6402b3f12c23c3983f050fbd28622052da /src
parentce02b16dac0891a570a3a42f26463ea5c68f1618 (diff)
don't hardcode cpp
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index afe0342957..81b48859f0 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -102,16 +102,18 @@ make_mipmap_tree(struct st_context *st,
{
struct pipe_context *pipe = st->pipe;
const struct gl_texture_format *mformat;
- GLuint pipeFormat = st_choose_pipe_format(st->pipe, GL_RGBA, format, type);
- int cpp = 4;
- struct pipe_mipmap_tree *mt = CALLOC_STRUCT(pipe_mipmap_tree);
- GLbitfield flags = PIPE_SURFACE_FLAG_TEXTURE;
+ const GLbitfield flags = PIPE_SURFACE_FLAG_TEXTURE;
+ struct pipe_mipmap_tree *mt;
+ GLuint pipeFormat, cpp;
mformat = st_ChooseTextureFormat(st->ctx, GL_RGBA, format, type);
- assert(format);
+ assert(mformat);
pipeFormat = st_mesa_format_to_pipe_format(mformat->MesaFormat);
assert(pipeFormat);
+ cpp = st_sizeof_format(pipeFormat);
+
+ mt = CALLOC_STRUCT(pipe_mipmap_tree);
if (unpack->BufferObj && unpack->BufferObj->Name) {
/*
@@ -137,7 +139,7 @@ make_mipmap_tree(struct st_context *st,
mformat, /* gl_texture_format */
dest, /* dest */
0, 0, 0, /* dstX/Y/Zoffset */
- pitch * cpp, /* dstRowStride */
+ pitch * cpp, /* dstRowStride, bytes */
&dstImageOffsets, /* dstImageOffsets */
width, height, 1, /* size */
format, type, /* src format/type */