HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RV_VKImage.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: RV_VKImage.h ( RV Library, C++)
7  *
8  * COMMENTS:
9  * Class for creating Vulkan Image object
10  * Includes Vulkan Handle and memory allocation bound to it
11  */
12 #ifndef RV_VKImage_h
13 #define RV_VKImage_h
14 
15 #include "RV_API.h"
16 
17 #include <SYS/SYS_Types.h>
18 #include <SYS/SYS_Math.h>
19 #include <UT/UT_Assert.h>
20 #include <UT/UT_Swap.h>
21 #include <UT/UT_UniquePtr.h>
22 #include <limits>
23 
24 #include <VE/VE_VK.h>
25 #include "RV_Instance.h"
26 #include "RV_Render.h"
27 #include "RV_Type.h"
28 #include "RV_TypePtrs.h"
29 
30 class RV_Instance;
31 class RV_Render;
32 class RV_VKCommandBuffer;
33 class RV_VKImage;
34 class RV_VKMemAllocInfo;
35 class RV_VKQueue;
36 class RV_VKMemory;
37 
38 #define RV_MAX_MIP_LEVEL (std::numeric_limits<int>::max())
39 
40 /// Class for Setting up Image Info
41 /// Should be trivially copiable,
42 /// so it can be duplicated or passed around
43 /// Once a VkImage is created, it is immutable
44 /// so changing a parameter means creating
45 /// a new image
47 {
48 public:
49  // set Vulkan Image Creation parameters
50 
51  /// Define if the image is 1D, 2D, or 3D
52  void setImageType(RV_ImageDim img_type);
53  /// The Vulkan image type
54  VkImageType getImageType() const { return myVkCreateInfo.imageType; }
55  /// The RV image type
56  RV_ImageDim getRVImageType() const { return myRVImageType; }
57 
58  // TODO: use similar abstraction to RE_Texture ..
59  // setFormatType (i.e. Depth, vs. Color vs Stencil)
60  // setFormatDataType (int vs signed int vs float vs ...)
61  // setFormatVecSize (1, 2, 3, 4)
62  /// Set the vulkan image format. RV
63  void setFormat(VkFormat format) { myVkCreateInfo.format = format; }
64  VkFormat getFormat() const { return myVkCreateInfo.format; }
65 
66  /// Returns a vulkan subresource object for the full image
67  VkImageSubresourceRange getFullSubRes() const;
68 
69  /// Defines the size of the image (width, height, depth). 1D and 2D images
70  /// ignore some of the sizes.
71  void setSize(int w, int h, int d)
72  {
73  UT_ASSERT(w >= 1);
74  UT_ASSERT(h >= 1);
75  UT_ASSERT(d >= 1);
76 
77  myVkCreateInfo.extent.width = w;
78  myVkCreateInfo.extent.height = h;
79  myVkCreateInfo.extent.depth = d;
80  }
81  int getWidth() const
82  { return myVkCreateInfo.extent.width; }
83  int getHeight() const
84  { return myVkCreateInfo.extent.height; }
85  int getDepth() const
86  { return myVkCreateInfo.extent.depth; }
87 
88  /// Define the number of samples in a multisampled 2D image.
89  void setSamples(int samples)
90  {
91  UT_ASSERT(samples >= 1);
92  mySamples = samples;
93  }
94  int getSamples() const
95  { return mySamples; }
96 
97  /// Define the number of layers in a 1D or 2D array.
98  void setLayerCount(int count )
99  {
100  UT_ASSERT(count >= 1);
101  myVkCreateInfo.arrayLayers = count;
102  }
103  int getLayerCount() const
104  { return myVkCreateInfo.arrayLayers; }
105 
106  /// Set the maximum number of mipmap levels.
108  {
109  UT_ASSERT( count >= 1);
110  myMaxLevels = SYSmax(count, 1);
111  }
112  int getMaxLevelCount() const
113  { return myMaxLevels; }
114 
115  int getLevelCount() const
116  {
117  exint max_dim = SYSmax(SYSmax(getWidth(), getHeight()), getDepth());
118  int max_level = SYSfloorLog2(max_dim) + 1;
119  return SYSmin(max_level, getMaxLevelCount());
120  }
121 
122  /// Set the texture filter for texture scales above 1.
124  { myMagFilterMode = filter; }
125  /// Set the texture filter for texture scales below 1.
127  { myMinFilterMode = filter; }
128  /// Set the mipmapping mode - DISABLED, NEAREST mipmap, or LINEAR blend
130  { myMipMode = mode; }
131 
132  /// Set the wrapping mode when uv is outside [0,1]:REPEAT,CLAMP,BORDER,MIRROR
134  { myWrapU = u; myWrapV = v; myWrapW = w; }
135 
137  { return myWrapU; }
139  { return myWrapV; }
141  { return myWrapW; }
142 
143  /// Set the texture swizzle for each component, when sampled in a shader
144  /// Cannot be combined with storage images or framebuffer attachment images
149  {
150  myTextureSwizzle[0] = r;
151  myTextureSwizzle[1] = g;
152  myTextureSwizzle[2] = b;
153  myTextureSwizzle[3] = a;
154  }
155 
157  { return myTextureSwizzle[0]; }
159  { return myTextureSwizzle[1]; }
161  { return myTextureSwizzle[2]; }
163  { return myTextureSwizzle[3]; }
164 
166  { myUsageAttachmentBit = b; }
168  { return myUsageAttachmentBit; }
169 
171  { myUsageSampledBit = b; }
172  bool getUsageSampledBit() const
173  { return myUsageSampledBit; }
174 
176  { myUsageStorageBit = b; }
177  bool getUsageStorageBit() const
178  { return myUsageStorageBit; }
179 
180  /// Use linear tiling (true) or optimal tiling. Not all types support linear.
181  void setUseLinearTiling(bool use)
182  { myUseLinearTiling = use; }
183  bool getUseLinearTiling() const
184  { return myUseLinearTiling; }
185 
187  { myMemType = type; }
189  { return myMemType; }
190 
191  void setCompareEnable(bool compare_enable)
192  { myCompareEnable = compare_enable; }
193  bool getCompareEnable() const
194  { return myCompareEnable; }
195 
196  void setCompareOp(RE_ZFunction compare_op)
197  { myCompareOp = compare_op; }
199  { return myCompareOp; }
200 
201  /// Access the vulkan creation structure for this image.
203  { return &myVkCreateInfo; }
204 
205  /// Finalize Create Info struct before being passed to
206  /// Vulkan API, and perform any final checks.
207  /// To Be called by Vulkan Image allocate function.
208  /// Returns false if any checks fail
209  virtual bool fillCreateInfo();
210 
211  // Constructors
212  RV_VKImageCreateInfo() = default;
213  virtual RV_VKImageCreateInfo* clone() const
214  {
215  return new RV_VKImageCreateInfo(*this);
216  }
217 
218  virtual ~RV_VKImageCreateInfo();
219 
220 protected:
221  RV_VKImageCreateInfo(const RV_VKImageCreateInfo&) = default;
222 
223  bool isValidForLinearTiling() const;
224 
225  /// Extend Image Create Info struct.
226  /// Used by subclasses to create different
227  /// types of images
229  {
230  UT_ASSERT(p);
231  p->pNext = (VkBaseOutStructure*)myVkCreateInfo.pNext;
232  myVkCreateInfo.pNext = p;
233  }
234 
235  /// Setup allocation info for memory
236  virtual RV_MemType getAllocType(RV_Instance* inst);
237 
238  // ~~~~ Data Members ~~~~
239  // Image format
240  uint32_t mySamples = 0;
241  int myMaxLevels = 1;
242 
243  bool myUseLinearTiling = false;
244  RV_MemType myMemType = RV_MEM_AUTO;
245  RV_ImageDim myRVImageType = RV_IMAGE_2D;
246  RV_TextureSwizzle myTextureSwizzle[4] =
247  {
251  RV_SWIZZLE_IDENTITY
252  };
253 
254  // Sampler Info
255  fpreal32 myMinLOD = 0.0;
257  bool myIsNormalized = false;
258  bool myIsTexelSampled = false;
259  bool myUsageAttachmentBit = true;
260  bool myUsageSampledBit = true;
261  bool myUsageStorageBit = false;
262  bool myCompareEnable = false;
263  RE_ZFunction myCompareOp = RE_ZALWAYS;
270  UT_Vector4F myBorderColor = {0.f, 0.f, 0.f, 0.f};
271 
272  // Vk Image Creation Info struct
273  VkImageCreateInfo myVkCreateInfo = {
275  nullptr,
276  0, /* flags */
277  VK_IMAGE_TYPE_2D, /* imageType */
278  VK_FORMAT_UNDEFINED, /* format */
279  {0, 0, 0}, /* extent */
280  1, /* mipLevels */
281  1, /* arrayLayers */
282  VK_SAMPLE_COUNT_1_BIT, /* samples */
283  VK_IMAGE_TILING_OPTIMAL,/* tiling */
284  0, /* usage */
285  VK_SHARING_MODE_EXCLUSIVE, /* sharingMode */
286  0, /* queueFamilyIndexCount */
287  nullptr, /* pQueueFamilyIndices */
288  VK_IMAGE_LAYOUT_UNDEFINED, /* initialLayout */
289  };
290 
291  friend class RV_VKImage;
292 };
293 
294 /// RAII wrapper class for VkImageView
296 {
297 public:
298  /// Access the vulkan resource for the view
299  VkImageView getVkView() { return myVkView; }
300 
301  // CAN have null state
303  : myInst(nullptr), myVkView(VK_NULL_HANDLE)
304  {}
305  RV_VKImageView(RV_Instance* inst, VkImageView vk_view)
306  : myInst(inst), myVkView(vk_view)
307  {}
308 
309  // disable copy semantics
310  RV_VKImageView(const RV_VKImageView&) = delete;
312 
313  // enable move semantics
314  RV_VKImageView(RV_VKImageView&& other) noexcept
315  : myInst(other.myInst), myVkView(other.myVkView)
316  {
317  other.myInst = nullptr;
318  other.myVkView = VK_NULL_HANDLE;
319  }
320  RV_VKImageView& operator=(RV_VKImageView&& other) noexcept = delete;
321 
322  // Destroy Resource Handle on destruction
324  {
325  if (myVkView != VK_NULL_HANDLE)
326  {
327  VkDevice vk_dev = myInst->getDevice();
328  ::vkDestroyImageView(vk_dev, myVkView, nullptr);
329  }
330  }
331 
332 private:
333  RV_Instance* myInst = nullptr;
334  VkImageView myVkView = VK_NULL_HANDLE;
335 };
336 
337 // RAII wrapper for sampler
339 {
340 public:
341  /// Access the vulkan resource for the sampler
342  VkSampler getVkSampler() { return myVkSampler; }
343 
344  // CAN have null state
346  : myInst(nullptr), myVkSampler(VK_NULL_HANDLE)
347  {}
348  RV_VKSampler(RV_Instance* inst, VkSampler vk_sampler)
349  : myInst(inst), myVkSampler(vk_sampler)
350  {}
351 
352  // disable copy semantics
353  RV_VKSampler(const RV_VKSampler&) = delete;
354  RV_VKSampler& operator=(RV_VKSampler& ) = delete;
355 
356  // enable move semantics
357  RV_VKSampler(RV_VKSampler&& other) noexcept
358  : myInst(other.myInst), myVkSampler(other.myVkSampler)
359  {
360  other.myInst = nullptr;
361  other.myVkSampler = VK_NULL_HANDLE;
362  }
363  RV_VKSampler& operator=(RV_VKSampler&& other) noexcept = delete;
364  // Destroy Resource Handle on destruction
366  {
367  if (myVkSampler != VK_NULL_HANDLE)
368  {
369  VkDevice vk_dev = myInst->getDevice();
370  ::vkDestroySampler(vk_dev, myVkSampler, nullptr);
371  }
372  }
373 
374 private:
375  RV_Instance* myInst = nullptr;
376  VkSampler myVkSampler = VK_NULL_HANDLE;
377 };
378 
379 /// Class hodling VkImage handle and bound Memory allocation
380 /// cleans up resources on destruction
382 {
383 public:
384  /// Creates new Image based on create info
385  static RV_VKImagePtr allocateImage(
386  RV_Instance* inst,
387  RV_VKImageCreateInfo* info,
388  const char* name = nullptr);
389 
390  /// Allocate a new Image Sampler using parameters from img_info,
391  /// ignoring non-sampler parameters
392  static UT_UniquePtr<RV_VKSampler> allocateSampler(
393  RV_Instance* inst,
394  const RV_VKImageCreateInfo* img_info);
395 
396  /// check whether the format info in pInfo can create
397  /// a valid Vulkan image
398  static bool queryIsUsable(
399  RV_Instance* inst,
400  RV_VKImageCreateInfo* info);
401 
402  /// The image properties
403  const RV_VKImageCreateInfo& getInfo() const { return *myCreateInfo; }
404 
405  // Getters for image members
406  VkImage getVkImage() { return myVkImg; }
407  RV_VKMemory& getMemory() { return *myMemory; }
408  RV_VKSampler* getSampler() { return mySampler.get(); }
409  VkImageLayout getLayout() const { return myLastLayout; }
410  exint getID() const { return myId; }
411 
412  RV_VKImageView& getFullView() { return *myView; }
414  { return myPrimaryView ? *myPrimaryView :*myView;}
415 
416  // Functions to create Image View for image
417  /// Create new VkImageView for whole VkImage range
418  RV_VKImageView createView();
419  /// Create new VkImageView for specific VkImage subresource range
420  RV_VKImageView createView(const VkImageSubresourceRange &subres);
421  /// Create new VkImageView for specific VkImage subresource range, with type
422  RV_VKImageView createView(const VkImageSubresourceRange &subres, VkImageViewType type);
423  /// Create new VkImageView for specific type, trying to use full subresource range
424  RV_VKImageView createView(VkImageViewType type);
425 
426  /// Record a command to transition image into new layout
427  void transitionImage(
428  RV_VKCommandBuffer* cb,
429  VkImageLayout new_layout,
430  VkImageUsageFlags new_usage, // TODO: new struct to encapsulate access, stage, usage
431  // want to be able to specify extra params
432  // (e.g. read vs write access, and specific pipeline shader stage)
433  // without cluttering the function signature
434  bool keep_data = true,
436 
437  /// Record a command to transition the image for sampling in a shader
439  {
440  transitionImage(cb, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
442  }
443 
444  /// Upload data to the image. Must be in a state for upload.
446  bool uploadData(RV_Render* r, const T &data, int level = 0, int index = 0)
447  {
448  // `T` must be a `UT_Span` or convertable into a `UT_Span`
450  return uploadData(
451  r->instance(), r->getCurrentCB(),
452  span.data(), span.size_bytes(),
453  level, index);
454  }
455 
456  bool uploadData(
457  RV_Render* r,
458  const void* data,
459  exint data_size,
460  int level = 0,
461  int index = 0);
462 
463  bool uploadData(
464  RV_Instance* inst,
465  RV_VKCommandBuffer* cb,
466  const void* data,
467  exint data_size,
468  int level = 0,
469  int index = 0);
470 
471  /// Copy image data to this image from `buffer`.
472  bool uploadData(RV_Render* r,
473  RV_VKBuffer* buf,
474  int level = 0,
475  int index = 0);
476  bool uploadData(
477  RV_Instance* inst,
478  RV_VKCommandBuffer* cb,
479  RV_VKBuffer* buf,
480  int level = 0,
481  int index = 0);
482 
483  // TODO: add options for level, layer, separate aspects, offsets
484  /// Copy image data from this image to `other`.
485  bool copyData(RV_Render* r, RV_VKImage* other);
486 
487  /// Generate higher mipmap levels from the base level
488  void generateMipmaps(RV_Render* r);
489 
490  /// Download image data into `data`.
491  bool downloadData(
492  RV_Render* r,
493  void* data,
494  exint data_size,
495  int level = 0,
496  int index = 0,
497  bool primary_aspect = true);
498 
499  virtual ~RV_VKImage();
500 
501  /// Debug print out of image properties (not image data).
502  void print() const;
503 
504 protected:
505  RV_VKImage(
506  RV_Instance* inst,
507  const RV_VKImageCreateInfo* img_info,
508  VkImage vk_img,
509  RV_VKMemoryPtr mem,
511  RV_VKImageViewPtr primary_view,
513 
514  static void deleteImage(
515  RV_Instance* inst,
516  VkImage* img,
517  VkDeviceMemory* mem);
518 
519  // basic resource handles
520  RV_Instance* myInst = nullptr;
521  VkImage myVkImg = VK_NULL_HANDLE;
522  exint myId = 0;
524 
529 
530 public: // wip
532 
533  // Vulkan Resource Usage
535  VkAccessFlags myLastAccess = 0;
536  VkImageUsageFlags myLastUsage = 0;
537  VkPipelineStageFlags myLastStage = 0;
538  uint32_t myLastQueueFam = 0;
539 
540  RV_StageGroup myWaitingBarrierStage = RV_STAGE_NONE;
541 
542  friend class RV_VKImageCreateInfo;
543 };
544 
545 #endif
void setTextureMinFilter(RV_TextureFilter filter)
Set the texture filter for texture scales below 1.
Definition: RV_VKImage.h:126
#define SYSmax(a, b)
Definition: SYS_Math.h:1570
UT_UniquePtr< RV_VKMemory > myMemory
Definition: RV_VKImage.h:527
RV_TextureSwizzle
Definition: RV_Type.h:241
void setUsageStorageBit(bool b)
Definition: RV_VKImage.h:175
VkSampler getVkSampler()
Access the vulkan resource for the sampler.
Definition: RV_VKImage.h:342
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
int getLevelCount() const
Definition: RV_VKImage.h:115
#define VK_NULL_HANDLE
Definition: vulkan_core.h:45
int getWidth() const
Definition: RV_VKImage.h:81
int getSamples() const
Definition: RV_VKImage.h:94
constexpr span< ElementType, Extent > make_span(span< ElementType, Extent > s) noexcept
Definition: UT_Span.h:559
RV_VKImageView & operator=(RV_VKImageView &)=delete
const GLdouble * v
Definition: glcorearb.h:837
const VkImageCreateInfo * getVkInfo() const
Access the vulkan creation structure for this image.
Definition: RV_VKImage.h:202
GLsizei const GLfloat * value
Definition: glcorearb.h:824
Definition: span.h:73
GLboolean GLboolean g
Definition: glcorearb.h:1222
int64 exint
Definition: SYS_Types.h:125
GLint level
Definition: glcorearb.h:108
RV_StageGroup
Definition: RV_Type.h:445
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
void setSamples(int samples)
Define the number of samples in a multisampled 2D image.
Definition: RV_VKImage.h:89
UT_UniquePtr< RV_VKMemory > RV_VKMemoryPtr
Definition: RV_TypePtrs.h:47
RV_TextureSwizzle getTextureSwizzleG() const
Definition: RV_VKImage.h:158
void addNext(VkBaseOutStructure *p)
Definition: RV_VKImage.h:228
void setTextureWrap(RV_TextureWrap u, RV_TextureWrap v, RV_TextureWrap w)
Set the wrapping mode when uv is outside [0,1]:REPEAT,CLAMP,BORDER,MIRROR.
Definition: RV_VKImage.h:133
UT_UniquePtr< RV_VKImage > RV_VKImagePtr
Definition: RV_TypePtrs.h:51
VkFlags VkPipelineStageFlags
Definition: vulkan_core.h:2401
UT_UniquePtr< RV_VKSampler > mySampler
Definition: RV_VKImage.h:528
#define VK_LOD_CLAMP_NONE
Definition: vulkan_core.h:125
RV_VKSampler(RV_VKSampler &&other) noexcept
Definition: RV_VKImage.h:357
GLuint sampler
Definition: glcorearb.h:1656
VKAPI_ATTR void VKAPI_CALL vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks *pAllocator)
void setLayerCount(int count)
Define the number of layers in a 1D or 2D array.
Definition: RV_VKImage.h:98
float fpreal32
Definition: SYS_Types.h:200
void setMaxLevelCount(int count)
Set the maximum number of mipmap levels.
Definition: RV_VKImage.h:107
RV_TextureMipMode
Definition: RV_Type.h:134
UT_UniquePtr< RV_VKImageView > myView
Definition: RV_VKImage.h:525
RV_VKCommandBuffer * getCurrentCB()
The currently recording command buffer.
VKAPI_ATTR void VKAPI_CALL vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *pAllocator)
VkFlags VkImageUsageFlags
Definition: vulkan_core.h:2311
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
void setTextureMipMode(RV_TextureMipMode mode)
Set the mipmapping mode - DISABLED, NEAREST mipmap, or LINEAR blend.
Definition: RV_VKImage.h:129
void setCompareEnable(bool compare_enable)
Definition: RV_VKImage.h:191
virtual RV_VKImageCreateInfo * clone() const
Definition: RV_VKImage.h:213
bool getCompareEnable() const
Definition: RV_VKImage.h:193
RV_VKMemory & getMemory()
Definition: RV_VKImage.h:407
RV_TextureWrap getTextureWrapU() const
Definition: RV_VKImage.h:136
UT_UniquePtr< RV_VKImageView > RV_VKImageViewPtr
Definition: RV_TypePtrs.h:52
bool getUsageAttachmentBit() const
Definition: RV_VKImage.h:167
int getLayerCount() const
Definition: RV_VKImage.h:103
RV_VKSampler(RV_Instance *inst, VkSampler vk_sampler)
Definition: RV_VKImage.h:348
UT_StringHolder myName
Definition: RV_VKImage.h:531
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
VkImageType getImageType() const
The Vulkan image type.
Definition: RV_VKImage.h:54
VkImageLayout getLayout() const
Definition: RV_VKImage.h:409
RV_TextureSwizzle getTextureSwizzleR() const
Definition: RV_VKImage.h:156
void setTextureSwizzle(RV_TextureSwizzle r, RV_TextureSwizzle g, RV_TextureSwizzle b, RV_TextureSwizzle a)
Definition: RV_VKImage.h:145
#define RV_API
Definition: RV_API.h:10
RV_TextureWrap
Definition: RV_Type.h:141
void transitionToSampling(RV_VKCommandBuffer *cb)
Record a command to transition the image for sampling in a shader.
Definition: RV_VKImage.h:438
void setMemoryType(RV_MemType type)
Definition: RV_VKImage.h:186
GLuint const GLchar * name
Definition: glcorearb.h:786
RE_ZFunction
Definition: RE_Types.h:471
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
Handle to the main interface of Vulkan.
Definition: RV_Instance.h:38
GLint void * img
Definition: glcorearb.h:556
RV_TextureFilter
Definition: RV_Type.h:127
bool uploadData(RV_Render *r, const T &data, int level=0, int index=0)
Upload data to the image. Must be in a state for upload.
Definition: RV_VKImage.h:446
VkImageType
Definition: vulkan_core.h:1699
GLsizei samples
Definition: glcorearb.h:1298
GLenum mode
Definition: glcorearb.h:99
RV_Instance * instance()
The instance associated with this render.
Definition: RV_Render.h:80
int getMaxLevelCount() const
Definition: RV_VKImage.h:112
RV_ImageDim getRVImageType() const
The RV image type.
Definition: RV_VKImage.h:56
RV_VKSampler * getSampler()
Definition: RV_VKImage.h:408
int getHeight() const
Definition: RV_VKImage.h:83
RV_VKImageView(RV_VKImageView &&other) noexcept
Definition: RV_VKImage.h:314
RV_VKImageView & getFullView()
Definition: RV_VKImage.h:412
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
RV_MemType getMemoryType() const
Definition: RV_VKImage.h:188
VkFlags VkAccessFlags
Definition: vulkan_core.h:2155
int getDepth() const
Definition: RV_VKImage.h:85
RV_TextureWrap getTextureWrapW() const
Definition: RV_VKImage.h:140
UT_UniquePtr< const RV_VKImageCreateInfo > myCreateInfo
Definition: RV_VKImage.h:523
VkImageLayout
Definition: vulkan_core.h:1250
RV_TextureSwizzle getTextureSwizzleB() const
Definition: RV_VKImage.h:160
void setSize(int w, int h, int d)
Definition: RV_VKImage.h:71
void setCompareOp(RE_ZFunction compare_op)
Definition: RV_VKImage.h:196
GLuint index
Definition: glcorearb.h:786
const RV_VKImageCreateInfo & getInfo() const
The image properties.
Definition: RV_VKImage.h:403
constexpr size_type size_bytes() const noexcept
Definition: span.h:186
VkImageView getVkView()
Access the vulkan resource for the view.
Definition: RV_VKImage.h:299
VkFormat getFormat() const
Definition: RV_VKImage.h:64
RE_ZFunction getCompareOp() const
Definition: RV_VKImage.h:198
VkFormat
Definition: vulkan_core.h:1386
void setUsageSampledBit(bool b)
Definition: RV_VKImage.h:170
RV_TextureWrap getTextureWrapV() const
Definition: RV_VKImage.h:138
bool getUsageStorageBit() const
Definition: RV_VKImage.h:177
Definition: core.h:982
void setUseLinearTiling(bool use)
Use linear tiling (true) or optimal tiling. Not all types support linear.
Definition: RV_VKImage.h:181
VkDevice getDevice()
Get the raw vulkan device assocated with this instance.
RV_MemType
Definition: RV_Type.h:102
VkImageViewType
Definition: vulkan_core.h:1757
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
void setFormat(VkFormat format)
Set the vulkan image format. RV.
Definition: RV_VKImage.h:63
VkImage getVkImage()
Definition: RV_VKImage.h:406
GLboolean r
Definition: glcorearb.h:1222
RV_TextureSwizzle getTextureSwizzleA() const
Definition: RV_VKImage.h:162
A vulkan buffer object.
Definition: RV_VKBuffer.h:81
RV_VKSampler & operator=(RV_VKSampler &)=delete
RV_ImageDim
Definition: RV_Type.h:111
#define SYSmin(a, b)
Definition: SYS_Math.h:1571
type
Definition: core.h:1059
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
Definition: core.h:2976
bool getUsageSampledBit() const
Definition: RV_VKImage.h:172
constexpr pointer data() const noexcept
Definition: span.h:189
void setTextureMagFilter(RV_TextureFilter filter)
Set the texture filter for texture scales above 1.
Definition: RV_VKImage.h:123
UT_UniquePtr< RV_VKImageView > myPrimaryView
Definition: RV_VKImage.h:526
GLint GLsizei count
Definition: glcorearb.h:405
Definition: format.h:895
void setUsageAttachmentBit(bool b)
Definition: RV_VKImage.h:165
bool getUseLinearTiling() const
Definition: RV_VKImage.h:183
RV_VKImageView(RV_Instance *inst, VkImageView vk_view)
Definition: RV_VKImage.h:305
struct VkBaseOutStructure * pNext
Definition: vulkan_core.h:2817
RV_VKImageView & getPrimaryView()
Definition: RV_VKImage.h:413
RAII wrapper class for VkImageView.
Definition: RV_VKImage.h:295
UT_UniquePtr< RV_VKSampler > RV_VKSamplerPtr
Definition: RV_TypePtrs.h:53
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297
exint getID() const
Definition: RV_VKImage.h:410