HDK
|
#include "pxr/pxr.h"
#include "pxr/imaging/hd/api.h"
#include "pxr/imaging/hd/enums.h"
#include "pxr/imaging/hd/version.h"
#include "pxr/base/vt/value.h"
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdint>
Go to the source code of this file.
Classes | |
class | HdSamplerParameters |
struct | HdVec4f_2_10_10_10_REV |
struct | HdTupleType |
Typedefs | |
typedef uint32_t | HdDirtyBits |
using | HdDepthStencilType = std::pair< float, uint32_t > |
Functions | |
int | HdConvertFloatToFixed (float v, int b) |
float | HdConvertFixedToFloat (int v, int b) |
template<class HashState > | |
void | TfHashAppend (HashState &h, HdTupleType const &tt) |
HD_API const void * | HdGetValueData (const VtValue &) |
HD_API HdTupleType | HdGetValueTupleType (const VtValue &) |
HD_API HdType | HdGetComponentType (HdType) |
HD_API size_t | HdGetComponentCount (HdType t) |
HD_API size_t | HdDataSizeOfType (HdType) |
Return the size, in bytes, of a single value of the given type. More... | |
HD_API size_t | HdDataSizeOfTupleType (HdTupleType) |
Return the size, in bytes, of a value with HdTupleType. More... | |
HD_API HdFormat | HdGetComponentFormat (HdFormat f) |
Return the single-channel version of a given format. More... | |
HD_API size_t | HdGetComponentCount (HdFormat f) |
Return the count of components in the given format. More... | |
HD_API size_t | HdDataSizeOfFormat (HdFormat f) |
using HdDepthStencilType = std::pair<float, uint32_t> |
typedef uint32_t HdDirtyBits |
enum HdBorderColor |
enum HdFormat |
HdFormat describes the memory format of image buffers used in Hd. It's similar to HdType but with more specific associated semantics.
The list of supported formats is modelled after Vulkan and DXGI, though Hydra only supports a subset. Endian-ness is explicitly not captured; color data is assumed to always be RGBA.
For reference, see: https://www.khronos.org/registry/vulkan/specs/1.1/html/vkspec.html#VkFormat
enum HdMagFilter |
enum HdMinFilter |
Enumerates minFilter attribute type values.
Enumerator | |
---|---|
HdMinFilterNearest | |
HdMinFilterLinear | |
HdMinFilterNearestMipmapNearest | |
HdMinFilterLinearMipmapNearest | |
HdMinFilterNearestMipmapLinear | |
HdMinFilterLinearMipmapLinear |
enum HdType |
HdType describes the type of an attribute value used in Hd.
HdType values have a specific machine representation and size. See HdDataSizeOfType().
HdType specifies a scalar, vector, or matrix type. Vector and matrix types can be unpacked into the underlying "component" type; see HdGetComponentType().
HdType is intended to span the common set of attribute types used in shading languages such as GLSL. However, it currently does not include non-4x4 matrix types, nor struct types.
Fixed-size array types are represented by the related class HdTupleType. HdTupleType is used anywhere there is a possibility of an array of values.
Attribute data is often stored in linear buffers. These buffers have multiple dimensions and it is important to distinguish them:
Combining these concepts in an example, a primvar buffer might hold data for 10 vertices (the elements) with each vertex having a 2 entries (an array) of 4x4 matrices (with 16 components each). As a packed linear buffer, this would occupy 10*2*16==320 floats.
It is important to distinguish components from array entries, and arrays from elements. HdType and HdTupleType only addresses components and arrays; elements are tracked by buffers. See for example HdBufferSource::GetNumElements().
In other words, HdType and HdTupleType describe values. Buffers describe elements and all other details regarding buffer layout, such as offset/stride used to interleave attribute data.
For more background, see the OpenGL discussion on data types:
Enumerator | |
---|---|
HdTypeInvalid | |
HdTypeBool |
Corresponds to GL_BOOL. |
HdTypeUInt8 | |
HdTypeUInt16 | |
HdTypeInt8 | |
HdTypeInt16 | |
HdTypeInt32 |
Corresponds to GL_INT. |
HdTypeInt32Vec2 |
A 2-component vector with Int32-valued components. |
HdTypeInt32Vec3 |
A 3-component vector with Int32-valued components. |
HdTypeInt32Vec4 |
A 4-component vector with Int32-valued components. |
HdTypeUInt32 |
An unsigned 32-bit integer. Corresponds to GL_UNSIGNED_INT. |
HdTypeUInt32Vec2 |
A 2-component vector with UInt32-valued components. |
HdTypeUInt32Vec3 |
A 3-component vector with UInt32-valued components. |
HdTypeUInt32Vec4 |
A 4-component vector with UInt32-valued components. |
HdTypeFloat |
Corresponds to GL_FLOAT. |
HdTypeFloatVec2 |
Corresponds to GL_FLOAT_VEC2. |
HdTypeFloatVec3 |
Corresponds to GL_FLOAT_VEC3. |
HdTypeFloatVec4 |
Corresponds to GL_FLOAT_VEC4. |
HdTypeFloatMat3 |
Corresponds to GL_FLOAT_MAT3. |
HdTypeFloatMat4 |
Corresponds to GL_FLOAT_MAT4. |
HdTypeDouble |
Corresponds to GL_DOUBLE. |
HdTypeDoubleVec2 |
Corresponds to GL_DOUBLE_VEC2. |
HdTypeDoubleVec3 |
Corresponds to GL_DOUBLE_VEC3. |
HdTypeDoubleVec4 |
Corresponds to GL_DOUBLE_VEC4. |
HdTypeDoubleMat3 |
Corresponds to GL_DOUBLE_MAT3. |
HdTypeDoubleMat4 |
Corresponds to GL_DOUBLE_MAT4. |
HdTypeHalfFloat | |
HdTypeHalfFloatVec2 | |
HdTypeHalfFloatVec3 | |
HdTypeHalfFloatVec4 | |
HdTypeInt32_2_10_10_10_REV |
Packed, reverse-order encoding of a 4-component vector into Int32. Corresponds to GL_INT_2_10_10_10_REV.
|
HdTypeCount |
enum HdWrap |
Enumerates wrapping attributes type values.
Enumerator | |
---|---|
HdWrapClamp | |
HdWrapRepeat | |
HdWrapBlack | |
HdWrapMirror | |
HdWrapNoOpinion | |
HdWrapLegacyNoOpinionFallbackRepeat | |
HdWrapUseMetadata | |
HdWrapLegacy |
Return the size of a single element of the given format. For block formats, this will return 0.
HD_API size_t HdDataSizeOfTupleType | ( | HdTupleType | ) |
Return the size, in bytes, of a value with HdTupleType.
Return the size, in bytes, of a single value of the given type.
Return the count of components in the given value type. For example, HdTypeFloatVec3 has 3 components.
Return the single-channel version of a given format.
Return the component type for the given value type. For vectors and matrices, this is the scalar type of their components. For scalars, this is the type itself. As an example, the component type of HdTypeFloatMat4 is HdTypeFloat.
HD_API HdTupleType HdGetValueTupleType | ( | const VtValue & | ) |
Returns the HdTupleType that describes the given VtValue. For scalar, vector, and matrix types, the count is 1. For any VtArray type, the count is the number of array members.
void TfHashAppend | ( | HashState & | h, |
HdTupleType const & | tt | ||
) |