i try short - i'm playing directx 11 2d right , creating fucntions drawing geometrical primitives rectangles, lines, text output, circles including different overloads filled color , on - have 1 constant buffer contained world , projection matrices, 1 color xmfloat4 primitive color , float variable transparency. worked pretty until created circle 2 colors - of border , of filing. first thought create second constant buffer, add there second color , remove transparency index, since dont plan filled circle. adds more constant buffers rotation , updating, mean before had 1 main constant buffer shaders, need vary them every single primitive call. additionaly read @ nvidia increasing constant buffers amount affects perfomance, knowledge not enough come descision - should have all-purpose constant buffer primitives (matrices, both colors, transparency, else added later) , update before , move, or need keep separate buffers differed data separate shaders? saw examples of shaders , example, matrices constant buffers , lights constant buffers separated, why feel bit confused. sum up: big constant buffer expected data better separated ones, being used evey swap call? thank you, tho not short :)
back in direct3d 9, there single block of shader constants. typically if updated part of block, data have resent gpu.
for direct3d 10, concept of constant buffer created address problem. advice use multiple constant buffers , organize them 'frequency of update'. see venerable presentation windows reality: getting out of direct3d 10 graphics in games. of initial performance problems direct3d 10 games had trying use 1 big constant buffer.
this advice still applies direct3d 11. windows 8 or later, driver may or may not implement optional feature "constant buffer offsetting" , "constant buffer partial updates".
Comments
Post a Comment