|
|
|
|
|
|
|
|
|
|
// build coarse list using AABB |
|
|
|
#ifdef USE_TWO_PASS_TILED_LIGHTING |
|
|
|
int NrBigTilesX = (nrTilesX+3)>>2; |
|
|
|
const int bigTileIdx = (tileIDX.y>>2)*NrBigTilesX + (tileIDX.x>>2); // map the idx to 64x64 tiles |
|
|
|
const uint log2BigTileToTileRatio = firstbithigh(64) - firstbithigh(16); |
|
|
|
|
|
|
|
int NrBigTilesX = (nrTilesX+((1<<log2BigTileToTileRatio)-1))>>log2BigTileToTileRatio; |
|
|
|
const int bigTileIdx = (tileIDX.y>>log2BigTileToTileRatio)*NrBigTilesX + (tileIDX.x>>log2BigTileToTileRatio); // map the idx to 64x64 tiles |
|
|
|
int nrBigTileLights = g_vBigTileLightList[MAX_NR_BIGTILE_LIGHTS_PLUSONE*bigTileIdx+0]; |
|
|
|
for(int l0=(int) t; l0<(int) nrBigTileLights; l0 += NR_THREADS) |
|
|
|
{ |
|
|
|