sharpdx / SharpDX

SharpDX GitHub Repository
http://sharpdx.org
MIT License
1.69k stars 638 forks source link

Vendor specific extentions #910

Closed matmuze closed 7 years ago

matmuze commented 7 years ago

Hello, sorry for spamming, but has anybody managed to use SharpDX with vendor specific extentions ? Let's say NvAPI_D3D11_MultiDrawInstancedIndirect for instance ? I haven't seen anything like that in the samples, is it even supported somehow ?

xoofx commented 7 years ago

We won't provide any support for vendor extensions, but you should be able to use SharpDX with them. Just pass the comObj.NativePointer of the expected com objects to the underlying function.

matmuze commented 7 years ago

Thanks a lot Alex, just love how you always reply in such short notice :)

Would you maybe have an example (even not related to vendor extensions) on how to use the comObj.NativePointer ? It just sounds a bit abstract to me ATM.

Merci d'avance, Mat.

xoofx commented 7 years ago

Whenever you see a C signature like this:

NVAPI_INTERFACE     NvAPI_D3D11_MultiDrawInstancedIndirect (__in ID3D11DeviceContext *pDevContext11, __in NvU32 drawCount, __in ID3D11Buffer *pBuffer, __in NvU32 alignedByteOffsetForArgs, __in NvU32 alignedByteStrideForArgs)

it means that it takes a pointer to the COM object interface ID3D11DeviceContext. Every .NET SharpDX COM Object has a strict equivalent to an underlying native COM object, SharpDX.Direct3D11.DeviceContext to ID3D11DeviceContext. The property NativePointer on an object gives an access to this pointer.

h1cks commented 7 years ago

@xoofx - Serious question here, would this warrant a new package if say someone did some AMD specific extensions as well (Sharpdx.VendorExtensions?). There are a few about for both APIs. Just a question, I would be interested at some stage at playing around in this stuff. If someone was to commit to working on them, would you receptive to adding this to the library? Not a problem either way :)

Seeing that AMD for example -> http://gpuopen-librariesandsdks.github.io/ags/group__dx11.html

xoofx commented 7 years ago

@h1cks No, I prefer these extensions to stay outside of SharpDX and that SharpDX stays focus on official DirectX/Win APIs.