summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_blit.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-01-21 08:59:25 -0700
committerBrian Paul <[email protected]>2013-01-22 14:53:58 -0700
commit728bf86a23f6de137c0871ea87b09e75e55468a9 (patch)
treec5f55821bd9e9cfbd8e85d659edc0ab0b33d9143 /src/mesa/swrast/s_blit.c
parent0a60ea4ddce3d7e0f07f9a8a94cd712c26401911 (diff)
swrast: move resampleRow setup code in blit_nearest()
The resampleRow setup depends on pixelSize. For color buffers, we don't know the pixelSize until we're in the buffer loop. Move that code inside the loop. Fixes: http://bugs.freedesktop.org/show_bug.cgi?id=59541 Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/mesa/swrast/s_blit.c')
-rw-r--r--src/mesa/swrast/s_blit.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c
index 3a4e7eec001..605c80ade14 100644
--- a/src/mesa/swrast/s_blit.c
+++ b/src/mesa/swrast/s_blit.c
@@ -188,29 +188,6 @@ blit_nearest(struct gl_context *ctx,
return;
}
- /* choose row resampler */
- switch (pixelSize) {
- case 1:
- resampleRow = resample_row_1;
- break;
- case 2:
- resampleRow = resample_row_2;
- break;
- case 4:
- resampleRow = resample_row_4;
- break;
- case 8:
- resampleRow = resample_row_8;
- break;
- case 16:
- resampleRow = resample_row_16;
- break;
- default:
- _mesa_problem(ctx, "unexpected pixel size (%d) in blit_nearest",
- pixelSize);
- return;
- }
-
/* Blit to all the draw buffers */
for (i = 0; i < numDrawBuffers; i++) {
if (buffer == GL_COLOR_BUFFER_BIT) {
@@ -232,6 +209,29 @@ blit_nearest(struct gl_context *ctx,
}
}
+ /* choose row resampler */
+ switch (pixelSize) {
+ case 1:
+ resampleRow = resample_row_1;
+ break;
+ case 2:
+ resampleRow = resample_row_2;
+ break;
+ case 4:
+ resampleRow = resample_row_4;
+ break;
+ case 8:
+ resampleRow = resample_row_8;
+ break;
+ case 16:
+ resampleRow = resample_row_16;
+ break;
+ default:
+ _mesa_problem(ctx, "unexpected pixel size (%d) in blit_nearest",
+ pixelSize);
+ return;
+ }
+
if ((readRb == drawRb) ||
(readAtt->Texture && drawAtt->Texture &&
(readAtt->Texture == drawAtt->Texture))) {