What are constant buffers?
Until DirectX 10, inefficient constant updates adversely affected performance. To overcome this, Constant buffers have been introduced. These buffers are logical groupings of constant variables that Direct3D 10 application feeds into shaders. They allow the API and hardware to manipulate constants in an efficient way, minimizing usage of precious CPU to GPU bandwidth.The syntax for Constant buffers looks like C-style structs. Constants are grouped together in buffers based on their frequency of usage and updating. For example, for a rotating texture mapped cube viewed from a stationary point we can put the entities that change every frame in one buffer (world matrix and mesh color vector here) and those that never change in another buffer (view matrix here). A sample code snippet would be like this
cbuffer cbNeverChanges
{
matrix ViewMatrix;
};
cbuffer cbChangesEveryFrame
{
matrix WorldMatrix;
float4 vMeshColorVector;
};
FAQ menu
Sponsored links
Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Check Out IT Certification Preparation Materials
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
SFTP components for .NET
Add complete SSH and SFTP support to your .NET framework application
Add complete SSH and SFTP support to your .NET framework application
ASP.NET 3.5 Hosting on Windows 2008!
ASP.NET 3.5/2.0 Hosting on Windows 2008 & 2003! AJAX, LINQ, & Silverlight Ready! 3 Mo. Free!!
ASP.NET 3.5/2.0 Hosting on Windows 2008 & 2003! AJAX, LINQ, & Silverlight Ready! 3 Mo. Free!!
