48 class RV_VKCommandBufferAllocator;
57 typedef std::pair<VkPipelineStageFlags,VkPipelineStageFlags>
RV_BarrierScope;
75 VkDevice
device() {
return myInst->getDevice(); }
114 void resetRenderState();
127 void resetPipeState();
129 void commitPipeState();
132 void pushPipeState();
142 void setCullMode(
bool enable,
bool back_face =
true,
bool is_ccw =
true);
144 void setLineWidth(
float width);
160 void setDepthBias(
bool enable,
float zconst,
float zslope,
float clamp = 0.
f);
166 void setReverseDepth(
bool reverse);
173 void setStencilEnable(
bool enable);
179 bool set_back =
true);
187 bool set_back =
true);
189 void setStencilBackTest(
194 void setStencilBackOp(
203 void setViewport2DI(
bool enable,
const UT_DimRect &rect);
206 void setScissor2DI(
bool enable,
const UT_DimRect &rect);
213 void setBlendEnable(
bool blend);
260 , myConnectGroup(connect)
262 , myInstanceGroup(inst)
273 , myConnectGroup(connect)
274 , myConnectRange(connect_num)
275 , myInstanceGroup(inst)
293 #define WIP_VULKAN_DEFER_DRAW
294 #ifdef WIP_VULKAN_DEFER_DRAW
296 bool myIsDeferring =
false;
317 #ifdef WIP_VULKAN_DEFER_DRAW
319 "Called while in deferred mode, bound values will likely "
322 return myPushConstants;
367 { myCurOccludeQuery =
q; }
377 void flush(
bool wait_for_finish);
381 bool runCompute(
int wg_x,
int wg_y,
int wg_z);
420 #define WIP_VULKAN_DEFER_BARRIERS
421 #ifdef WIP_VULKAN_DEFER_BARRIERS
461 int myFrameExecBarrierCount = 0;
462 int myFrameMemBarrierCount = 0;
467 void privSubmitCB(
bool wait_for_finish);
482 static const int theMaxSets = 8;
492 bool myIsInFrame =
false;
493 bool myIsRendering =
false;
494 bool myIsReverseDepth =
false;
A collection of Vulkan UBO, SSBO, and Image shader bindings (descriptor set)
void drawInstanced(RV_Geometry *geo, int connect_index, int instance_group, const RV_OverrideList *override_list=nullptr)
RV_VKPipelineStateInfo * getPipelineState()
Return the current pipeline State.
GLenum GLuint GLenum GLsizei const GLchar * buf
bool runCompute(int wg_x, int wg_y, int wg_z)
RV_PushConstants & getPushConstants()
VkDevice device()
The raw vulkan device.
void addBufferBarrier(RV_BarrierScope scope, const VkBufferMemoryBarrier &barrier, RV_VKBuffer *buf)
Add a barrier for buffer synchronization.
RV_ShaderProgram * getGraphicsShader()
UT_Array< RV_VKBuffer * > myBuffers
void pushShader()
Store the current shader.
UT_UniquePtr< DrawTask > myTask
void executeAllBarriers()
Execute all commands with barriers.
void pushDrawFramebuffer()
Save the current render framebuffer.
RV_ShaderVariableSet * getSet(int set_num)
Return the bound variable set at index 'set_num'.
void setQuery(RV_OcclusionQuery *q)
Make occlusion query 'q' the active query (only 1 can be active at once)
UT_Array< RV_VKImage * > myImages
void draw(RV_Geometry *geo, int connect_index, const RV_OverrideList *override_list=nullptr)
Draw the geometry 'geo' with the given connectivity group.
Object that represents drawable geometry. This object holds vertex, instancing and index buffers for ...
void executeBarriers(RV_StageGroup stages)
Execute all commands on some queues (graphics, compute, transfer).
void reverse(I begin, I end)
RV_ShaderProgramBase * getShader()
Get the current shader.
void drawInstancedRange(RV_Geometry *geo, int connect_index, int connect_num, int inst_group, const RV_OverrideList *override_list=nullptr)
Draw using instancing a range of connectivity groups.
std::pair< VkPipelineStageFlags, VkPipelineStageFlags > RV_BarrierScope
RV_VKCommandBuffer::Callback RVmakeDestroyPtrTask(UT_UniquePtr< T > obj)
void flush(bool wait_for_finish)
VkFlags VkPipelineStageFlags
GLdouble GLdouble GLdouble q
void unbindSet(int set_num)
Remove a bound variable set by index.
DefaultDrawTask(RV_Geometry *geo, int connect, const RV_OverrideList *override_list, int inst=-1)
void clearBarriers()
Remove all currently added barriers.
RV_VKCommandBuffer * getCurrentCB()
The currently recording command buffer.
UT_Array< VkBufferMemoryBarrier > myBufBarriers
UT_FixedArray< rv_BarrierMap, RV_STAGE_NUM > myWaitingBarriers
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
#define UT_ASSERT_MSG(ZZ,...)
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
bool isInFrame()
Returns true if currently rendering a frame.
std::array< T, N > UT_FixedArray
UT_Array< DrawState > myRecordedDraws
DefaultDrawTask(RV_Geometry *geo, int connect, int connect_num, const RV_OverrideList *override_list, int inst=-1)
void setShader(RV_ShaderProgramBase *sh)
Set the current shader to 'sh'.
UT_Array< RV_ShaderVariableSet * > mySets
const RV_OcclusionQuery * getQuery() const
Return the currently active occlusion query.
RV_VKPipelineStateInfo myPipelineState
UT_Array< VkMemoryBarrier > myGenBarriers
RV_StageGroup RVgetStageGroup(VkPipelineStageFlags stage_bits)
UT_Array< VkImageMemoryBarrier > myImgBarriers
GLfloat GLfloat GLfloat alpha
bool isReverseDepth() const
Query if reverse depth mapping is enabled.
Handle to the main interface of Vulkan.
bool runComputeIndirect(RV_VKBuffer *buf, exint offset=0)
void bindDrawFramebuffer(RV_Framebuffer *fb)
Make a new framebuffer active.
void popDrawFramebuffer()
Restore the previously pushed framebuffer from pushDrawFramebuffer().
void RVdestroyVKPtr(RV_Render *r, UT_UniquePtr< T > v)
~DefaultDrawTask() override
void addCompletionCallback(const Callback &callback)
RV_Instance * instance()
The instance associated with this render.
void popShader()
Restore the previous shader saved by pushShader()
UT_Map< RV_BarrierScope, rv_MemoryBarriers > rv_BarrierMap
RV_Framebuffer * getDrawFramebuffer()
Get the current framebuffer (may be null)
UT_FixedArray< UT_Set< RV_BarrierScope >, RV_STAGE_NUM > myActiveBarriers
RV_ShaderProgram * myShader
void queueDraw(RV_Geometry *geo, int connect, int connect_num, const RV_OverrideList *override_list, int inst=-1)
void addImageBarrier(RV_BarrierScope scope, const VkImageMemoryBarrier &barrier, RV_VKImage *img)
Add a barrier for image synchronization.
void drawRange(RV_Geometry *geo, int connect_index, int connect_num, const RV_OverrideList *override_list=nullptr)
Draw a range of connectivity groups.
virtual bool runDraw(RV_Render *r)=0
RV_OverrideList myOverrides
RV_ShaderCompute * getComputeShader()
png_structrp int png_fixed_point red
bool bindSet(RV_ShaderVariableSet *set, const RV_ShaderProgramBase *shr)
Bind a variable set to the specific shader program.