summaryrefslogtreecommitdiff
path: root/src/intel/vulkan/grl/include/GRLUtilities.h
blob: 22670bfad1b41be4d0bbe1337ede8dfe3142e2d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// Copyright (C) 2009-2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
//
//

#pragma once

#include "GRLOCLCompatibility.h"

GRL_NAMESPACE_BEGIN(GRL)

    GRL_INLINE float4 bitShiftLdexp4(float4 x, int4 y)
    {
        y = (y + 127) << 23;
        return x * as_float4(y);
    }

    GRL_INLINE float3 bitShiftLdexp3(float3 x, int3 y)
    {
        y = (y + 127) << 23;
        return x * as_float3(y);
    }

    GRL_INLINE float bitShiftLdexp(float x, int y)
    {
        y = (y + 127) << 23;
        return x * as_float(y);
    }

GRL_NAMESPACE_END(GRL)