|
|
|
|
|
|
|
|
|
|
|
|
|
|
uniform int g_iNrVisibLights; |
|
|
|
uniform int _PunctualLightCount; |
|
|
|
uniform uint2 g_viDimensions; |
|
|
|
uniform float4x4 g_mInvScrProjection; |
|
|
|
uniform float4x4 g_mScrProjection; |
|
|
|
|
|
|
// write lights to global buffers |
|
|
|
int localOffs=0; |
|
|
|
int offs = tileIDX.y*nrTilesX + tileIDX.x; |
|
|
|
|
|
|
|
// This should thow a warning if NR_LIGHT_MODELS change |
|
|
|
int indicesShift[NR_LIGHT_MODELS] = {0, _PunctualLightCount}; |
|
|
|
|
|
|
|
for(int m=0; m<NR_LIGHT_MODELS; m++) |
|
|
|
{ |
|
|
|
int nrLightsFinal = ldsModelListCount[ m ]; |
|
|
|
|
|
|
const int nrDWords = ((nrLightsFinalClamped+1)+1)>>1; |
|
|
|
for(int l=(int) t; l<(int) nrDWords; l += NR_THREADS) |
|
|
|
{ |
|
|
|
uint uLow = l==0 ? nrLightsFinalClamped : prunedList[2*l-1+localOffs]; |
|
|
|
uint uHigh = prunedList[2*l+0+localOffs]; |
|
|
|
uint uLow = l==0 ? nrLightsFinalClamped : prunedList[2*l-1+localOffs] - indicesShift[m]; |
|
|
|
uint uHigh = prunedList[2*l+0+localOffs] - indicesShift[m]; |
|
|
|
|
|
|
|
g_vLightList[16*offs + l] = (uLow&0xffff) | (uHigh<<16); |
|
|
|
} |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|