Shader Model 4 : issues with Cascaded Shadow Maps implementation

Started by
1 comment, last by Adaline 12 years, 5 months ago
Hi,
I'm implementing CSM using GPU Gems 3 : Parallel-Split Shadow Maps (DX10 / Geometry Shader method) , and I have two serious issues :
1) I can't visualize my shadow maps with PIX (surface cannot be shown message) (R32_TYPELESS format)
2) I don't know what is the good way to upload a matrix array (light view / projection matrices). I do this :

(3 splits here , CSM_MAXSPLITS=8)

in the shader :

row_major matrix g_CSM_VP[CSM_MAXSPLITS];


(this is a global variable, it isn't in a tbuffer or in a cbuffer)

in the c++ program:

ID3D10EffectMatrixVariable* g_pCSMMatrices;
D3DXMATRIX g_CSMMatrices[CSM_MAXSPLITS];

.....
->[for each frame : ]
[computation of light view/proj matrices]
g_pCSMMatrices->SetMatrixArray((float *)g_CSMMatrices,0,csm.nbSplits);



I get the following warning when debugging :
D3D10: WARNING: ID3D10Device::DrawIndexedInstanced: The size of the Constant Buffer at slot 0 of the Geometry Shader unit is too small (192 bytes provided, 512 bytes, at least, expected). This is OK, as out-of-bounds reads are defined to return 0. It is also possible the developer knows the missing data will not be used anyway. This is only a problem if the developer actually intended to bind a sufficiently large Constant Buffer for what the shader expects. [ EXECUTION WARNING #351: DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL ]


I tried :

g_pCSMMatrices->SetMatrixArray((float *)g_CSMMatrices,0,CSM_MAXSPLITS);

.. but get exactly the same message (?)

And I get a black screen (my background)

Any help would be greatly greatly appreciated

Nico rolleyes.gif
Advertisement
The effects framework should automatically handle figuring out how big the constant buffer should be, and creating one of the appropriate size. It shouldn't matter how much data you actually set into it. This might actually be a bug in the framework, but it's hard to know for sure.
Hello smile.gif and thank you MJP

In fact I was about to delete my post because I made a mistake. I misunderstood the array packing rule and thought we cannot put variables bigger than 4 floats in an array unsure.gif
I just put my matrix array in an existing constant buffer and warnings vanished

Bye
Nico (previously Adaline)

This topic is closed to new replies.

Advertisement