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

vkd3d: aligned fields for 64-bit platform move/copy struct optimization #2072

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GermanAizek
Copy link

@GermanAizek GermanAizek commented Aug 18, 2024

@HansKristian-Work, @doitsujin , I tried to keep context structure fields and readability. PR changes is really useful, building configuration in Release, fps increase will be very inaccurate ~5%

  • vkd3d_instance_create_info (40 bytes -> 32 bytes)
  • vkd3d_instance_application_meta (40 bytes -> 32 bytes)
  • vkd3d_shader_transform_feedback_info (32 bytes -> 24 bytes)
  • vkd3d_shader_compile_arguments (80 bytes -> 72 bytes)
  • vkd3d_shader_library_subobject (64 bytes -> 56 bytes)
  • vkd3d_shader_register (88 bytes -> 80 bytes)
  • vkd3d_root_parameter1 (32 bytes -> 24 bytes)
  • vkd3d_root_parameter (32 bytes -> 24 bytes)
  • vkd3d_root_signature_desc1 (40 bytes -> 32 bytes)
  • vkd3d_root_signature_desc2 (40 bytes -> 32 bytes)
  • vkd3d_memory_transfer_info (56 bytes -> 48 bytes)
  • vkd3d_waiting_event (48 bytes -> 40 bytes)
  • pipeline (32 bytes -> 24 bytes)
  • local_static_sampler (56 bytes -> 48 bytes)
  • dxgi_vk_swap_chain_present_request (88 bytes -> 80 bytes)

- vkd3d_instance_create_info (40 bytes -> 32 bytes)
- vkd3d_instance_application_meta (40 bytes -> 32 bytes)
- vkd3d_shader_transform_feedback_info (32 bytes -> 24 bytes)
- vkd3d_shader_compile_arguments (80 bytes -> 72 bytes)
- vkd3d_shader_library_subobject (64 bytes -> 56 bytes)
- vkd3d_shader_register (88 bytes -> 80 bytes)
- vkd3d_root_parameter1 (32 bytes -> 24 bytes)
- vkd3d_root_parameter (32 bytes -> 24 bytes)
- vkd3d_root_signature_desc1 (40 bytes -> 32 bytes)
- vkd3d_root_signature_desc2 (40 bytes -> 32 bytes)
- vkd3d_memory_transfer_info (56 bytes -> 48 bytes)
- vkd3d_waiting_event (48 bytes -> 40 bytes)
- pipeline (32 bytes -> 24 bytes)
- local_static_sampler (56 bytes -> 48 bytes)
- dxgi_vk_swap_chain_present_request (88 bytes -> 80 bytes)
- D3D12_RESOURCE_DESC (56 bytes -> 48 bytes)
- D3D12_ROOT_PARAMETER (32 bytes -> 24 bytes)
- D3D12_ROOT_PARAMETER1 (32 bytes -> 24 bytes)
- D3D12_ROOT_SIGNATURE_DESC1 (40 bytes -> 32 bytes)
- D3D12_FEATURE_DATA_FEATURE_LEVELS (24 bytes -> 16 bytes)
- D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS (48 bytes -> 40 bytes)
- D3D12_VIEW_INSTANCING_DESC (24 bytes -> 16 bytes)
- D3D12_COMPUTE_PIPELINE_STATE_DESC (56 bytes -> 48 bytes)
- D3D12_GENERIC_PROGRAM_DESC (40 bytes -> 32 bytes)
- D3D12_HEAP_DESC (48 bytes -> 40 bytes)
@doitsujin
Copy link
Collaborator

Almost all of these are only used during initialization or when passing data to the shader compiler, there's really no reason why this would affect runtime performance in any way. We also cannot change D3D12 structures for obvious reasons, but the PR doesn't do that (anymore) despite those being mentioned in the description.

@GermanAizek
Copy link
Author

We also cannot change D3D12 structures for obvious reasons

I tried to change them, but I didn't commit them. I forgot to delete information about changes from commit.

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