[Mesa-dev] [PATCH 16/17] glsl: Linking support for doubles (was: add double support)
Matt Turner
mattst88 at gmail.com
Thu Feb 5 11:17:45 PST 2015
On Thu, Feb 5, 2015 at 3:05 AM, Topi Pohjolainen
<topi.pohjolainen at intel.com> wrote:
> From: Dave Airlie <airlied at gmail.com>
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/glsl/link_uniform_initializers.cpp | 7 ++++++-
> src/glsl/link_varyings.cpp | 3 ++-
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/glsl/link_uniform_initializers.cpp b/src/glsl/link_uniform_initializers.cpp
> index f6a60bc..b4fb38f 100644
> --- a/src/glsl/link_uniform_initializers.cpp
> +++ b/src/glsl/link_uniform_initializers.cpp
> @@ -75,6 +75,10 @@ copy_constant_to_storage(union gl_constant_value *storage,
> case GLSL_TYPE_FLOAT:
> storage[i].f = val->value.f[i];
> break;
> + case GLSL_TYPE_DOUBLE:
> + storage[i * 2].u = *(uint32_t *)&val->value.d[i];
> + storage[i * 2 + 1].u = *(((uint32_t *)&val->value.d[i]) + 1);
I'd feel better if we could use memcpy.
The rest of the patch looks fine.
More information about the mesa-dev
mailing list