aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-04-28 09:39:48 -0600
committerBrian Paul <[email protected]>2008-04-28 09:39:48 -0600
commit44c79f88b8abbbcafe4e6e462d7f0d8505265e2b (patch)
treeca63287c2f0e3c4eec75463786379663ba010d34
parentee4434121c5ce556af8af899297d4249435c6d71 (diff)
gallium: replace some code with a call to st_choose_format()
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 047ea3816bc..7597ea323c7 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -983,22 +983,8 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
else {
/* srcFormat can't be used as a texture format */
if (type == GL_DEPTH) {
- static const enum pipe_format zFormats[] = {
- PIPE_FORMAT_Z16_UNORM,
- PIPE_FORMAT_Z32_UNORM,
- PIPE_FORMAT_S8Z24_UNORM,
- PIPE_FORMAT_Z24S8_UNORM
- };
- uint i;
- texFormat = 0;
- for (i = 0; i < Elements(zFormats); i++) {
- if (screen->is_format_supported(screen, zFormats[i],
- PIPE_TEXTURE)) {
- texFormat = zFormats[i];
- break;
- }
- }
- assert(texFormat); /* XXX no depth texture formats??? */
+ texFormat = st_choose_format(pipe, GL_DEPTH_COMPONENT, PIPE_TEXTURE);
+ assert(texFormat != PIPE_FORMAT_NONE); /* XXX no depth texture formats??? */
}
else {
/* todo */