Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/gfx1013_direct_graphics.inl
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,12 @@ struct GraphicsStage {
unsigned component = s.component == 1 ? 5 : s.component == 2 ? 4 : s.component == 3 ? 9 : 0;
if (!component)
refuse(pc, "unknown signature component");
return row(input, s.name, s.index, system(s.name), component, s.row, s.mask,
!input && component != 9 ? 1 : interpolation);
// A DXIL signature row has one interpolation mode, and integers are
// constant, so a float packed beside an integer output is constant too.
const bool flat = !input && std::any_of(signature.begin(), signature.end(), [&](const auto &o) {
return o.row == s.row && !o.system && o.component != 3;
});
return row(input, s.name, s.index, system(s.name), component, s.row, s.mask, flat ? 1 : interpolation);
}
refuse(pc, "missing generic graphics signature row");
}
Expand Down
17 changes: 17 additions & 0 deletions tests/native_direct_mesh_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,23 @@ def run_offen(name, words, error=None):
text = subprocess.check_output([sdk/'dxc.exe', '-dumpbin', out], text=True)
assert text.count('call float @dx.op.legacyF16ToF32') == 7, text
assert 'TEXCOORD' in text and 'COLOR' in text, text
# A DXIL row has one interpolation mode. A float packed beside an
# integer is constant; a float beside another float stays linear.
body[io + 0xc8:io + 0xce] = bytes((6, 1, 0, 0, 0, 0))
code = isa_words(*program[:11], 0xf80000cf, program[12],
0xf8000203, program[12], *program[13:])
struct.pack_into('<QQ', body, record, len(body), len(code))
for name, component, mode in (('integer-row', 1, 1), ('float-row', 3, 2)):
outputs = signature_rows([(b'SV_Position', 1, 3, 0, 15),
(b'COLOR', 0, component, 1, 1), (b'TEXCOORD', 0, 3, 1, 2)])
guest = root / f'{name}.dxbc'
guest.write_bytes(pack(body + code, ((b'OSG1', outputs),)))
out = root / f'{name}.cso'
result = subprocess.run([compiler, sdk, root/'cache', 'gfx1013-container-ms', guest, out],
capture_output=True, text=True)
assert result.returncode == 0, result.stderr
text = subprocess.check_output([sdk/'dxc.exe', '-dumpbin', out], text=True)
assert re.search(rf'!"TEXCOORD", i8 9, i8 0, ![0-9]+, i8 {mode},', text), text
# A VALU write changes only active lanes; other lanes keep their earlier value.
nested_or_widen = [
0x7d880080, 0x7da40480, 0xbe96047e, # Clear VCC, narrow to lanes 0 and 1, save EXEC.
Expand Down
Loading