HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RV_Render.h
Go to the documentation of this file.
1 
2 /*
3  * PROPRIETARY INFORMATION. This software is proprietary to
4  * Side Effects Software Inc., and is not to be reproduced,
5  * transmitted, or disclosed in any way without written permission.
6  *
7  * NAME: RV_Render.h ( RV Library, C++)
8  *
9  * COMMENTS:
10  * Class to do render work with RV library
11  * Represents the set of resources and render state
12  * for a single frame/thread
13  */
14 
15 #ifndef RV_Render_h
16 #define RV_Render_h
17 
18 #include "RV_API.h"
19 
20 #include <UT/UT_FixedArray.h>
21 #include <UT/UT_Map.h>
22 #include <UT/UT_Rect.h>
23 #include <UT/UT_Set.h>
24 #include <UT/UT_SharedPtr.h>
26 #include <UT/UT_UniquePtr.h>
27 #include <RE/RE_Types.h>
28 #include <SYS/SYS_Compiler.h>
29 
30 #include <UT/UT_Function.h>
31 
32 #include <utility>
33 
34 #include <VE/VE_VK.h>
35 #include "RV_Instance.h"
36 #include "RV_ShaderBlock.h"
37 #include "RV_Type.h"
38 #include "RV_VKCommandBuffer.h"
39 #include "RV_VKDescriptorSet.h"
40 #include "RV_VKPipeline.h"
41 
42 class GR_GeoRenderVK;
43 
44 class RV_Instance;
45 class RV_Geometry;
47 class RV_ShaderProgram;
48 class RV_ShaderCompute;
50 class RV_OcclusionQuery;
51 
52 class RV_VKBuffer;
53 class RV_VKCommandBufferAllocator;
54 class RV_VKCommandBuffer;
55 class RV_Framebuffer;
56 class RV_VKImage;
58 
59 class rv_ThreadedRenders;
60 
63 
64 typedef std::pair<VkPipelineStageFlags,VkPipelineStageFlags> RV_BarrierScope;
65 
67 
68 /// Per-thread object for rendering Vulkan objects, which maintains the state
69 /// and a cache of various Vulkan entities
71 {
72 public:
73  RV_Render(RV_Instance* inst);
74  ~RV_Render();
75 
76  RV_Render(const RV_Render&) = delete;
77  RV_Render(RV_Render&&) = delete;
78 
79  /// The instance associated with this render
80  RV_Instance* instance() { return myInst; }
81  /// The raw vulkan device
82  VkDevice device() { return myInst->getDevice(); }
83 
84  // Current Command buffer
85  // - separate Compute + Transfer + Main CB?
86  // - functions to start command buffer
87  // - functions to flush command buffer
88  // - function to get command buffer
89  /// The currently recording command buffer
90  RV_VKCommandBuffer* getCurrentCB();
91 
92  /// Start rendering a single frame, returns the current nesting level
93  /// See `RV_RenderAutoFrame` for RAII wrapper
94  int beginFrame();
95  /// End rendering a single frame, takes the nesting level returned from begin
96  /// for error checking
97  void endFrame(int frame_depth);
98  /// Returns true if currently rendering a frame
99  bool isInFrame() { return myFrameDepth > 0; }
100 
101  /// Begin rendering to the current framebuffer. 'img_op' can be LOAD (keep
102  /// contents), CLEAR (discard and set to a constant) or DONT_CARE.
103  bool beginRendering(RV_ImageOp img_op = RV_IMAGE_LOAD);
104  /// End rendering.
105  void endRendering();
106  /// Query if Vulkan is rendering. Cannot upload buffers or textures while
107  /// rendering.
108  bool isRendering();
109 
110  // --------------------------------
111  // Render State
112  // helper class to hold the required render state
113  // Includes (TODO):
114  // - current command buffer
115  // - pipeline state (all elements provided in pipeline creation
116  // - current bound pipeline
117  // - current descriptor sets
118  // - current framebuffer + render pass
119  // - current vertex state (i.e. which vert buffers bound)
120  // - current clear color / clear depth
121 
122  /// Reset the cached render state in this object to Vulkan defaults.
123  void resetRenderState();
124 
125  /// Copy render state from another RV_Render
126  void copyRenderState(RV_Render* other);
127 
128  /// Return the current pipeline State
129  RV_VKPipelineStateInfo* getPipelineState() { return &pipeState(); }
130 
131  // shader state
132 
133  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134  // Pipeline State
135 
136  // state management
137 
138  /// Reset the pipeline state to Vulkan defaults.
139  void resetPipeState();
140  /// Send the current pipeline state to the GPU.
141  void commitPipeState();
142  /// Save the existing state so that the state can be modified, then restored
143  /// to its previous state with popPipeState()
144  void pushPipeState();
145  /// Restore the pipeline state from a previous pushPipeState().
146  void popPipeState();
147 
148  // Poly Raster + Sample State
149  /// Set the sample mask for multisample rendering
150  void setSampleMask(uint32 mask);
151  /// Set the color channel mask
152  void setColorMask(bool red, bool green, bool blue, bool alpha);
153  /// Set the primitive culling mode, for backface or frontface culling
154  void setCullMode(bool enable, bool back_face = true, bool is_ccw = true);
155  /// Set the width of line primitives (may not be supported on all platforms)
156  void setLineWidth(float width);
157  /// Set the polygon draw mode - FILL (normal), LINES (outline),
158  /// POINTS (vertices).
159  void setPolygonMode(RV_PolygonMode mode);
160 
161  // Depth State
162 
163  /// Set the depth state for zbuffer operations.
164  void setDepthState(
165  bool enable,
167  bool writing = true,
168  float near = 0.0,
169  float far = 1.0,
170  bool clamp = false);
171  /// Set the polygon depth bias to reduce z-fighting for overlapping objects
172  void setDepthBias(bool enable, float zconst, float zslope, float clamp = 0.f);
173  // If true, depth is reversed (near at 1.0, far at 0.0). Any calls to set
174  // depth state will reverse the z function.
175 
176  /// Convenience method to map near to 1.0 and far to 0.0 so that the depth
177  /// state will be converted to the correct comparisons (LESS -> GREATER)
178  void setReverseDepth(bool reverse);
179  /// Query if reverse depth mapping is enabled.
180  bool isReverseDepth() const { return myIsReverseDepth; }
181 
182  // Stencil State
183 
184  /// Enable stencil buffer rendering. Framebuffer must have a stencil buffer.
185  void setStencilEnable(bool enable);
186  /// Define the stencil test
187  void setStencilTest(
189  uint8 ref,
190  uint8 compare_mask,
191  bool set_back = true);
192  /// Define the stencil operation based on the stencil test result. If
193  /// 'set_back' is true, also set the same values for backfacing polygons.
194  void setStencilOp(
195  RE_SOperation stencil_fail,
196  RE_SOperation depth_fail,
197  RE_SOperation pass,
198  uint8 write_mask,
199  bool set_back = true);
200  /// Define the stencil test for backfacing polygons
201  void setStencilBackTest(
203  uint8 ref,
204  uint8 compare_mask);
205  /// Define the stencil operation for backfacing polygons
206  void setStencilBackOp(
207  RE_SOperation stencil_fail,
208  RE_SOperation depth_fail,
209  RE_SOperation pass,
210  uint8 write_mask);
211 
212  // TODO: logic state set
213 
214  /// Define the viewport for rendering
215  void setViewport2DI(bool enable, const UT_DimRect &rect);
216 
217  /// Define the scissor (clip) area
218  void setScissor2DI(bool enable, const UT_DimRect &rect);
219 
220  /// Enable logic operations instead of color, plus the operation (AND,OR,etc)
221  void setLogicOp(bool enable, RV_LogicOp = RV_LOGIC_NO_OP);
222 
223  // Blend State
224  /// Enable framebuffer blending
225  void setBlendEnable(bool blend);
226 
227  // functions to set color/alpha separately
228 
229  /// Set the blending weights for color and alpha
230  void setBlendFunction(RE_BlendSourceFactor source_factor,
231  RE_BlendDestFactor dest_factor);
232  /// Set the blending weights for color only
233  void setColorBlendFunction(RE_BlendSourceFactor source_factor,
234  RE_BlendDestFactor dest_factor);
235  /// Set the blending weights for alpha only
236  void setAlphaBlendFunction(RE_BlendSourceFactor source_factor,
237  RE_BlendDestFactor dest_factor);
238  /// Set the blending operator (add, subtract, multiply, etc)
239  void setBlendEquation(RE_BlendEquation eq);
240 
241 
242  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
243  // Command Buffer Binding State
244 
246  {
247  DrawTask() = default;
248  virtual ~DrawTask() {};
249 
250  virtual bool runDraw(RV_Render* r) = 0;
251  };
252 
253  struct DrawState
254  {
255  // Bound sets
257 
258  // Bound pipeline
261 
262  // TODO: convert to use UT_Function object
264  };
265 
267  {
269  int connect,
270  const RV_OverrideList* override_list,
271  int inst = -1)
272  : myGeo(geo)
273  , myConnectGroup(connect)
274  , myConnectRange(1)
275  , myInstanceGroup(inst)
276  , myOverrides(override_list ? *override_list : RV_OverrideList())
277  {
278  }
279 
281  int connect,
282  int connect_num,
283  const RV_OverrideList* override_list,
284  int inst = -1)
285  : myGeo(geo)
286  , myConnectGroup(connect)
287  , myConnectRange(connect_num)
288  , myInstanceGroup(inst)
289  , myOverrides(override_list ? *override_list : RV_OverrideList())
290  {
291  }
292 
293  ~DefaultDrawTask() override {}
294 
295  bool runDraw(RV_Render* r) override;
296 
297  // Bound Vertex state + Input State
298  // plus draw params needed for geo to get vert + idx buffers
304  };
305 // WIP: allow recording bind state for deferring draws
306 #define WIP_VULKAN_DEFER_DRAW
307 #ifdef WIP_VULKAN_DEFER_DRAW
309  bool myIsDeferring = false;
310 
311  void clearDraws();
312  void queueDraw(
313  RV_Geometry* geo,
314  int connect,
315  int connect_num,
316  const RV_OverrideList* override_list,
317  int inst = -1);
319  void runDraws();
320 #endif
321 
322  // call vkCmdBind functions for all bound state
323  void refreshBindings();
324 
325  // should be called before a draw
326  bool prepareForDraw();
327 
329  {
330 #ifdef WIP_VULKAN_DEFER_DRAW
331  UT_ASSERT_MSG(!myIsDeferring, "RV_Render::getPushConstants "
332  "Called while in deferred mode, bound values will likely "
333  "be lost");
334 #endif
335  return myPushConstants;
336  }
337 
338  /// Return the bound variable set at index 'set_num'
339  RV_ShaderVariableSet* getSet(int set_num);
340  /// Remove a bound variable set by index
341  void unbindSet(int set_num);
342  /// Remove a bound variable set by object
343  void unbindSet(const RV_ShaderVariableSet* set);
344  /// Bind a variable set to the specific shader program
345  bool bindSet(RV_ShaderVariableSet* set,
346  const RV_ShaderProgramBase* shr);
347  /// Bind a variable set to the current shader program
349  /// Store the current shader
350  void pushShader();
351  /// Store the current shader and set the new shader to 'sh'
353  /// Restore the previous shader saved by pushShader()
354  void popShader();
355  /// Set the current shader to 'sh'
357  /// Get the current shader.
359  /// Get the current graphics shader. If the current shader is compute, return
360  /// null.
362  /// Get the current compute shader. If the current shader is graphics, return
363  /// null.
365 
366  /// Save the current render framebuffer
367  void pushDrawFramebuffer();
368  /// Save the current render framebuffer and make a new framebuffer active
370  /// Restore the previously pushed framebuffer from pushDrawFramebuffer().
371  void popDrawFramebuffer();
372  /// Make a new framebuffer active
374  /// Get the current framebuffer (may be null)
376 
377  /// Return the currently active occlusion query
378  const RV_OcclusionQuery* getQuery() const { return myCurOccludeQuery; }
379  /// Make occlusion query 'q' the active query (only 1 can be active at once)
381  { myCurOccludeQuery = q; }
382 
383  /// get the number of parallel command buffers within our pool
384  int getNumCommandBuffers() const;
385 
386  // TODO:
387  // void bindVertexState();
388 
389  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
390  // Actions
391 
392  /// End the current command buffer and start a new one. Wait until it is
393  /// executed if 'wait_for_finish' is true.
394  void flush(bool wait_for_finish);
395 
396  /// Run the current compute shader with explicit workgroup sizes. Returns
397  /// false if there is no compute shader bound.
398  bool runCompute(int wg_x, int wg_y, int wg_z);
399  /// Run the current compute shader with workgroup sizes stored in the given
400  /// buffer. Returns false if there is no compute shader bound.
402 
403  /// Draw the geometry 'geo' with the given connectivity group
404  void draw(
405  RV_Geometry* geo,
406  int connect_index,
407  const RV_OverrideList* override_list = nullptr);
408  /// Draw the geometry 'geo' with instancing with the given connectivity group
409  /// abd given instance group
410  void drawInstanced(
411  RV_Geometry* geo,
412  int connect_index,
413  int instance_group,
414  const RV_OverrideList* override_list = nullptr);
415 
416  /// Draw a range of connectivity groups
417  void drawRange(
418  RV_Geometry* geo,
419  int connect_index,
420  int connect_num,
421  const RV_OverrideList* override_list = nullptr);
422 
423  /// Draw using instancing a range of connectivity groups
424  void drawInstancedRange(
425  RV_Geometry* geo,
426  int connect_index,
427  int connect_num,
428  int inst_group,
429  const RV_OverrideList* override_list= nullptr);
430 
431  /// Render a deferred draw task
432  void draw(UT_UniquePtr<DrawTask> task);
433 
434  /// Render deferred draw using lambda
435  void draw(const UT_Function<bool(RV_Render*)> &task);
436 
437  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
438  // Thread-local Renders
439 
440  /// Get desired number of threads to use for parallel rendering
441  int getNumRenderThreads() const;
442  /// Call before using `getThreadedRender` and rendering from a new thread
443  void enableThreadedRender();
444  /// Associate a unique RV_Render with the current thread and return it
446  /// Finish rendering with multiple threads, and disassociates all per-thread
447  /// RV_Renders from the thread they were used on
448  void endThreadedRender();
449 
450 
451  void dumpBoundState();
452 
453  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
454  // Sync
455 #define WIP_VULKAN_DEFER_BARRIERS
456 #ifdef WIP_VULKAN_DEFER_BARRIERS
457 
458  /// Add a barrier for buffer synchronization
459  void addBufferBarrier(
460  RV_BarrierScope scope,
461  const VkBufferMemoryBarrier& barrier,
462  RV_VKBuffer* buf);
463  /// Add a barrier for image synchronization
464  void addImageBarrier(
465  RV_BarrierScope scope,
466  const VkImageMemoryBarrier& barrier,
467  RV_VKImage* img);
468 
469  /// Remove all currently added barriers
470  void clearBarriers();
471  /// Execute all commands with barriers
472  void executeAllBarriers();
473  /// Execute all commands on some queues (graphics, compute, transfer).
475 
476  // called when setting up render for a frame
477  void initBarriers();
478 
480  {
482  VkMemoryBarrier myGenBarrier =
483  {
485  nullptr,
488  };
489  };
490 
491  // List of barriers waiting to be added to the commandbuffer
492  // -- any barrier MUST be added before a command in its DST stage is run
493  // inserted by DST RV_STAGE_GROUP
495 
496  // List of barriers that have been added, and were added later than ALL
497  // cmds included from their src stage -- inserted by SRC RV_STAGE_GROUP
499 
500  // List of IDs for each batch of barriers that was submitted
501  UT_FixedArray<exint, RV_STAGE_NUM> myBarrierGroupID = {};
502 
503  // counters for debugging
504  int myFrameExecBarrierCount = 0;
505  int myFrameMemBarrierCount = 0;
506 #endif
507 
508 private:
509  void privInitCB();
510  void privSubmitCB(bool wait_for_finish);
511 
512  // Vulkan Instance used to create this render
513  RV_Instance* myInst;
514 
516  RV_VKCommandBuffer* myCurrentCB = nullptr;
517 
518  // Pipeline state -- i.e. state that is part of dynamic state
519  // compiled into graphics pipeline
520  UT_Array<RV_VKPipelineStateInfo> myPipeStateStack;
521  RV_VKPipelineStateInfo& pipeState();
522 
523  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
524  // Binding State
525  static const int theMaxSets = 8;
527  UT_Array<bool> myDirtySetFlags;
528 
529  UT_Array<RV_ShaderProgramBase*> myShaderStack;
530  UT_Array<RV_Framebuffer*> myFramebufferStack;
531  RV_OcclusionQuery* myCurOccludeQuery = nullptr;
532 
533  RV_PushConstants myPushConstants;
534 
535  exint myFrameDepth = 0;
536  bool myIsRendering = false;
537  bool myIsReverseDepth = false;
538 
539  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
540  // Multi-Threading
541  int myRenderThreads;
542  RV_Render* myMainRender = nullptr;
543  UT_UniquePtr<rv_ThreadedRenders> myThreadedRenders;
544  friend rv_ThreadedRenders;
545 
546  bool isMainRender() const;
547 };
548 
549 /// RAII wrapper for RV_Render beginFrame/EndFrame calls
551 {
552 public:
554  {
555  myFrameDepth = myR.beginFrame();
556  }
558  {
559  myR.endFrame(myFrameDepth);
560  }
561 private:
562  RV_Render& myR;
563  int myFrameDepth;
564 };
565 
566 /// Destroy VK resource after command buffer is executed,
567 /// when it will no longer be in-use by the GPU
568 template<class T>
570 {
571  if (v)
573  RVmakeDestroyPtrTask(std::move(v)));
574 }
575 
576 #endif
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)
RAII wrapper for RV_Render beginFrame/EndFrame calls.
Definition: RV_Render.h:550
RV_VKPipelineStateInfo * getPipelineState()
Return the current pipeline State.
Definition: RV_Render.h:129
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
bool runCompute(int wg_x, int wg_y, int wg_z)
RV_PushConstants & getPushConstants()
Definition: RV_Render.h:328
VkDevice device()
The raw vulkan device.
Definition: RV_Render.h:82
void addBufferBarrier(RV_BarrierScope scope, const VkBufferMemoryBarrier &barrier, RV_VKBuffer *buf)
Add a barrier for buffer synchronization.
RV_ImageOp
Definition: RV_Type.h:406
RV_ShaderProgram * getGraphicsShader()
void pushShader()
Store the current shader.
UT_UniquePtr< DrawTask > myTask
Definition: RV_Render.h:263
GLbitfield stages
Definition: glcorearb.h:1931
GLenum clamp
Definition: glcorearb.h:1234
void executeAllBarriers()
Execute all commands with barriers.
RV_RenderAutoFrame(RV_Render &r)
Definition: RV_Render.h:553
const GLdouble * v
Definition: glcorearb.h:837
void pushDrawFramebuffer()
Save the current render framebuffer.
RV_ShaderVariableSet * getSet(int set_num)
Return the bound variable set at index 'set_num'.
void dumpBoundState()
void setQuery(RV_OcclusionQuery *q)
Make occlusion query 'q' the active query (only 1 can be active at once)
Definition: RV_Render.h:380
void draw(RV_Geometry *geo, int connect_index, const RV_OverrideList *override_list=nullptr)
Draw the geometry 'geo' with the given connectivity group.
int64 exint
Definition: SYS_Types.h:125
RV_StageGroup
Definition: RV_Type.h:445
Object that represents drawable geometry. This object holds vertex, instancing and index buffers for ...
Definition: RV_Geometry.h:165
void executeBarriers(RV_StageGroup stages)
Execute all commands on some queues (graphics, compute, transfer).
void reverse(I begin, I end)
Definition: pugixml.cpp:7190
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
Definition: RV_Render.h:62
RV_VKCommandBuffer::Callback RVmakeDestroyPtrTask(UT_UniquePtr< T > obj)
void flush(bool wait_for_finish)
VkFlags VkPipelineStageFlags
Definition: vulkan_core.h:2401
GLdouble GLdouble GLdouble q
Definition: glad.h:2445
GLdouble far
Definition: glcorearb.h:143
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)
Definition: RV_Render.h:268
int getNumCommandBuffers() const
get the number of parallel command buffers within our pool
void clearBarriers()
Remove all currently added barriers.
int getNumRenderThreads() const
Get desired number of threads to use for parallel rendering.
RV_VKCommandBuffer * getCurrentCB()
The currently recording command buffer.
void enableThreadedRender()
Call before using getThreadedRender and rendering from a new thread.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
#define UT_ASSERT_MSG(ZZ,...)
Definition: UT_Assert.h:159
unsigned char uint8
Definition: SYS_Types.h:36
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
Definition: simd.h:4784
virtual ~DrawTask()
Definition: RV_Render.h:248
bool prepareForDraw()
GLfloat f
Definition: glcorearb.h:1926
bool isInFrame()
Returns true if currently rendering a frame.
Definition: RV_Render.h:99
Compute shader object.
GLintptr offset
Definition: glcorearb.h:665
std::array< T, N > UT_FixedArray
Definition: UT_FixedArray.h:19
UT_Array< DrawState > myRecordedDraws
Definition: RV_Render.h:308
GLint ref
Definition: glcorearb.h:124
DefaultDrawTask(RV_Geometry *geo, int connect, int connect_num, const RV_OverrideList *override_list, int inst=-1)
Definition: RV_Render.h:280
void setShader(RV_ShaderProgramBase *sh)
Set the current shader to 'sh'.
UT_Array< RV_ShaderVariableSet * > mySets
Definition: RV_Render.h:256
const RV_OcclusionQuery * getQuery() const
Return the currently active occlusion query.
Definition: RV_Render.h:378
Occlusion query object.
Definition: RV_Query.h:31
RV_VKPipelineStateInfo myPipelineState
Definition: RV_Render.h:260
GLfloat green
Definition: glcorearb.h:112
RV_PolygonMode
Definition: RV_Type.h:429
GLint GLuint mask
Definition: glcorearb.h:124
#define RV_API
Definition: RV_API.h:10
RV_StageGroup RVgetStageGroup(VkPipelineStageFlags stage_bits)
RE_BlendEquation
Definition: RE_Types.h:532
#define SYS_NO_DISCARD_RESULT
Definition: SYS_Compiler.h:93
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:112
RE_ZFunction
Definition: RE_Types.h:471
std::function< T > UT_Function
Definition: UT_Function.h:37
bool isReverseDepth() const
Query if reverse depth mapping is enabled.
Definition: RV_Render.h:180
Handle to the main interface of Vulkan.
Definition: RV_Instance.h:38
bool runComputeIndirect(RV_VKBuffer *buf, exint offset=0)
GLint void * img
Definition: glcorearb.h:556
void initBarriers()
void bindDrawFramebuffer(RV_Framebuffer *fb)
Make a new framebuffer active.
RV_Render * getThreadedRender()
Associate a unique RV_Render with the current thread and return it.
void popDrawFramebuffer()
Restore the previously pushed framebuffer from pushDrawFramebuffer().
void RVdestroyVKPtr(RV_Render *r, UT_UniquePtr< T > v)
Definition: RV_Render.h:569
void addCompletionCallback(const Callback &callback)
GLenum mode
Definition: glcorearb.h:99
RV_Instance * instance()
The instance associated with this render.
Definition: RV_Render.h:80
void popShader()
Restore the previous shader saved by pushShader()
GLenum func
Definition: glcorearb.h:783
RV_Framebuffer * getDrawFramebuffer()
Get the current framebuffer (may be null)
UT_FixedArray< rv_MemoryBarriers, RV_STAGE_NUM > myWaitingBarriers
Definition: RV_Render.h:494
RV_LogicOp
Definition: RV_Type.h:436
RE_SOperation
Definition: RE_Types.h:495
UT_FixedArray< RV_BarrierScope, RV_STAGE_NUM > myActiveBarriers
Definition: RV_Render.h:498
RE_BlendSourceFactor
Definition: RE_Types.h:507
RV_ShaderProgram * myShader
Definition: RV_Render.h:259
unsigned int uint32
Definition: SYS_Types.h:40
GLint GLsizei width
Definition: glcorearb.h:103
void runDraws()
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.
GLboolean r
Definition: glcorearb.h:1222
GLfloat GLfloat blue
Definition: glcorearb.h:112
A vulkan buffer object.
Definition: RV_VKBuffer.h:81
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
Definition: RV_Render.h:303
RV_ShaderCompute * getComputeShader()
RE_SFunction
Definition: RE_Types.h:483
png_structrp int png_fixed_point red
Definition: png.h:1083
void endThreadedRender()
void refreshBindings()
void clearDraws()
bool bindSet(RV_ShaderVariableSet *set, const RV_ShaderProgramBase *shr)
Bind a variable set to the specific shader program.
RE_BlendDestFactor
Definition: RE_Types.h:520