Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct ViewportRect
- {
- u16 x, w, y, h;
- float zMin, zMax;//if both are zero, will be changed to min=0, max=1
- };
- struct PassState
- {
- void Release();
- };
- struct RenderPass
- {
- void Release();
- PassIndex Index() const;
- u32 NumTargets() const;
- RenderPass* ReplaceTargets( Scope& a, uint numTargets, TextureId* targets, TextureId depthStencil ) const;//must match existing number of targets, and depth target nullness
- };
- class RenderPassWriter
- {
- public:
- RenderPassWriter();
- ~RenderPassWriter();
- // Either pass a Scope allocator, or pass 'Persistent'.
- // In the Persistent case: the resulting PassState/RenderPass must have their Release function called.
- // In the Scope case: the PassState/RenderPass will be released automatically by the supplied Scope. Do not call Release on them.
- void Begin( GpuDevice& gpu, Scope& a );
- void Begin( GpuDevice& gpu, Persistent_tag a );
- PassState* CreatePassState( const StateGroup* defaults, const StateGroup* overrides=0 );
- PassState* CreatePassState( u32 numDefaults, const StateGroup*const* defaults, u32 numOverrides=0, const StateGroup*const* overrides=0 );
- 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 );
- RenderPass* Create( const char* name, PassIndex, const PassState* state, TextureId target, TextureId depthStencil=TextureId(0), const ViewportRect* viewport=0, const RwResourceState* rw=0 );
- void End();
- private:
- GpuDevice* m_gpu;
- Scope* m_alloc;
- };
Add Comment
Please, Sign In to add comment