Trying to make my engine work on Steamdeck

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Trying to make my engine work on Steamdeck

Post by suny »

Ogre Version: 13.3
Operating System: :?:
Render System: :?: DX9

Hi,
I'm trying to make the game exported by the SHMUP Creator not crash on Steamdeck. I have to say I don't have Steamdeck right now, I only received logs from people who tried.
From what I understand, my shaders don't compile, but I'm not sure to understand why and what I can do.

For example, from Ogre.log:

Code: Select all

00:37:30: Error: ScriptCompiler - invalid parameters in (38): Named constants have not been initialised, perhaps a compile error
00:37:30: Error: ScriptCompiler - invalid parameters in (39): Named constants have not been initialised, perhaps a compile error
00:37:30: Error: ScriptCompiler - invalid parameters in (40): Named constants have not been initialised, perhaps a compile error
00:37:30: Program 'onlyTextureNoColor_vs' is not supported: Cannot assemble D3D9 high-level shader onlyTextureNoColor_vs Errors:
<anonymous>:45:20: E5005: Function "tex2D" is not defined.

But my shader only has a tex2D in the fragment shader so I'm lost:

Code: Select all

struct VIn
{
    float4 p    : POSITION;
	float2 uv   : TEXCOORD0;
};

struct VOut
{
    float4 p    : SV_POSITION;
	float2 uv   : TEXCOORD0;
};

struct PIn
{
	float4 p    : SV_POSITION;
	float2 uv   : TEXCOORD0;
};

struct POut
{
    half4 c : COLOR;
};

VOut onlyTextureNoColor_vs(VIn IN,
 uniform float4x4 wvpMat
)
{
    VOut OUT;
	
OUT.p = mul(wvpMat, IN.p);
OUT.uv = IN.uv;
return OUT;
}


POut onlyTextureNoColor_ps(
    PIn IN,
	uniform float alpha,
	uniform sampler2D tex : TEXUNIT0
	)
	
{
POut OUT;
 
half4 diffuseTex = tex2D(tex, IN.uv) * alpha;
OUT.c = diffuseTex;

return OUT;
}

I also have a lot of missing shader features, like fwidth or fmod, and I don't know how to do without them. Also, Ogre own shadow shaders don't compile.

Code: Select all

00:37:30: Parsing script ShadowVolumeExtude.program
00:37:30: Program 'Ogre/ShadowBlendVP' is not supported: Cannot assemble D3D9 high-level shader Ogre/ShadowBlendVP Errors:
<anonymous>:60:69: E5005: Function "tex2Dlod" is not defined.

00:37:30: Error: ScriptCompiler - invalid parameters in (10): Named constants have not been initialised, perhaps a compile error
00:37:30: Program 'Ogre/ShadowBlendFP' is not supported: Cannot assemble D3D9 high-level shader Ogre/ShadowBlendFP Errors:
<anonymous>:60:69: E5005: Function "tex2Dlod" is not defined.

00:37:30: Error: ScriptCompiler - invalid parameters in (27): Named constants have not been initialised, perhaps a compile error
00:37:30: Error: ScriptCompiler - invalid parameters in (28): Named constants have not been initialised, perhaps a compile error
00:37:30: Error: ScriptCompiler - invalid parameters in (29): Named constants have not been initialised, perhaps a compile error
00:37:30: Error: ScriptCompiler - invalid parameters in (30): Named constants have not been initialised, perhaps a compile error
00:37:30: Error: ScriptCompiler - invalid parameters in (31): Named constants have not been initialised, perhaps a compile error
00:37:30: Error: ScriptCompiler - invalid parameters in (32): Named constants have not been initialised, perhaps a compile error
00:37:30: Error: ScriptCompiler - invalid parameters in (33): Named constants have not been initialised, perhaps a compile error
00:37:30: Error: ScriptCompiler - invalid parameters in (34): Named constants have not been initialised, perhaps a compile error
00:37:30: Program 'animatedParticle_fp' is not supported: Cannot assemble D3D9 high-level shader animatedParticle_fp Errors:
<anonymous>:6:14: E5005: Function "fwidth" is not defined.

00:37:30: Error: ScriptCompiler - invalid parameters in (44): Named constants have not been initialised, perhaps a compile error
00:37:30: Error: ScriptCompiler - invalid parameters in (45): Named constants have not been initialised, perhaps a compile error
00:37:30: Error: ScriptCompiler - invalid parameters in (46): Named constants have not been initialised, perhaps a compile error
00:37:30: Parsing script bullets.program
00:37:30: Program 'bullet_vs' is not supported: Cannot assemble D3D9 high-level shader bullet_vs Errors:
<anonymous>:49:18: E5005: Function "fmod" is not defined.

If someone has some guidance about what I could do :)
S.

