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

Missing d3d12video.h? #24

Open
ghost opened this issue May 28, 2023 · 18 comments
Open

Missing d3d12video.h? #24

ghost opened this issue May 28, 2023 · 18 comments

Comments

@ghost
Copy link

ghost commented May 28, 2023

No description provided.

@Biswa96
Copy link
Contributor

Biswa96 commented May 28, 2023

I can try to work on that. Little questions. How do I know that feature in ffmpeg is compiled and enabled successfully? Would that feature be added in the official ffmpeg repository?

@ghost ghost closed this as not planned Won't fix, can't repro, duplicate, stale Jul 6, 2023
@Biswa96
Copy link
Contributor

Biswa96 commented Jul 6, 2023

So, what did happen? Did that feature get merged?

@oscarbg
Copy link

oscarbg commented Jul 11, 2023

May be because of new av1 encode support present in d3d12video,h but only in agility sdk..

@ghost
Copy link
Author

ghost commented Sep 4, 2023

d3d12va will be merged soon, so reopen this issue.

@Biswa96
Copy link
Contributor

Biswa96 commented Sep 22, 2023

Which ffmpeg source code repository should I test for adding d3d12video.h? The patches in intel/cartwheel-ffmpeg repository does not apply. @tong1wu

@tong1wu
Copy link

tong1wu commented Sep 22, 2023

Which ffmpeg source code repository should I test for adding d3d12video.h? The patches in intel/cartwheel-ffmpeg repository does not apply. @tong1wu

Could you please try it again? This happens once in a while but we maintain the patches appliable daily.

@Biswa96
Copy link
Contributor

Biswa96 commented Sep 22, 2023

Thanks. All patches can be applied now.

This is the first patch to add d3d12video.idl in wine https://gitlab.winehq.org/wine/wine/-/merge_requests/3927 and I shall let you inform when all things are in upstream.

@Biswa96
Copy link
Contributor

Biswa96 commented Sep 28, 2023

All the required d3d12video symbols are in wine repository. It will be imported to mingw-w64 soon™️

I change some lines in ffmpeg code to mitigate compiler errors and warnings. Here is the ffmpeg-test.diff.txt diff based on your ffmpeg repository d3d12va_encode branch. Please verify the changes first.

@tong1wu
Copy link

tong1wu commented Sep 28, 2023

All the required d3d12video symbols are in wine repository. It will be imported to mingw-w64 soon™️

I change some lines in ffmpeg code to mitigate compiler errors and warnings. Here is the ffmpeg-test.diff.txt diff based on your ffmpeg repository d3d12va_encode branch. Please verify the changes first.

Thanks. It looks good to me. I'll update in next version for upstream.

@tong1wu
Copy link

tong1wu commented Nov 7, 2023

All the required d3d12video symbols are in wine repository. It will be imported to mingw-w64 soon™️

I change some lines in ffmpeg code to mitigate compiler errors and warnings. Here is the ffmpeg-test.diff.txt diff based on your ffmpeg repository d3d12va_encode branch. Please verify the changes first.

  • ID3D12Device_GetCustomHeapProperties(ctx->hwctx->device, &heap_props, 0, heap_type);
    
  • ctx->hwctx->device->lpVtbl->GetCustomHeapProperties(ctx->hwctx->device, &heap_props, 0, heap_type);
    

May I ask why we need this change? Thx.

@Biswa96
Copy link
Contributor

Biswa96 commented Nov 7, 2023

It was an workaround. Sadly, I can not explain it properly. But I can ping someone to explain it.

tl;dr There is an ABI mismatch between MSVC and gcc when the virtual member function returns a structure. So, wine/widl workarounds it with some tricks. See the WIDL_EXPLICIT_AGGREGATE_RETURNS magic in d3d12video.h header file in mingw-w64.

@tong1wu
Copy link

tong1wu commented Nov 7, 2023

It was an workaround. Sadly, I can not explain it properly. But I can ping someone to explain it.

tl;dr There is an ABI mismatch between MSVC and gcc when the virtual member function returns a structure. So, wine/widl workarounds it with some tricks. See the WIDL_EXPLICIT_AGGREGATE_RETURNS magic in d3d12video.h header file in mingw-w64.

FFmpeg is a C-style project so I would prefer keeping the original one. Is there any way to have this workaround elsewhere?

@Biswa96
Copy link
Contributor

Biswa96 commented Nov 7, 2023

I have compiled the cartwheel-ffmpeg now and that change is not required. I forgot why I changed that code but I remember seeing the same changes in sdl2 and mesa. My apology for any confusion 🙇

@tong1wu
Copy link

tong1wu commented Nov 8, 2023

I have compiled the cartwheel-ffmpeg now and that change is not required. I forgot why I changed that code but I remember seeing the same changes in sdl2 and mesa. My apology for any confusion 🙇

No worries. Glad to hear that.

@tong1wu
Copy link

tong1wu commented Jan 3, 2024

Hi there. Thanks for the efforts. Now the d3d12va decoder can be built in MinGW. However, when I'm developing the d3d12va hevc encoder it seems the new added d3d12video.h still lacks of some structures which should have been added too for example, D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS and D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS. I believe D3D12_FEATURE_VIDEO_ENCODER_CODEC and these structures were added to DirectX header at the same time. So we better have these added in our d3d12video.h. Please refer to this intel-media-ci/ffmpeg#689 for more info. Thanks in advance.

@Biswa96
Copy link
Contributor

Biswa96 commented Jan 3, 2024

Certainly, I will make an attempt to include the necessary symbols in the header. However, I would like to inform that wine (and vkd3d possibly) is currently in a feature freeze state. It is uncertain whether the merge request(s) will require a longer duration.

@Biswa96
Copy link
Contributor

Biswa96 commented Jan 4, 2024

I have sent a merge request to add those symbols https://gitlab.winehq.org/wine/wine/-/merge_requests/4782

@Biswa96
Copy link
Contributor

Biswa96 commented Jan 19, 2024

New symbols are available in this ed05999 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

No branches or pull requests

3 participants