29 September 2017, 18:42 | #21 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
|
Direct3D version isn't that important. DXGI is the important part, which apparently can be used as a sort of "new" directdraw without need for using D3D textures. This is probably my starting point, to get something visible in DXGI mode.
Direct3D migration instructions are not really relevant because shaders can't be compatible with D3D10+ anyway -> D3D11+ support can be made from scratch, there is nothing useful to migrate. (Or perhaps it is possible to use d3d9 to render to texture and then copy the texture to DXGI surface but performance probably isn't optimal..) So far most interesting features are: - variable sync (gsync/freesync) natively supported, even in windowed mode. - latency options (that apparently drivers can't decide to ignore which is possible with d3d9) - fullscreen/windowed mode switching and size changes are "built-in". probably more.. |
30 September 2017, 08:18 | #22 | ||
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Quote:
Quote:
|
||
07 October 2017, 15:36 | #23 | |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Quote:
Direct3D 11 missing GetRasterStatus, how do I detect the vertical blank period? The answer links to these pages, not sure but maybe it's of help somewhere down the line.. DwmGetCompositionTimingInfo function DWM_TIMING_INFO structure |
|
07 October 2017, 17:16 | #24 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
|
Looks nice, that structure has all the needed info. If reported refresh rate is accurate. At least it can be non-integer now so there is hope it works as expected..
|
07 October 2017, 18:40 | #25 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
|
One missing piece is simple example how to draw normal 2d texture to DXGI backbuffer using D3D11 with 1:1 mapping. Use of D3D11 seems to be better choice than directly using DXGI surface, for example it makes sure GPU acceleration is in use.
I don't want any emulator/whatever sources, there are usually far too much abstraction and extra stuff. I don't want anything extra. Just simple skeleton code that can be extended with other stuff (fullscreen mode, variable sync, latency stuff, shaders etc) |
07 October 2017, 18:58 | #26 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,340
|
I don't know enough to say whether it is helpful at all, but take a look at Direct3D Tutorial Win32 Sample.
|
07 October 2017, 19:40 | #27 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
|
Quote:
|
|
07 October 2017, 21:26 | #28 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,340
|
Some more links, hopefully some are of some use...
There are some Direct3D 11 tutorials at http://www.rastertek.com/tutdx11.html. Tutorial 11 covers 2D rendering. That uses its TextureClass::Initialize() function, which calls D3DX11CreateShaderResourceViewFromFile() to create a shader resource view and load texture from file. Rather than doing that you'll want to create a shader resource view manually. ID3D11Device::CreateShaderResourceView method D3D11_SHADER_RESOURCE_VIEW_DESC structure ID3D11Device::CreateTexture2D method How to: Create a Texture How to: Initialize a Texture Programmatically D3D11_USAGE enumeration You'd probably want to use D3D11_USAGE_DYNAMIC, since that page says: "A resource that is accessible by both the GPU (read only) and the CPU (write only). A dynamic resource is a good choice for a resource that will be updated by the CPU at least once per frame." |
08 October 2017, 09:17 | #29 |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
To add, maybe one of these links provides a usable example on drawing normal 2D texture:
The following samples demonstrate the Direct2D API. Direct2D and Direct3D Interoperability Overview: Draw a 2-D Background |
08 October 2017, 09:21 | #30 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
|
Tutorial 11 looks good (but still has some "useless" stuff included)
Direct2D is wrong choice, it is not designed for pixel perfect rendering. (Sounds illogical but thats how it is) EDIT: and it would restrict future shader usage too. Last edited by Toni Wilen; 08 October 2017 at 09:30. |
08 October 2017, 10:21 | #31 | |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Cool, good to know.
In that context the following Github may be of additional use: matt77hias/RasterTek Quote:
|
|
08 October 2017, 10:45 | #32 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
|
I am not going to use obsolete SDKs = need to find example that uses vertex shader for orthographic projection. (or precomputes it using CPU)
|
13 October 2017, 14:10 | #33 | |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Quote:
Apparently the OP got it working in the end, so hopefully it's of some help for our case. |
|
13 October 2017, 16:28 | #34 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,340
|
You could look at the DirectX Toolkit (DirectXTK) (blog post).
That includes a kind of 2D sprite engine. Perhaps Src/SpriteBatch.cpp could be helpful? Not necessarily to use the whole thing in WinUAE (just that file is ~1200 lines of code), but about displaying 2D bitmap images. |
13 October 2017, 17:42 | #35 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
|
As I already said: I want minimal example. Nothing extra. (EDIT: the point is that I am not interested in learning D3D11, at least not now. First comes DXGI improvements stuff, then much later all the D3D11 extra things)
Last edited by Toni Wilen; 13 October 2017 at 21:07. |
14 October 2017, 11:35 | #36 | |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Quote:
With regards to minimum requirements, are you targeting DXGI 1.3 (which seems necessary for the lower-latency swap chain presentation), i.e. minimum requirements will be Windows 8.1 or better? |
|
14 October 2017, 12:53 | #37 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
|
I probably use latest first. Then later (when/if it becomes "official" feature), it will support older versions. Maybe.
|
22 October 2017, 14:26 | #38 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
|
Very experimental D3D 11 support added..
- Don't try to use fullscreen. (DXGI mode enumeration returns much more info than old ones and again it seems to not be possible to match old style mode with new style) - Filter settings are ignored. - Scaling is not available. - Enables (if available) windowed variable refresh rate mode (DXGI_FEATURE_PRESENT_ALLOW_TEARING). G-Sync confirmed working. Which is nice. - In theory it may work with Windows 7 but may require 8 or 10 (at this point). Windows 10 16299 only tested. - No error checking, it just fails if something goes wrong. - Still requires d3d9x (=June 2010 DX redistributable) for matrix calculations. - Calls SetMaximumFrameLatency(1) but I am not sure if it has any effect in windowed mode. - This is very quick and dirty hack of 2D example tutorial. - There is something wrong with calculations because display quality changes depending on window size. It should be pixel perfect all the time. EDIT: shaders from tutorial added, must be located at plugins/filtershaders/direct3d11 |
22 October 2017, 16:06 | #39 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,340
|
Testing winuae.exe dated 2017-10-22 12:52 I couldn't get D3D11 mode to work. Windows 10 16299.19 x64, AMD FirePro W5100.
Log output: D3D11 free start D3D11 free end Max hardware surface size: 16384x16384 Allocated draw temp buffer (1600*1280*32) = 13BEF020 D3D11 init start CheckFeatureSupport(DXGI_FEATURE_PRESENT_ALLOW_TEARING) = 00000000 1D3D11 free start D3D11 free end D3D11 free start D3D11 free end D3D11 ERROR! Edit: Could use a \n after the CheckFeatureSupport log line... |
22 October 2017, 16:16 | #40 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
|
More logging added. (btw, don't try to change Direct3D mode on the fly, it isn't going to work. Same with many other options..)
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Photos and/or measurements of Amiga 500 | bLAZER | request.Other | 144 | 16 October 2018 01:40 |
A method for further improving latency (input lag) in FS-UAE | Dr.Venom | support.FS-UAE | 4 | 12 September 2017 16:49 |
Optimizing DirectX apps for low latency input and longer battery life | Dr.Venom | support.WinUAE | 2 | 24 April 2017 09:40 |
What are the measurements of Amiga 1200 case screws | Tallrot | support.Hardware | 9 | 15 June 2016 10:04 |
A1200 and B1230 Voltage Measurements for Dummies? | Jarin | support.Hardware | 2 | 23 January 2014 10:02 |
|
|