rpgplayerrobin
Gnoll
Posts: 619
Joined: Wed Mar 18, 2009 3:03 am
x 353

Re: Trying to make my engine work on Steamdeck

Post by rpgplayerrobin »

I cannot know for sure, but it seems Steamdeck is using Linux?
In that case, how is it actually running Direct3D9 shaders?
The answer to that is probably that the user is using some kind of software to make it work, like dxvk/wine.

There are multiple posts about exactly your issue, and they all have to do with errors of the software that tries to run the Direct3D through Linux, and not anything about Ogre at all:
https://www.reddit.com/r/SteamDeck/comm ... t_drifter/
https://github.com/ValveSoftware/Proton/issues/6730

User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: Trying to make my engine work on Steamdeck

Post by suny »

Steam is using Proton to translate windows DirectX games in Vulkan, from what I understood.

rpgplayerrobin
Gnoll
Posts: 619
Joined: Wed Mar 18, 2009 3:03 am
x 353

Re: Trying to make my engine work on Steamdeck

Post by rpgplayerrobin »

One of the links above is a problem exactly with Proton regarding the same bug that you have.

You might have to contact Proton for this instead, since this seems to be a Proton bug and not an Ogre issue.

User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: Trying to make my engine work on Steamdeck

Post by suny »

I know this is not an Ogre issue, but asked if someone had ideas to help me (and I saw that Paroj has a Steamdeck :) ): I will contact Proton and see how it goes.

Thanks!
S.

paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Trying to make my engine work on Steamdeck

Post by paroj »

you dont need a steamdeck to reproduce this issue. Just install Steam on Linux somewhere its virtually the same stack.

Also, I test Ogre via Wine (which Proton is based on) regularly and did not encounter such issues so far.

User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: Trying to make my engine work on Steamdeck

Post by suny »

I will install Linux.

But what about those ones:

Code: Select all

19:13:11: Parsing script ShadowVolumeExtude.program
19:13:11: Program 'Ogre/ShadowBlendVP' is not supported: Cannot assemble D3D9 high-level shader Ogre/ShadowBlendVP Errors:
<anonymous>:60:69: E5005: Function "tex2Dlod" is not defined.

Code: Select all

19:13:11: Error: ScriptCompiler - invalid parameters in (10): Named constants have not been initialised, perhaps a compile error
19:13:11: Program 'Ogre/ShadowBlendFP' is not supported: Cannot assemble D3D9 high-level shader Ogre/ShadowBlendFP Errors:
<anonymous>:60:69: E5005: Function "tex2Dlod" is not defined.

Code: Select all

19:13:11: Program 'Ogre/ShadowExtrudeDirLightFinite' is not supported: Cannot assemble D3D9 high-level shader Ogre/ShadowExtrudeDirLightFinite Errors:
<anonymous>:60:69: E5005: Function "tex2Dlod" is not defined.

Code: Select all

19:13:11: Program 'Ogre/ShadowExtrudeDirLight' is not supported: Cannot assemble D3D9 high-level shader Ogre/ShadowExtrudeDirLight Errors:
<anonymous>:60:69: E5005: Function "tex2Dlod" is not defined.

Several people tried the engine on several Steamdec and every one of them had those issues with Ogre shaders. I didn't modify them and only copied them from Ogre.
S.

rpgplayerrobin
Gnoll
Posts: 619
Joined: Wed Mar 18, 2009 3:03 am
x 353

Re: Trying to make my engine work on Steamdeck

Post by rpgplayerrobin »

Here is another very similar issue posted (search for "tex2D") to proton that was solved for one user just 5 days ago, which suggests that if they update proton it could already be fixed:
https://github.com/ValveSoftware/Proton/issues/1173

There are more players online that has this exact issue for many random games.

You can also have some users try different settings, like PROTON_USE_WINED3D which seems to solve this issue for one user.
More settings here:
https://github.com/ValveSoftware/Proton

If I were you, I would install Proton itself as a local install on a Linux VM and then try your game there:
https://github.com/ValveSoftware/Proton ... on-locally

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 449
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 156

Re: Trying to make my engine work on Steamdeck

Post by sercero »

Porting your engine to linux would be too difficult?

User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: Trying to make my engine work on Steamdeck

Post by suny »

I guess not, but I'm already stretched very very thin updating the engine to Windows only, uploading to Steam, and fixing bugs...

I'm part-time porting the engine to DirectX11 right now, and doing so I'm finding very ugly things I did with shaders that were OK with dx9 but are not supported with dx11. I hope it will help me clean my code and have something easier to port with Proton.
And of course, I need to install Linux somewhere to test, but I'm developing on a macbook pro + Bootcamp, so it's not so easy right now :)
S.

Post Reply