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

internal/graphicsdriver: use DirectX on Windows #1007

Closed
hajimehoshi opened this issue Dec 3, 2019 · 9 comments
Closed

internal/graphicsdriver: use DirectX on Windows #1007

hajimehoshi opened this issue Dec 3, 2019 · 9 comments

Comments

@hajimehoshi
Copy link
Owner

hajimehoshi commented Dec 3, 2019

@beoran
Copy link
Contributor

beoran commented Dec 3, 2019

That's exactly what we do for Allegro as well. There's a lot of code in Allegro 5 that can be used as an example of hop to use Directx 9 (not 12, sorry) on Windows, which you could use as an inspiration.

@hajimehoshi
Copy link
Owner Author

Thanks. BTW, I'll adopt Direct X 10, which is the oldest Direct X we don't have to care about device-lost.

@beoran
Copy link
Contributor

beoran commented Dec 3, 2019

That might be a great idea, since DeviceLost extremely annoying, and Allegro5 needed a lot of handling for that as well. And I guess most people can user DirecxtX 10 now. 👍

@hajimehoshi
Copy link
Owner Author

As #993 was fixed (probably), I de-prioritize this work.

@hajimehoshi hajimehoshi modified the milestones: v1.11.0, v1.12.0 Jan 2, 2020
@hajimehoshi
Copy link
Owner Author

https://docs.microsoft.com/en-us/windows/uwp/gaming/porting-your-directx-9-game-to-windows-store DirectX 11 seems better for UWP rather than DirectX 10.

@hajimehoshi
Copy link
Owner Author

If Ebiten games are UWP, Ebiten games will work on Xbox. DirectX is necessary for this.

I tend to think I'll go with DirectX 12 rather than 11. Windows 10 should preinstall DirectX 12. I'm not sure about 11. As a fallback, OpenGL implementation will remain.

@hajimehoshi hajimehoshi added this to the v2.2.0 milestone Nov 26, 2020
@silbinarywolf
Copy link
Contributor

Came across this in my travels and thought it might be a useful resource if you decide on DirectX11 rather than DirectX12.

"re-pin: minimal d3d11 reference / tutorial implementation; a small uncluttered direct3d 11 setup and rendering primer for newcomers to the api. complete, runnable single-function app. no modern c++ / oop / obscuring cruft."
https://gist.github.com/d7samurai/261c69490cce0620d0bfc93003cd1052

From this tweet: https://twitter.com/d7samurai/status/1331659636232085505

@hajimehoshi
Copy link
Owner Author

Thanks, that's a brief tutorial, but I don't think DX12 will be drastically complex compared to DX11...

@hajimehoshi hajimehoshi removed this from the v2.2.0 milestone Apr 20, 2021
@hajimehoshi hajimehoshi added this to the v2.3.0 milestone Jan 27, 2022
@hajimehoshi
Copy link
Owner Author

I prioritized this work as requested.

@hajimehoshi hajimehoshi changed the title Use DirectX on Windows internal/graphicsdriver: use DirectX on Windows Feb 5, 2022
hajimehoshi added a commit that referenced this issue Feb 26, 2022
Instead of using a negative height in the viewport, invert the Y direction
at the vertex shader. This is a little more readable as a negative height
is hacky.

This is a preparation for DirectX 12. DirectX 12's coodination system
is very similar to Metal, but doesn't treat a negative height in its
viewport unfortunately.

Updates #1007
hajimehoshi added a commit that referenced this issue Mar 13, 2022
This is a preparation to distinguish Hadamard product and matrix
product for HLSL.

Updates #1007
hajimehoshi added a commit that referenced this issue Mar 13, 2022
This is a preparation for DirectX / HLSL.

Updates #1007
hajimehoshi added a commit that referenced this issue Mar 20, 2022
…ialRegionPixels

This is necessary to remove the graphics driver usage from
(*ebiten.Image).At. And this is necessary to determine the graphics
driver after the window becomes transparent or not.

Unfortunately, it is not obvious to make a transparent window with
DirectX. Then, the determination of a graphics driver should be delayed.

Updates #1007
hajimehoshi added a commit that referenced this issue Mar 21, 2022
With DirectX, the graphics driver cannot be determined until the
main loop starts, as a transparent window cannot be treated with
DirectX so far. On the other hand, compiling shaders requires a
graphics driver as it requires information about Y directions of
NDCs and framebuffers.

This change delays compiling shaders until the graphics commands
are actually executed in the main loop.

Updates #1007
Updates #2019
hajimehoshi added a commit that referenced this issue Mar 21, 2022
This is a preparation for the DirectX driver.

Updates #1007
hajimehoshi added a commit that referenced this issue Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants