Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shaders compiled by glslPrecompiler are not supported on WP8 #4

Closed
flsobral opened this issue Dec 3, 2013 · 6 comments
Closed

shaders compiled by glslPrecompiler are not supported on WP8 #4

flsobral opened this issue Dec 3, 2013 · 6 comments

Comments

@flsobral
Copy link

flsobral commented Dec 3, 2013

Hello.

I'm trying to use angle on WP8 but apparently the precompiled shaders created by the glslPrecompiler are not supported on the device.
The error message is
D3D11 ERROR: ID3D11Device::CreatePixelShader: Invalid shader version provided: ps_4_0 [ STATE_CREATION ERROR #193: CREATEPIXELSHADER_INVALIDSHADERTYPE]

The RotatingCube sample for WP8 works fine using the precompiled shader that comes with the project.
I used the RotatingCube for winrt to make sure my code was correct. Running on winrt I can compile the glsl dinamycally or use precompiled shaders, it works either way.

I checked the readme file and tried several combinations of macro definitions but nothing worked.

Thanks in advance.

@stammen
Copy link
Owner

stammen commented Dec 3, 2013

I need to update the shader compiler code. For now, in Visual Studio, from the Debug menu select Graphics/DirectX Control Panel. Click on Edit List and select the glslPrecompiler.exe in the src/glslPrecompiler/Debug folder. Then Under Device Settings Select 9_3 for the Feature level limit. I will be updating the compiler app next week.

@stammen
Copy link
Owner

stammen commented Dec 3, 2013

I just validated that this works. Please let me know if you have any more issues.

@flsobral
Copy link
Author

flsobral commented Dec 3, 2013

Ok, the error is gone, but glProgramBinaryOES still fails.
Using GL_LINK_STATUS I get the following message:
"Invalid program binary version.
Mismatched compilation flags."

I built glslPrecompiler with the following flags:
COMPILE_SHADER
USE_FEATURE_LEVEL_9_3
ANGLE_ENABLE_D3D11

@flsobral
Copy link
Author

flsobral commented Dec 3, 2013

Oops, nevermind. My mistake, passed the wrong length when loading the shader.
Thanks! :D

@adipose
Copy link

adipose commented Dec 16, 2013

The instructions for glslprecompiler (in the README) say to use flag USE_FEATURE_LEVEL_9_3.

But, this flag has been removed from the codebase (Renderer11.cpp), making it useless.

The above solution does work, but if you add back this code, it also fixes it:

static const D3D_FEATURE_LEVEL sfeatureLevels[] =
{
#ifdef USE_FEATURE_LEVEL_11_0
D3D_FEATURE_LEVEL_11_0
#elif defined(USE_FEATURE_LEVEL_10_1)
D3D_FEATURE_LEVEL_10_1
#elif defined(USE_FEATURE_LEVEL_10_0)
D3D_FEATURE_LEVEL_10_0
#elif defined(USE_FEATURE_LEVEL_9_3)
D3D_FEATURE_LEVEL_9_3
#elif defined(USE_FEATURE_LEVEL_9_2)
D3D_FEATURE_LEVEL_9_2
#elif defined(USE_FEATURE_LEVEL_9_1)
D3D_FEATURE_LEVEL_9_1
#else D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_9_3,
D3D_FEATURE_LEVEL_9_2,
D3D_FEATURE_LEVEL_9_1
#endif
};

@stammen
Copy link
Owner

stammen commented Dec 19, 2013

There is a new compiler program in the dev branch in src/winrtcompiler that is now working for winrt and wp8 shader compilation.

@stammen stammen closed this as completed Dec 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants