On 11.05.2017 13:10, Iago Toral Quiroga wrote:
---
src/mesa/main/uniform_query.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 42abd18..25acc31 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -579,6 +579,13 @@ _mesa_get_uniform(struct gl_context *ctx, GLuint program,
GLint location,
memcpy(&dst[didx].u, &tmp, sizeof(tmp));
break;
}
+ case GLSL_TYPE_DOUBLE: {
+ double d;
+ memcpy(&d, &src[sidx].f, sizeof(d));
+ int64_t tmp = IROUNDD64(d);
+ memcpy(&dst[didx].u, &tmp, sizeof(tmp));
+ break;
+ }
default:
assert(!"Should not get here.");
break;
@@ -616,6 +623,13 @@ _mesa_get_uniform(struct gl_context *ctx, GLuint program,
GLint location,
memcpy(&dst[didx].u, &tmp, sizeof(tmp));
break;
}
+ case GLSL_TYPE_DOUBLE: {
+ double d;
+ memcpy(&d, &src[sidx].f, sizeof(d));
+ uint64_t tmp = (d < 0.0) ? 0 : IROUNDD64(d);
This needs to use an unsigned rounding function, doesn't it?
Cheers,
Nicolai
+ memcpy(&dst[didx].u, &tmp, sizeof(tmp));
+ break;
+ }
default:
assert(!"Should not get here.");
break;
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev