This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: Must bind 8x single mip RWTexture views, because HLSL doesn't have .mips member for RWTexture2D. (SRVs only have .mips member) | |
// NOTE: globallycoherent attribute is needed. Without it writes aren't guaranteed to be seen by other groups | |
globallycoherent RWTexture2D<float> MipTextures[8]; | |
RWTexture2D<uint> Counters[8]; | |
groupshared uint CounterReturnLDS; | |
[numthreads(16, 16, 1)] | |
void GenerateMipPyramid(uint3 Tid : SV_DispatchThreadID, uint3 Group : SV_GroupId, uint Gix : SV_GroupIndex) | |
{ | |
[unroll] |