[Mesa-dev] [PATCH 02/14] meta: Do power of two samples check only for samples > 0
Anuj Phogat
anuj.phogat at gmail.com
Mon Feb 23 14:36:39 PST 2015
otherwise samples=0 passes the check, which is invalid.
Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
src/mesa/drivers/common/meta_blit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
index bf893be..9498817 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -82,7 +82,7 @@ setup_glsl_msaa_blit_scaled_shader(struct gl_context *ctx,
y_scale = samples * 0.5;
/* We expect only power of 2 samples in source multisample buffer. */
- assert((samples & (samples - 1)) == 0);
+ assert(samples > 0 && (samples & (samples - 1)) == 0);
while (samples >> (shader_offset + 1)) {
shader_offset++;
}
@@ -261,7 +261,7 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx,
}
/* We expect only power of 2 samples in source multisample buffer. */
- assert((samples & (samples - 1)) == 0);
+ assert(samples > 0 && (samples & (samples - 1)) == 0);
while (samples >> (shader_offset + 1)) {
shader_offset++;
}
--
1.9.3
More information about the mesa-dev
mailing list