7#ifndef PXR_IMAGING_HD_TYPES_H
8#define PXR_IMAGING_HD_TYPES_H
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/enums.h"
13#include "pxr/imaging/hd/version.h"
14#include "pxr/base/vt/value.h"
20PXR_NAMESPACE_OPEN_SCOPE
45 HdWrapLegacyNoOpinionFallbackRepeat,
47 HdWrapUseMetadata = HdWrapNoOpinion,
48 HdWrapLegacy = HdWrapLegacyNoOpinionFallbackRepeat
68 HdMinFilterNearestMipmapNearest,
69 HdMinFilterLinearMipmapNearest,
70 HdMinFilterNearestMipmapLinear,
71 HdMinFilterLinearMipmapLinear,
101 HdBorderColorTransparentBlack,
102 HdBorderColorOpaqueBlack,
103 HdBorderColorOpaqueWhite,
115 HdMinFilter minFilter;
116 HdMagFilter magFilter;
117 HdBorderColor borderColor;
119 HdCompareFunction compareFunction;
120 uint32_t maxAnisotropy;
127 HdMinFilter minFilter, HdMagFilter magFilter,
128 HdBorderColor borderColor=HdBorderColorTransparentBlack,
129 bool enableCompare=
false,
130 HdCompareFunction compareFunction=HdCmpFuncNever,
131 uint32_t maxAnisotropy=16);
143typedef uint32_t HdDirtyBits;
146inline int HdConvertFloatToFixed(
float v,
int b)
150 std::min(std::max(v, -1.0f), 1.0f) * (
float(1 << (b-1)) - 1.0f)));
154inline float HdConvertFixedToFloat(
int v,
int b)
158 (v / (
float(1 << (b-1)) - 1.0f))));
172 template <
typename Vec3Type>
174 x = HdConvertFloatToFixed(value[0], 10);
175 y = HdConvertFloatToFixed(value[1], 10);
176 z = HdConvertFloatToFixed(value[2], 10);
189 template <
typename Vec3Type>
190 Vec3Type GetAsVec()
const {
191 return Vec3Type(HdConvertFixedToFloat(x, 10),
192 HdConvertFixedToFloat(y, 10),
193 HdConvertFixedToFloat(z, 10));
196 int GetAsInt()
const {
197 int const* asInt =
reinterpret_cast<int const*
>(
this);
202 return (other.w == w &&
208 return !(*
this == other);
335 HdTypeInt32_2_10_10_10_REV,
348 return (type < rhs.type) || (type == rhs.type && count < rhs.count);
351 return type == rhs.type && count == rhs.count;
354 return !(*
this == rhs);
359template <
class HashState>
363 h.Append(tt.type, tt.count);
369const void* HdGetValueData(
const VtValue &);
382HdType HdGetComponentType(HdType);
387size_t HdGetComponentCount(HdType t);
391size_t HdDataSizeOfType(HdType);
457 HdFormatFloat32UInt8,
464HdFormat HdGetComponentFormat(HdFormat f);
468size_t HdGetComponentCount(HdFormat f);
473size_t HdDataSizeOfFormat(HdFormat f);
478using HdDepthStencilType = std::pair<float, uint32_t>;
480PXR_NAMESPACE_CLOSE_SCOPE
Collection of standard parameters such as wrap modes to sample a texture.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
HdTupleType represents zero, one, or more values of the same HdType.
HdVec4f_2_10_10_10_REV is a compact representation of a GfVec4f.