Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

[D3D11] Split buffer types using different class ?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Alundra   Members   -  Reputation: 261

Like
0Likes
Like

Posted 11 March 2013 - 10:06 PM

Hi all,

ID3D11Buffer is the class who handle all buffer type.The design idea is to have a IBuffer class who has a GetType() who return an ID of the type who is unique TYPE_VERTEXBUFFER and TYPE_INDEXBUFFER and have D3D11VertexBuffer and D3D11IndexBuffer.

Is it the best way to have different class to handle VertexBuffer and IndexBuffer or an All-In-One still the best ?

 

Thanks


Edited by Alundra, 11 March 2013 - 10:06 PM.


Sponsor:

#2 Zaoshi Kaba   Members   -  Reputation: 835

Like
0Likes
Like

Posted 12 March 2013 - 12:34 AM

Bind flags can be combined, what you're going to do if your buffer will be both, index and vertex? Not sure why you'd need that but it seems to be possible.



#3 Jason Z   GDNet+   -  Reputation: 2370

Like
0Likes
Like

Posted 12 March 2013 - 05:24 AM

Bind flags can be combined, what you're going to do if your buffer will be both, index and vertex? Not sure why you'd need that but it seems to be possible.

That actually is not possible (that particular combination anyways).  But I don't think his design has a problem with this.  I personally use a root class of BufferDX11, and then subclass it for each of the types.  However, there isn't a whole lot of differentiation between the classes other than the type  identification used by the engine.  They are there for future additions, which are sure to come.

 

Keep in mind also that even if you do manage to come up with a buffer that uses multiple flags, you can always just create a new class to represent it that reflects that fact.  It will be common to have a shader resource view and an unordered access view together, so you can probably plan on that combination.


Jason Zink :: DirectX MVP
Check out our (now available) D3D11 book: Practical Rendering and Computation with Direct3D 11
Check out my Direct3D 11 engine on CodePlex: Hieroglyph 3
Check out our free online D3D10 book: Programming Vertex, Geometry, and Pixel Shaders
Lunar Rift :: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article :: Fast Silhouettes Article




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS