|
|
|
|
|
|
|
|
|
|
StructuredBuffer<uint> g_TileList; |
|
|
|
// Indirect |
|
|
|
[numthreads(16, 16, 1)] |
|
|
|
[numthreads(TILE_SIZE_FPTL, TILE_SIZE_FPTL, 1)] |
|
|
|
uint tileIndex = g_TileList[g_TileListOffset + groupId]; |
|
|
|
uint2 tileCoord = uint2(tileIndex & 0xFFFF, tileIndex >> 16); |
|
|
|
uint2 pixelCoord = tileCoord * GetTileSize() + groupThreadId; |
|
|
|
uint tileIndex = g_TileList[g_TileListOffset + groupId]; |
|
|
|
uint2 tileCoord = uint2(tileIndex & ((1 << TILE_SIZE_FPTL) - 1), tileIndex >> TILE_SIZE_FPTL); |
|
|
|
uint2 pixelCoord = tileCoord * GetTileSize() + groupThreadId; |
|
|
|
uint numTilesX = (screenWidth + 15) / 16; |
|
|
|
uint numTilesX = (screenWidth + (TILE_SIZE_FPTL) - 1) / TILE_SIZE_FPTL; |
|
|
|
[numthreads(16, 16, 1)] |
|
|
|
[numthreads(TILE_SIZE_FPTL, TILE_SIZE_FPTL, 1)] |
|
|
|
uint2 tileCoord = (16 * groupId) / GetTileSize(); |
|
|
|
uint2 pixelCoord = dispatchThreadId; |
|
|
|
uint featureFlags = UINT_MAX; |
|
|
|
uint2 tileCoord = (TILE_SIZE_FPTL * groupId) / GetTileSize(); |
|
|
|
uint2 pixelCoord = dispatchThreadId; |
|
|
|
uint featureFlags = UINT_MAX; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
float3 specularLighting; |
|
|
|
LightLoop(V, posInput, preLightData, bsdfData, bakeLightingData, featureFlags, diffuseLighting, specularLighting); |
|
|
|
|
|
|
|
if (PixelHasSubsurfaceScattering(bsdfData)) |
|
|
|
if (_EnableSubsurfaceScattering != 0 && PixelHasSubsurfaceScattering(bsdfData)) |
|
|
|
{ |
|
|
|
specularLightingUAV[pixelCoord] = float4(specularLighting, 1.0); |
|
|
|
diffuseLightingUAV[pixelCoord] = TagLightingForSSS(diffuseLighting); |
|
|
|