Skip to main content
GameDev.net gamedev.net
🔒 Locked

Dynamic Shader Linkage for Windows Store Apps (non-toolkit)

Started by KaiRohmer Dec 2, 2013 at 4:27 PM 4 replies 1.9k views
Original Post
KaiRohmer
KaiRohmer

Hi,

I'm working with sharp dx (without the toolkit) and I'm trying to get dynamic shader linkage working. There is no real sample for dynamic shader linkage but looking into the dx sdk samples helps ;). as you can see there you need shader reflection and this is a part of the d3d compiler. While building for windows desktop everything works fine (at least if the native dlls are present d3dcompiler_4x.dll).

When building for windows store apps the application crashes as soon as i create the a shader reflection object.

The message says: d3dcompiler_46.dll is missing.

My solution to that: add the dll to the application content.. works fine, too.. but is dirty because i have to add this dll to each application

so i started a thread in the developer forum:

http://social.msdn.microsoft.com/Forums/windowsapps/en-US/b2e6e1c4-f1aa-4b6f-bf56-e2096cb97e73/load-a-dll-that-is-contained-in-the-content?forum=winappswithcsharp#a75c40a8-3f63-4698-a607-476000720204

and one guy there got furious ;) he says my solution is not legal .. now there is no response so i decided to post this here again and ask for a better solution ;)

maybe there is a better way to get shader linkage working with sharp dx..

thanks

- Kai

MJP
MJP

D3DCompiler isn't available for Windows 8 apps, but they made it available for Windows 8.1. However to use it you would need to link against the Windows 8.1 SDK. I'm not really familiar with SharpDX, so I don't know if an updated version is available that targets the new SDK.

As an alternative, you can consider reflecting your shaders ahead of time and extracting the data you need into your own custom data structures. Then you can just load your data at runtime, and avoid depending on D3DCompiler.

ongamex92
ongamex92

Sadly Windows phone 8.1 isn't available yet. This is MS biggest mistake, what were they thinking!?!?!? Certainly compiling shader at runtime is useless....

I'm glad they've fixed this issue in 8.1. I still think that MS are delivering great APIs and tools.

AlexandreMutel
AlexandreMutel

As MJP said, shipping D3DCompiler for Windows Store App is only possible with Windows 8.1. Also it is perfectly allowed to redistribute the D3DCompiler that is coming with W8.1 SDK, you just need to distribute it along your application as you did (this dll is not distributed by W8.x)

tonemgub
tonemgub

what were they thinking

They were thinking it was a security risk, since the API would be available to web apps (most store apps)? WebGL is the same, and Microsoft was anti-WebGL for a while, but they seem to have given up on that and started adding WebGL support to IE, sometime in 2012. So, back when they were working on Windows 8 (around 2011), they still had the anti-WebGL mentality. Come 2013, and now they're even adding GPU support to the C++ compiler (C++ AMP).

So the way I see it, the only reason Microsoft was anti-WebGL is because they didn't get their claws on it when the specification was written (because they were promoting their own Silverlight), and the exclusion of D3DCompile is a side-effect of that mentality.

KaiRohmer
KaiRohmer

thanks. i'll try linking against 8.1 sdk and if thats not satisfying i''ll go for MJPs offline reflection approach ;)

Edit:

I'll managed to switch to 8.1.. visuals studio can make life complicated sometimes^^

Nevertheless i also compiled SharpDX to get the latest build and together with 8.1 it works fine.. even without deploying he compiler dlls.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.