|
|
|
|
|
|
return 8 * (1 << k_Log2NumClusters); // total footprint for all layers of the tile (measured in light index entries)
|
|
|
|
} |
|
|
|
|
|
|
|
// TODO: Add proper stereo support
|
|
|
|
public void AllocResolutionDependentBuffers(int width, int height) |
|
|
|
public void AllocResolutionDependentBuffers(int width, int height, bool stereoEnabled) |
|
|
|
var nrStereoLayers = stereoEnabled ? 2 : 1; |
|
|
|
|
|
|
|
var nrTiles = nrTilesX * nrTilesY; |
|
|
|
var nrTiles = nrTilesX * nrTilesY * nrStereoLayers; |
|
|
|
s_TileFeatureFlags = new ComputeBuffer(nrTilesX * nrTilesY, sizeof(uint)); |
|
|
|
s_TileFeatureFlags = new ComputeBuffer(nrTiles, sizeof(uint)); |
|
|
|
var nrClusterTiles = nrClustersX * nrClustersY; |
|
|
|
var nrClusterTiles = nrClustersX * nrClustersY * nrStereoLayers; |
|
|
|
|
|
|
|
s_PerVoxelOffset = new ComputeBuffer((int)LightCategory.Count * (1 << k_Log2NumClusters) * nrClusterTiles, sizeof(uint)); |
|
|
|
s_PerVoxelLightLists = new ComputeBuffer(NumLightIndicesPerClusteredTile() * nrClusterTiles, sizeof(uint)); |
|
|
|
|
|
|
{ |
|
|
|
var nrBigTilesX = (width + 63) / 64; |
|
|
|
var nrBigTilesY = (height + 63) / 64; |
|
|
|
var nrBigTiles = nrBigTilesX * nrBigTilesY; |
|
|
|
var nrBigTiles = nrBigTilesX * nrBigTilesY * nrStereoLayers; |
|
|
|
s_BigTileLightList = new ComputeBuffer(LightDefinitions.s_MaxNrBigTileLightsPlusOne * nrBigTiles, sizeof(uint)); |
|
|
|
} |
|
|
|
} |
|
|
|