SlimDX

SwapChain is a special render buffer, which is used as a final rendering target to output to display. Each time a frame has been completed in Buffer1, it becomes Buffer2 to be displayed on the output. The previous Buffer2 becomes Buffer1 to create the next frame. This constant change between back and front buffer is called swapping or flipping.

SwapChain generation
You can find the SwapChain Class in DXGI. The buffer generation is simple:

To exchange data between CPU and GPU, you have to generate two buffers. One on CPU and one on GPU.

To exchange Data between CPU/GPU in SlimDX you have to:

create a structure of data that corresponds to the structure in shader

create a DirectX buffer, at least in the byte size of the structure. The byte size of the buffer must be dividable by 16.

write the structure into a DataStream

Update the DirectX buffer with the DataStream

In the example slot 3 is used for constant buffer.

CPU

'#Pixel Shader Variablen
Public Structure BufferStructurePS
Public Color As Vector4
Public GlowColor As Vector4
Public EmessivePower As Single
Public SpecularPower As Single
Public SpecularIntensity As Single
End Structure

'BoundingBox Test
'
Public Function BoundingBoxInFrustum(Bounding As BoundingBox) As Boolean
For Each v In Bounding.GetCorners
If PointInFrustum(v) Then Return True
Next
Return False
End Function
'
'BoundingSphere Test
'
Public Function BoundingSphereInFrustum(Bounding As BoundingSphere) As Boolean
Return PointInFrustum(Bounding.Center, Bounding.Radius)
End Function