mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-11-13 15:27:21 +00:00
[client] network: fix ANGLE decoder synchronization
The dequant shader returned before workgroup barriers for missing blocks. Mask those blocks to zero so ANGLE's D3D compiler accepts the shader while every invocation reaches each barrier. The vcpkg ANGLE build also omitted upstream shared-context locking. Enable both locking definitions so decode dispatches cannot race the render thread through ANGLE's shared D3D11 state manager.
This commit is contained in:
@@ -87,22 +87,21 @@ static const char NETWORK_VIDEO_DEQUANT_SHADER_0[] =
|
||||
" }\n"
|
||||
"}\n"
|
||||
"void main() {\n"
|
||||
" uint localIndex = gl_LocalInvocationIndex;\n"
|
||||
" int blockIndex = blockOffset + int(gl_WorkGroupID.y) * blockStride +\n"
|
||||
" uint localIndex = gl_LocalInvocationIndex;\n"
|
||||
" int blockIndex = blockOffset + int(gl_WorkGroupID.y) * blockStride +\n"
|
||||
" int(gl_WorkGroupID.x);\n"
|
||||
" uint sourceWord = offsets[blockIndex];\n"
|
||||
" uint subblock = bitfieldExtract(localIndex,0,3);\n"
|
||||
" uint blockX = bitfieldExtract(localIndex,3,2);\n"
|
||||
" uint blockY = bitfieldExtract(localIndex,5,2);\n"
|
||||
" uint group = blockY * 4u + blockX;\n"
|
||||
" ivec2 coord = ivec2(gl_WorkGroupID.xy) * 32 +\n"
|
||||
" uint sourceWord = offsets[blockIndex];\n"
|
||||
" uint blockPresent = uint(sourceWord != 0xffffffffu);\n"
|
||||
" // Missing blocks must still reach every workgroup barrier.\n"
|
||||
" sourceWord *= blockPresent;\n"
|
||||
" uint subblock = bitfieldExtract(localIndex,0,3);\n"
|
||||
" uint blockX = bitfieldExtract(localIndex,3,2);\n"
|
||||
" uint blockY = bitfieldExtract(localIndex,5,2);\n"
|
||||
" uint group = blockY * 4u + blockX;\n"
|
||||
" ivec2 coord = ivec2(gl_WorkGroupID.xy) * 32 +\n"
|
||||
" 8 * ivec2(blockX,blockY) + unswizzle8x8(subblock << 3u);\n"
|
||||
" if (sourceWord == 0xffffffffu) {\n"
|
||||
" storeValues(coord,mat2x4(vec4(0.0),vec4(0.0)));\n"
|
||||
" return;\n"
|
||||
" }\n"
|
||||
" uint sourceByte = sourceWord * 4u;\n"
|
||||
" uint ballot = payload[sourceWord] & 65535u;\n"
|
||||
" uint ballot = (payload[sourceWord] & 65535u) * blockPresent;\n"
|
||||
" if (localIndex == 0u) {\n"
|
||||
" uint cursor = sourceByte + 8u + 3u * uint(bitCount(ballot));\n"
|
||||
" for (uint index=0u; index<16u; ++index) {\n"
|
||||
@@ -118,7 +117,7 @@ static const char NETWORK_VIDEO_DEQUANT_SHADER_0[] =
|
||||
" cursor += uint(bitCount(low) + bitCount(high)) + 8u * qbits;\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
" signOffset = cursor * 8u;\n"
|
||||
" signOffset = cursor * 8u * blockPresent;\n"
|
||||
" }\n"
|
||||
" barrier();\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user