Skip to content

[mlir][dxsa] Add dcl_input_control_point_count and dcl_output_control_point_count instructions#122

Merged
tagolog merged 1 commit intoaccess-softek:dxsa-mlirfrom
tagolog:dxsa-mlir-dcl_input_control_point_count-and-dcl_output_control_point_count
May 9, 2026
Merged

[mlir][dxsa] Add dcl_input_control_point_count and dcl_output_control_point_count instructions#122
tagolog merged 1 commit intoaccess-softek:dxsa-mlirfrom
tagolog:dxsa-mlir-dcl_input_control_point_count-and-dcl_output_control_point_count

Conversation

@tagolog
Copy link
Copy Markdown

@tagolog tagolog commented May 1, 2026

Example:
dxsa.dcl_input_control_point_count 3
dxsa.dcl_output_control_point_count 4

@tagolog tagolog requested review from asavonic and asl May 1, 2026 04:45
Comment thread mlir/lib/Target/DXSA/BinaryParser.cpp Outdated

FailureOr<Instruction> parseDclInputControlPointCount(uint32_t opcodeToken,
Location loc) {
auto count = (opcodeToken & D3D11_SB_INPUT_CONTROL_POINT_COUNT_MASK) >>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's about something along these lines:

#define GET_INST_FIELD(token, INST, FIELD) \
  (((token) & (INST ## _ ## FIELD ## _ ## MASK)) >> (INST ## _ ## FIELD ## _ ## SHIFT))

Then you can do:

auto count = GET_INST_FIELD(opcodeTokem, D3D11_SB_INPUT_CONTROL_POINT, COUNT);

Obviously, you can extend down to something like:

#define GET_D3D11_INST_FIELD(token, INST, FIELD) GET_INST_FIELD(token, D3D11 ## _ ## INST, FIELD)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, there is already:

// DECODER MACRO: Given an input control point count declaration token,
// (OpcodeToken0), determine the control point count
#define DECODE_D3D11_SB_INPUT_CONTROL_POINT_COUNT(OpcodeToken0) ((UINT)(((OpcodeToken0)&D3D11_SB_INPUT_CONTROL_POINT_COUNT_MASK)>>D3D11_SB_INPUT_CONTROL_POINT_COUNT_SHIFT))

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Copy Markdown
Contributor

@asl asl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use macro from d3d12TokenizedProgramFormat.hpp

@tagolog tagolog force-pushed the dxsa-mlir-dcl_input_control_point_count-and-dcl_output_control_point_count branch from d624a5d to b02feac Compare May 5, 2026 05:23
…_point_count instructions

Example:
  dxsa.dcl_input_control_point_count 3
  dxsa.dcl_output_control_point_count 4

Signed-off-by: Vladimir Shiryaev <tagolog@users.noreply.github.com>
@tagolog tagolog force-pushed the dxsa-mlir-dcl_input_control_point_count-and-dcl_output_control_point_count branch from b02feac to a963016 Compare May 6, 2026 23:44
@tagolog tagolog merged commit 6cf30fc into access-softek:dxsa-mlir May 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants