FNA-XNA / FNA3D

FNA3D - 3D Graphics Library for FNA
http://fna-xna.github.io/
Other
281 stars 46 forks source link

Swapped ternary in D3D11 causes SW renderer to be used by default #179

Closed Popax21 closed 11 months ago

Popax21 commented 11 months ago

In commit 71073a3, support for the WARP software rasterizer was added to the D3D11 backend. However, the implementation used was severly flawed. See the following snippet from D3D11_PrepareWindowAttributes:

    const uint32_t driverType = SDL_GetHintBoolean("FNA3D_D3D11_USE_WARP", SDL_FALSE)
        ? D3D_DRIVER_TYPE_HARDWARE
        : D3D_DRIVER_TYPE_WARP;

This ternary is flipped; it uses WARP rendering when FNA3D_D3D11_USE_WARP is false (the default), and uses hardware rendering if it is true - the exact opposite logic of what is intended (a similar ternary also is in D3D11_CreateDevice).

This is a fairly urgent matter as it causes severe performance drops by default on all Windows systems. However, as far as I know this commit is not included in any releases yet, which means that it can be corrected before this bug affects people in the wild (at least going of the latest version commit).

Popax21 commented 11 months ago

Fixed by commit fcfab15.