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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
// Copyright 2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
#ifdef __cplusplus
namespace ispc {
#endif // __cplusplus
#if defined(__cplusplus) && !defined(OSPRAY_TARGET_SYCL)
typedef void *Texture_get;
typedef void *Texture_getN;
#else
struct Texture;
struct DifferentialGeometry;
typedef varying vec4f (*Texture_get)(
const Texture *uniform self, const varying DifferentialGeometry &dg);
typedef varying vec3f (*Texture_getN)(
const Texture *uniform self, const varying DifferentialGeometry &dg);
#endif
enum TextureType
{
TEXTURE_TYPE_2D,
#ifdef OSPRAY_ENABLE_VOLUMES
TEXTURE_TYPE_VOLUME,
#endif
TEXTURE_TYPE_UNKNOWN,
};
struct Texture
{
TextureType type;
Texture_get get;
Texture_getN getNormal;
bool hasAlpha; // 4 channel texture?
#ifdef __cplusplus
Texture(bool hasAlpha = false)
: type(TEXTURE_TYPE_UNKNOWN),
get(nullptr),
getNormal(nullptr),
hasAlpha(hasAlpha)
{}
};
} // namespace ispc
#else
};
#endif // __cplusplus
|