24#ifndef PXR_IMAGING_HD_ST_TEXTURE_OBJECT_H
25#define PXR_IMAGING_HD_ST_TEXTURE_OBJECT_H
28#include "pxr/imaging/hdSt/api.h"
30#include "pxr/imaging/hdSt/textureIdentifier.h"
31#include "pxr/imaging/hdSt/enums.h"
32#include "pxr/imaging/hd/types.h"
34#include "pxr/imaging/hgi/handle.h"
42PXR_NAMESPACE_OPEN_SCOPE
46class HdSt_TextureObjectRegistry;
51using HdStTextureObjectSharedPtr = std::shared_ptr<class HdStTextureObject>;
59 public std::enable_shared_from_this<HdStTextureObject>
98 HdSt_TextureObjectRegistry * textureObjectRegistry);
104 Hgi* _GetHgi()
const;
144 friend class HdSt_TextureObjectRegistry;
146 HdSt_TextureObjectRegistry *
const _textureObjectRegistry;
148 size_t _targetMemory;
172 return _wrapParameters;
181 HdSt_TextureObjectRegistry * textureObjectRegistry);
183 void _SetWrapParameters(
184 const
std::pair<HdWrap, HdWrap> &wrapParameters);
190 void _GenerateMipmaps();
191 void _DestroyTexture();
194 std::pair<HdWrap, HdWrap> _wrapParameters;
207 HdStAssetUvTextureObject(
209 HdSt_TextureObjectRegistry *textureObjectRegistry);
212 ~HdStAssetUvTextureObject()
override;
219 void _Load()
override;
238 HdSt_TextureObjectRegistry *textureObjectRegistry);
262 return _samplingTransform;
279 std::unique_ptr<HdStTextureCpuData> _cpuData;
286template<HdStTextureType textureType>
287struct HdSt_TypedTextureObjectHelper;
294template<HdStTextureType textureType>
296 typename HdSt_TypedTextureObjectHelper<textureType>::type;
299struct HdSt_TypedTextureObjectHelper<HdStTextureType::Uv> {
304struct HdSt_TypedTextureObjectHelper<HdStTextureType::Field> {
308PXR_NAMESPACE_CLOSE_SCOPE
Basic type: arbitrarily oriented 3D bounding box.
Stores a 4x4 matrix of double elements.
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.