Original Post
What're the differences between structured buffers and constant buffers? From their name alone I'd assume you want to set up your constant buffers at the start of execution to hold your constant values, but I've seen guides (even on MSDN) showing how to update them every frame, which I would hardly call constant.
Whereas I can't find all that much information on structured buffers, just the odd forum post here and there. I can't even see a single thing on the MSDN about it, but I know they can be used to pass data from the CPU to the GPU.
So let's say I have three scenarios:
1) I have a depth of field shader, but I allow the user to specify the size of the blurring kernel at run time. I then build an array of length kernelsize*2 of Vector3s for sampling offsets and weightings combined. I want to pass this to the shader, but I only want to do it when the user changes the blur kernel size, not every frame.
2) I have a view matrix and a projection matrix, I want to send the view matrix to my shaders every time the viewpoint moves, however I only want to send the projection matrix at the start of the program, as I assume it will never change.
2) I have a list of lights in the scene, every frame I calculate which lights are near the player and send their positions and colors to the GPU in order to build a light map.
Which method would be best for which scenario and are there any other ways of sending data to the GPU (I'm using SlimDX - but C++ examples should be translatable)?
I realize this is quite basic, but I just can't find any good resources on, well, shader resources.
Whereas I can't find all that much information on structured buffers, just the odd forum post here and there. I can't even see a single thing on the MSDN about it, but I know they can be used to pass data from the CPU to the GPU.
So let's say I have three scenarios:
1) I have a depth of field shader, but I allow the user to specify the size of the blurring kernel at run time. I then build an array of length kernelsize*2 of Vector3s for sampling offsets and weightings combined. I want to pass this to the shader, but I only want to do it when the user changes the blur kernel size, not every frame.
2) I have a view matrix and a projection matrix, I want to send the view matrix to my shaders every time the viewpoint moves, however I only want to send the projection matrix at the start of the program, as I assume it will never change.
2) I have a list of lights in the scene, every frame I calculate which lights are near the player and send their positions and colors to the GPU in order to build a light map.
Which method would be best for which scenario and are there any other ways of sending data to the GPU (I'm using SlimDX - but C++ examples should be translatable)?
I realize this is quite basic, but I just can't find any good resources on, well, shader resources.