"""A pixel shader's colour exports are packed: exp mrtK writes the K-th declared SV_Target, not render target K. A pixel shader that declares SV_Target0 and SV_Target2 exports mrt0 and mrt1 (SHADER-210: all 221 such pixel shaders of the 1.0.2.1 corpus, docs/design.md "Pixel colour exports"). The translator used to decorate mrt1 with Location 1, so the second value went to render target 1. It now maps export K to the K-th SV_Target of the shader's OSG1. Hand-built OSG1 containers and listings, no game data. python -I tests/semantic/test_sparse_sv_target.py -v """ import os import re import struct import sys import unittest HERE = os.path.dirname(os.path.abspath(__file__)) if HERE not in sys.path: sys.path.insert(0, HERE) import support # noqa: E402 from support import rdna2spirv # noqa: E402 D3D_NAME_TARGET = 64 def osg1_dxbc(targets): """Synthetic DXBC container with one OSG1 chunk declaring SV_Target (float4, register n) for each n.""" payload = bytearray(struct.pack("