[Mesa-dev] [PATCH 17/22] meta/blit: Don't use a vector second operand to shift operations
Ian Romanick
idr at freedesktop.org
Thu Feb 18 01:58:10 UTC 2016
From: Ian Romanick <ian.d.romanick at intel.com>
The GLSL spec says:
"The shift operators (<<) and (>>).... One operand can be signed
while the other is unsigned. In all cases, the resulting type will
be the same type as the left operand. If the first operand is a
scalar, the second operand has to be a scalar as well. If the
first operand is a vector, the second operand must be a scalar or
a vector, and the result is computed component-wise."
This should compute the same value since the shift count is the
literal 1. We still need separate versions of the function because of
the type rulse fo the bit-wise and operator.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/mesa/drivers/common/meta_blit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
index 1d40199..2e45231 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -474,7 +474,7 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx,
if (src_datatype == GL_INT || src_datatype == GL_UNSIGNED_INT) {
merge_function =
- "gvec4 merge(gvec4 a, gvec4 b) { return (a >> gvec4(1)) + (b >> gvec4(1)) + (a & b & gvec4(1)); }\n";
+ "gvec4 merge(gvec4 a, gvec4 b) { return (a >> 1) + (b >> 1) + (a & b & gvec4(1)); }\n";
} else {
/* The divide will happen at the end for floats. */
merge_function =
--
2.5.0
More information about the mesa-dev
mailing list