SkiaSharp icon indicating copy to clipboard operation
SkiaSharp copied to clipboard

Compile Skia with Direct3D on Windows platform

Open Kation opened this issue 10 months ago • 19 comments

Description of Change

Compile Skia with Direct3D on Windows platform

Bugs Fixed

https://github.com/mono/SkiaSharp/issues/2817

API Changes

None.

Behavioral Changes

None.

Required skia PR

https://github.com/mono/skia/pull/121

PR Checklist

  • [ ] Has tests (if omitted, state reason in description)
  • [ ] Rebased on top of main at time of PR
  • [ ] Merged related skia PRs
  • [ ] Changes adhere to coding standard
  • [ ] Updated documentation

Kation avatar Apr 08 '24 03:04 Kation

Usage https://github.com/Wodsoft/upf/blob/master/src/UniversalPresentationFramework.Platforms.Win32/Win32RendererD3D12Context.cs

Kation avatar Apr 08 '24 04:04 Kation

These should be exposed by SkiaSharp: https://github.com/Wodsoft/upf/blob/master/src/UniversalPresentationFramework.Platforms.Win32/Win32RendererD3D12Context.cs#L291

Gillibald avatar Apr 08 '24 07:04 Gillibald

@Gillibald How to update SkiaApi.generated.cs or it should be update manually?

Kation avatar Apr 08 '24 08:04 Kation

I think I may have broken the merge with my merge of the Metal PR. Sorry. But, this PR is shaping up very well!

mattleibow avatar Apr 08 '24 22:04 mattleibow

@Gillibald How to update SkiaApi.generated.cs or it should be update manually?

I think you found the generator in the utils directory. You should be able to just run this one on a Windows machine with VS installed: https://github.com/mono/SkiaSharp/blob/main/utils/generate.ps1

mattleibow avatar Apr 09 '24 09:04 mattleibow

@mattleibow Yeah, I found it.

Many documents are out of date or missing. I spent a lot of date to look up how to modify codes.

Pipelines failed with Unable to find package Vortice.Direct3D12 and old feature tests. How to fix it?

Kation avatar Apr 09 '24 10:04 Kation

ah, we have a mirror of all packages for reasons to prevent supply chain attacks. Let me mirror those packs.

mattleibow avatar Apr 09 '24 14:04 mattleibow

increase 1,773,537 bytes compare to 3.0.0-preview2.1

Kation avatar Apr 10 '24 02:04 Kation

@mattleibow Why android and macos test run failed?

Kation avatar Apr 12 '24 02:04 Kation

@mattleibow Why android and macos test run failed?

I think there is a problem with the magic step that is supposed to use the correct build of skia. Just commit the submodule in this PR. Then the checkout of SkiaSharp will also pull the correct skia.

mattleibow avatar Apr 15 '24 10:04 mattleibow

For the tests, I think this will work - still installing tooling as I have a new laptop: https://github.com/mono/SkiaSharp/commit/6cf79eac14f5028619a9e855e33b483651c08f3c

Hopefully it just works, I copied the context setup from the skia test files... seems simple enough, no idea.

mattleibow avatar Apr 15 '24 23:04 mattleibow

For the tests, I think this will work - still installing tooling as I have a new laptop: 6cf79ea

Hopefully it just works, I copied the context setup from the skia test files... seems simple enough, no idea.

It's fail randomly I think. Sometime android failed and sometime macos failed or android and macos both failed.

Kation avatar Apr 16 '24 01:04 Kation

ah, yeah sorry. Those are a bit flakey right now. Sometimes the Android emulator does not boot, or the macOS test runner crashes.

mattleibow avatar Apr 16 '24 14:04 mattleibow

Maybe you can click Rerun failed jobs button to try for more times.

Kation avatar Apr 16 '24 16:04 Kation

@Kation are you able to write some tests?

mattleibow avatar Apr 28 '24 09:04 mattleibow

@mattleibow Busy these days. I'm copying Vulkan test to Direct3D.

Kation avatar May 09 '24 14:05 Kation