Coder Social home page Coder Social logo

Comments (7)

flibitijibibo avatar flibitijibibo commented on August 23, 2024

At one point I thought about making it accessible via the DXGIFactory since we need to know which WSI to use the moment anything DXGI gets touched, but it's worth noting that a dxvk-native application must set the variable on startup, so if the application and its launcher both use it they're required to specify the WSI as if they were the base process (we treat "no value found" as a hard error to avoid apps depending on any kind of default value), so that would avoid the conflict in this particular example.

A real export wouldn't be so bad though, an example could be tried with this line in FNA3D: https://github.com/FNA-XNA/FNA3D/blob/master/src/FNA3D_Driver_D3D11.c#L5198

from dxvk.

doitsujin avatar doitsujin commented on August 23, 2024

Introducing an entry point for this sounds good, definitely cleaner than the env var we currently have.

from dxvk.

flibitijibibo avatar flibitijibibo commented on August 23, 2024

I'd be okay with something like extern "C" int dxvkSetWSI(const char*); in libdxgi; as long as it's easy to dlsym it shouldn't be too hard to add to existing D3D backends!

from dxvk.

smcv avatar smcv commented on August 23, 2024

I'd be okay with something like extern "C" int dxvkSetWSI(const char*); in libdxgi; as long as it's easy to dlsym it shouldn't be too hard to add to existing D3D backends!

That sounds great to me, but I don't know the D3D/DXGI architecture well enough to know where best to put the global variable that would be set by this function, such that there would only be one copy of it per process and it would be accessible to everything that needs to know which WSI is the active one. (The obvious candidates seem to be static libraries that I think get linked more than once, making them unsuitable for that purpose.)

from dxvk.

flibitijibibo avatar flibitijibibo commented on August 23, 2024

That's a good question; I believe WSI instances occur in both DXGI and D3D9/8 devices; the part that's tough is that the very first API call for each library will want WSI immediately so it's tough to add it to existing interfaces... @Joshua-Ashton, any ideas for D3D9 in particular?

from dxvk.

smcv avatar smcv commented on August 23, 2024

Is there a "bottom-level" library that all of the others call into (is that DXGI?), like the way everything in the GTK ecosystem depends on GLib? If there is, then it could have an extern "C" int dxvkSetWSI(const char*) and a matching extern "C" const char *dxvkGetWSI(void).

But if there's no obvious bottom-level library then it might have to be more like dxvkDXGISetWSI, dxvkD3D9SetWSI, dxvkD3D8SetWSI.

from dxvk.

flibitijibibo avatar flibitijibibo commented on August 23, 2024

The latter route is probably the way to go - the bottomest(?) library is libdxvk for DxvkInstance but that's statically linked, so entries for each lib is probably all we can do.

from dxvk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.