Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better D3D12 Convert #1362

Merged

Conversation

andrew-lunarg
Copy link
Contributor

@andrew-lunarg andrew-lunarg commented Nov 18, 2023

  • Vulkan and DX12 Consumers and annotation handling piped through a common JsonWriter class.
  • DX12 Consumer using nlohmann JSON library with JsonWriter in same style as Vulkan consumer.
  • FieldToJson functions using nlohmann for DX12/DXGI enums.
  • FieldToJson functions using nlohmann for DX12/DXGI structs.
  • MetataData and Marker block Consumer template classes that can be shimmed into inheritance hierarchy of both consumers, to handle those block types uniformly with one definition of each process function but without any overhead of composition through virtual multiple inheritance or through indirection to achieve aggregation.

Fixes: #1349, ...

Extra Bonus Content

@andrew-lunarg andrew-lunarg added convert Issue with convert execution or output d3d12 Issue with D3D 12 support labels Nov 18, 2023
@andrew-lunarg andrew-lunarg self-assigned this Nov 18, 2023
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 86101.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3527 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 86121.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3528 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 86174.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3529 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3529 passed.

@andrew-lunarg andrew-lunarg force-pushed the andy-enhance-better-d3d12-convert branch from 105dce4 to d7fe08c Compare November 20, 2023 14:56
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 87216.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3532 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 87274.

@andrew-lunarg
Copy link
Contributor Author

andrew-lunarg commented Nov 20, 2023

Closing temporarily just to avoid kicking off CI builds as I refine the PR to be ready for review.

andrew-lunarg and others added 23 commits December 1, 2023 20:10
Trivia in json_blocklists.json
Various C++ and Python Comment Trivia
DX12 JSON Consumer Cleanup: Removed commented-out
self.APICALL_BLACKLIST.append()s after checking a bunch of them
for the generated code. All seemed fine.
Moved out of dx12_json_consumer_base.cpp
String code to util/strings.*
Json code to util/json_util.*
Enums printed prettily.
Fewer comments in generated file.
dx12_struct_decoders_to_json_body_generator.py
Big documentation block for the next person to work on it.
Moved function up for readability / understanding.
These keep coming even though I run v14 locally on ubuntu (WSL)
which is same as used on runner according to logs.
This time: json_writer.cpp.
Convert masks which don't have enums defining possible bit values into
binary numbers encoded in strings using the same format as C++14
binary literals.

Examples:

"DepthStencilState": {
          "DepthEnable": true,
          "DepthWriteMask": "D3D12_DEPTH_WRITE_MASK_ALL",
          "DepthFunc": "D3D12_COMPARISON_FUNC_LESS",
          "StencilEnable": false,
          "StencilReadMask": "0b11111111",
          "StencilWriteMask": "0b11111111", <--------
          "FrontFace": {
            "StencilFailOp": "D3D12_STENCIL_OP_KEEP",
            "StencilDepthFailOp": "D3D12_STENCIL_OP_KEEP",

"RenderTarget": [
            {
              "BlendEnable": false,
              "LogicOpEnable": false,
              "SrcBlend": "D3D12_BLEND_ONE",
              "DestBlend": "D3D12_BLEND_ZERO",
              "BlendOp": "D3D12_BLEND_OP_ADD",
              "SrcBlendAlpha": "D3D12_BLEND_ONE",
              "DestBlendAlpha": "D3D12_BLEND_ZERO",
              "BlendOpAlpha": "D3D12_BLEND_OP_ADD",
              "LogicOp": "D3D12_LOGIC_OP_NOOP",
              "RenderTargetWriteMask": "0b00001111" <------------
            },
Pretty output for ProcessInitDx12AccelerationStructureCommand
and InitDx12AccelerationStructureGeometryDesc.
This is to cover for when thread ID is not passed to the consumers
even if it is known for the block.
When those cases are fixed, this will not be needed.
This Python function encapsulates the logic for deciding
whether a field or parameter is a set of flags without an
enum defining the valid flag bits.
Deleted ToDo Captured Externally - A DX12 Convert one: @todo
Optimise this include list... (Obviously we should optimise
all include lists)

Removed a ToDo and added some clarification in consumer gen of pointers
to enum flagsets.
I had trimmed the list of headers and made the list manual but it
is better to generate the same list used by all the DX12 generated
modules.
@andrew-lunarg andrew-lunarg force-pushed the andy-enhance-better-d3d12-convert branch from 97dc6f8 to d0b53fd Compare December 1, 2023 20:11
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 93287.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3582 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3582 passed.

@andrew-lunarg andrew-lunarg merged commit 548080b into LunarG:dev Dec 1, 2023
6 checks passed
andrew-lunarg added a commit to andrew-lunarg/gfxreconstruct that referenced this pull request Dec 3, 2023
Provide a mechanism for registering function and method arguments
to be dumped to separate binary files with a single line in the
Python generator of the DX12 JSON Consumer.
Example usage provided for one argument:

    ID3D12Device.CreateRootSignature(...,pBlobWithRootSignature)

Follow-up to PR LunarG#1362
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
convert Issue with convert execution or output d3d12 Issue with D3D 12 support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dx12 Convert Should Display Masks Typed as Enumerations In Full
4 participants