11 #ifndef RV_VKFramebuffer_h
12 #define RV_VKFramebuffer_h
35 class rv_VKAttachment;
73 return !(*
this == other);
85 #if !defined(USE_FRAMEBUFFER_CREATE_INFO)
99 virtual bool beginRendering(
105 virtual void endRendering(
117 myWidth =
w; myHeight =
h;
122 void setSampleCount(
int samples);
141 int buffer_target = 0,
148 int buffer_target = 0);
150 void detachColorImage(
RV_Render *
r,
int buffer_target = 0);
157 {
return myColorAttachments; }
159 {
return myDepthAttachment; }
161 virtual void attachmentsChanged();
164 uint32_t myWidth = 0;
165 uint32_t myHeight = 0;
167 uint32_t mySamples = 1;
221 bool myIsDirty =
false;
236 : myInst(inst), myVkFramebuffer(vk_handle)
240 : myInst(other.myInst), myVkFramebuffer(other.myVkFramebuffer)
242 other.myInst =
nullptr;
243 other.myVkFramebuffer = 0;
255 myInst->
getDevice(), myVkFramebuffer,
nullptr);
262 VkFramebuffer myVkFramebuffer = 0;
271 : myInst(inst), myVkRenderPass(vk_handle)
275 : myInst(other.myInst), myVkRenderPass(other.myVkRenderPass)
277 other.myInst =
nullptr;
278 other.myVkRenderPass = 0;
290 myInst->
getDevice(), myVkRenderPass,
nullptr);
297 VkRenderPass myVkRenderPass = 0;
301 struct rv_AttachmentInfo
308 uint32_t array_layer;
314 class RV_API RV_VKFramebufferInfo
324 void setSize(
int w,
int h) { myWidth =
w; myHeight =
h;}
325 int getWidth() {
return myWidth; }
326 int getHeight() {
return myHeight; }
329 int getSampleCount();
335 int buffer_target = 0,
339 void detachImage(
int buffer_target);
348 int buffer_target = 0);
351 uint32_t myWidth = 0;
352 uint32_t myHeight = 0;
353 uint32_t mySamples = 1;
356 rv_AttachmentInfo myDepthAttachment;
370 int32_t offset_x, int32_t offset_y,
375 RV_Instance* inst,
const RV_VKFramebufferInfo &info);
393 int32_t offset_x, int32_t offset_y,
void setSize(int w, int h)
void setClearColor(UT_Vector4F c)
RV_VKFramebuffer(RV_VKFramebuffer &&other)
virtual ~RV_VKFramebuffer()
VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks *pAllocator)
const UT_Array< rv_VKAttachmentPtr > & colorAttachments() const
GLenum GLuint GLint GLint layer
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
rv_VKAttachmentPtr myDepthAttachment
UT_Vector4T< int32 > UT_Vector4i
GLint GLsizei GLsizei height
std::array< T, N > UT_FixedArray
VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator)
UT_Array< rv_VKAttachmentPtr > myColorAttachments
UT_Vector4i getClearInt() const
void setClearInt(UT_Vector4i i)
GLint GLint GLsizei GLint GLenum format
virtual ~RV_VKRenderPass()
virtual bool fillPipelineInfo(RV_RenderPassFormatInfo &info)=0
VkRenderPass getVkRenderPass() const
Handle to the main interface of Vulkan.
RV_VKRenderPass(RV_Instance *inst, VkRenderPass vk_handle)
const rv_VKAttachmentPtr & depthAttachment() const
GLfloat GLfloat GLfloat GLfloat h
void setClearDepth(fpreal32 d)
RV_VKFramebuffer(RV_Instance *inst, VkFramebuffer vk_handle)
UT_Vector4T< fpreal32 > UT_Vector4F
virtual void attachmentsChanged()
VkDevice getDevice()
Get the raw vulkan device assocated with this instance.
GLubyte GLubyte GLubyte GLubyte w
RV_VKFramebuffer & operator=(RV_VKFramebuffer &&rhs) noexcept=delete
virtual bool beginRendering(RV_Instance *inst, RV_VKCommandBuffer *cb, RV_ImageOp img_op=RV_IMAGE_LOAD, RV_RenderPassType type=RV_PASS_WHOLE)=0
RV_VKRenderPass(RV_VKRenderPass &&other)
UT_Vector4F getClearColor() const
fpreal32 getClearDepth() const
RV_VKRenderPass & operator=(RV_VKRenderPass &&rhs) noexcept=delete
VkFramebuffer getVkFramebuffer() const
virtual void endRendering(RV_Instance *inst, RV_VKCommandBuffer *cb)=0
RAII wrapper class for VkImageView.
UT_UniquePtr< rv_VKAttachment > rv_VKAttachmentPtr