daily pastebin goal
47%
SHARE
TWEET

renderpass.h

a guest May 6th, 2016 357 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. struct ViewportRect
  3. {
  4.     u16 x, w, y, h;
  5.     float zMin, zMax;//if both are zero, will be changed to min=0, max=1
  6. };
  7.  
  8. struct PassState
  9. {
  10.     void Release();
  11. };
  12.  
  13. struct RenderPass
  14. {
  15.     void Release();
  16.     PassIndex Index() const;
  17.     u32 NumTargets() const;
  18.     RenderPass* ReplaceTargets( Scope& a, uint numTargets, TextureId* targets, TextureId depthStencil ) const;//must match existing number of targets, and depth target nullness
  19. };
  20.  
  21. class RenderPassWriter
  22. {
  23. public:
  24.     RenderPassWriter();
  25.     ~RenderPassWriter();
  26.  
  27.     // Either pass a Scope allocator, or pass 'Persistent'.
  28.     // In the Persistent case: the resulting PassState/RenderPass must have their Release function called.
  29.     // In the Scope case: the PassState/RenderPass will be released automatically by the supplied Scope. Do not call Release on them.
  30.     void Begin( GpuDevice& gpu, Scope& a );
  31.     void Begin( GpuDevice& gpu, Persistent_tag a );
  32.  
  33.     PassState* CreatePassState( const StateGroup* defaults, const StateGroup* overrides=0 );
  34.     PassState* CreatePassState( u32 numDefaults, const StateGroup*const* defaults, u32 numOverrides=0, const StateGroup*const* overrides=0 );
  35.  
  36.     RenderPass* Create( const char* name, PassIndex, const PassState* state, u32 numTargets, TextureId* targets, TextureId depthStencil=TextureId(0), const ViewportRect* viewport=0, const RwResourceState* rw=0 );
  37.     RenderPass* Create( const char* name, PassIndex, const PassState* state, TextureId target, TextureId depthStencil=TextureId(0), const ViewportRect* viewport=0, const RwResourceState* rw=0 );
  38.  
  39.     void End();
  40. private:
  41.     GpuDevice* m_gpu;
  42.     Scope* m_alloc;
  43. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top