Loading...
Searching...
No Matches
texture.h
1//
2// Copyright 2019 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HGI_GL_TEXTURE_H
8#define PXR_IMAGING_HGI_GL_TEXTURE_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hgiGL/api.h"
12#include "pxr/imaging/hgi/texture.h"
13
16
17
18PXR_NAMESPACE_OPEN_SCOPE
19
21
30class HgiGLTexture final : public HgiTexture, public TfWeakBase
31{
32public:
33 HGIGL_API
34 ~HgiGLTexture() override;
35
36 HGIGL_API
37 size_t GetByteSizeOfResource() const override;
38
39 HGIGL_API
40 uint64_t GetRawResource() const override;
41
43 uint32_t GetTextureId() const {return _textureId;}
44
46 HGIGL_API
48
52 HGIGL_API
53 HgiTextureUsage SubmitLayoutChange(HgiTextureUsage newLayout) override;
54
55protected:
56 friend class HgiGL;
57
58 HGIGL_API
59 HgiGLTexture(HgiTextureDesc const & desc);
60
61 HGIGL_API
62 HgiGLTexture(HgiTextureViewDesc const & desc);
63
64private:
65 HgiGLTexture() = delete;
66 HgiGLTexture & operator=(const HgiGLTexture&) = delete;
67 HgiGLTexture(const HgiGLTexture&) = delete;
68
69 uint32_t _textureId;
70 uint64_t _bindlessHandle;
71};
72
73
74PXR_NAMESPACE_CLOSE_SCOPE
75
76#endif
OpenGL implementation of the Hydra Graphics Interface.
Definition: hgi.h:55
Represents a OpenGL GPU texture resource.
Definition: texture.h:31
uint32_t GetTextureId() const
Returns the OpenGL id / name of the texture.
Definition: texture.h:43
HGIGL_API size_t GetByteSizeOfResource() const override
Returns the byte size of the GPU texture.
HGIGL_API uint64_t GetBindlessHandle()
Returns the bindless gpu handle (caller must verify extension support)
HGIGL_API uint64_t GetRawResource() const override
This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t.
HGIGL_API HgiTextureUsage SubmitLayoutChange(HgiTextureUsage newLayout) override
This function does not do anything.
Represents a graphics platform independent GPU texture resource.
Definition: texture.h:144
Enable a concrete base class for use with TfWeakPtr.
Definition: weakBase.h:124
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition: declarePtrs.h:45
Describes the properties needed to create a GPU texture.
Definition: texture.h:91
Describes the properties needed to create a GPU texture view from an existing GPU texture object.
Definition: texture.h:229