7#ifndef PXR_IMAGING_HD_ST_TEXTURE_OBJECT_H
8#define PXR_IMAGING_HD_ST_TEXTURE_OBJECT_H
11#include "pxr/imaging/hdSt/api.h"
13#include "pxr/imaging/hdSt/textureIdentifier.h"
14#include "pxr/imaging/hdSt/enums.h"
15#include "pxr/imaging/hd/types.h"
17#include "pxr/imaging/hgi/handle.h"
25PXR_NAMESPACE_OPEN_SCOPE
29class HdSt_TextureObjectRegistry;
34using HdStTextureObjectSharedPtr = std::shared_ptr<class HdStTextureObject>;
42 public std::enable_shared_from_this<HdStTextureObject>
81 HdSt_TextureObjectRegistry * textureObjectRegistry);
127 friend class HdSt_TextureObjectRegistry;
129 HdSt_TextureObjectRegistry *
const _textureObjectRegistry;
131 size_t _targetMemory;
156 return _wrapParameters;
166 HdSt_TextureObjectRegistry * textureObjectRegistry);
169 void _SetWrapParameters(
170 const
std::pair<HdWrap, HdWrap> &wrapParameters);
180 void _GenerateMipmaps();
182 void _DestroyTexture();
185 std::pair<HdWrap, HdWrap> _wrapParameters;
198 HdStAssetUvTextureObject(
200 HdSt_TextureObjectRegistry *textureObjectRegistry);
203 ~HdStAssetUvTextureObject()
override;
210 void _Load()
override;
229 HdSt_TextureObjectRegistry *textureObjectRegistry);
253 return _samplingTransform;
270 std::unique_ptr<HdStTextureCpuData> _cpuData;
302 HdSt_TextureObjectRegistry * textureObjectRegistry);
312 void _GenerateMipmaps();
314 void _DestroyTexture();
321template<HdStTextureType textureType>
322struct HdSt_TypedTextureObjectHelper;
329template<HdStTextureType textureType>
331 typename HdSt_TypedTextureObjectHelper<textureType>::type;
334struct HdSt_TypedTextureObjectHelper<HdStTextureType::Uv> {
339struct HdSt_TypedTextureObjectHelper<HdStTextureType::Field> {
344struct HdSt_TypedTextureObjectHelper<HdStTextureType::Cubemap> {
348PXR_NAMESPACE_CLOSE_SCOPE
Basic type: arbitrarily oriented 3D bounding box.
Stores a 4x4 matrix of double elements.
A base class for cubemap textures.
HDST_API HdStTextureType GetTextureType() const final
Get texture type.
HgiTextureHandle const & GetTexture() const
Get the handle to the actual GPU resource.
A uvw texture with a bounding box describing how to transform it.
HDST_API void _Load() override
Load texture to CPU (thread-safe)
HDST_API bool IsValid() const override
Is texture valid? Only correct after commit phase.
HDST_API void _Commit() override
Commit texture to GPU (not thread-safe)
const GfBBox3d & GetBoundingBox() const
The box the texture fills out.
HDST_API HdStTextureType GetTextureType() const override
Get texture type.
HgiTextureHandle const & GetTexture() const
Get the handle to the actual GPU resource.
const GfMatrix4d & GetSamplingTransform() const
The sampling transform.
A central registry of all GPU resources.
Base class for additional information to identify a texture in a file that can contain several textur...
Represents CPU data that can be stored in a HdStUvTextureObject, mostly, likely during the load phase...
Class to identify a texture file or a texture within the texture file (e.g., a frame in a movie).
Base class for a texture object.
size_t GetTargetMemory() const
Get the target memory for the texture.
virtual HDST_API HdStTextureType GetTextureType() const =0
Get texture type.
HDST_API void _AdjustTotalTextureMemory(int64_t memDiff)
Add signed number to total texture memory amount maintained by registry.
HDST_API void _AddToTotalTextureMemory(const HgiTextureHandle &texture)
Compute memory of texture and add to total texture memory amount maintained by registry.
virtual HDST_API void _Load()=0
Load texture to CPU (thread-safe)
HDST_API void _SubtractFromTotalTextureMemory(const HgiTextureHandle &texture)
Compute memory of texture and subtract to total texture memory amount maintained by registry.
HDST_API void SetTargetMemory(size_t)
Set the target memory (in bytes).
virtual HDST_API bool IsValid() const =0
Is texture valid? Only correct after commit phase.
const HdStTextureIdentifier & GetTextureIdentifier() const
Get texture identifier.
virtual HDST_API void _Commit()=0
Commit texture to GPU (not thread-safe)
A template alias such that, e.g., HdStUvTextureObject can be accessed as HdStTypedTextureObject<HdStT...
A base class for uv textures.
HDST_API HdStTextureType GetTextureType() const override final
Get texture type.
const std::pair< HdWrap, HdWrap > & GetWrapParameters() const
Opinion about wrapS and wrapT parameters from the texture file.
HgiTextureHandle const & GetTexture() const
Get the handle to the actual GPU resource.
Hydra Graphics Interface.
SourceColorSpace
Specifies the source color space in which the texture is encoded, with "Auto" indicating the texture ...
Standard pointer typedefs.
Describes the properties needed to create a GPU texture.