Skip to content

Vulkan/OpenGL error generating vert and frag files #2214

@Doprez

Description

@Doprez

Release Type: Official

Version: 4.2.0.2122

Platform(s): Windows

Describe the bug
I have been playing around with TR.Stride and was trying to export to Vulkan but I keep getting an error about incorrect variable names or conversion errors.

To Reproduce
Steps to reproduce the behavior:

  1. pull TR.Stride
  2. Remove references to the Ocean project due to compute shader issues
  3. follow https://doc.stride3d.net/4.2/en/manual/graphics/graphics-api.html to get the vulkan compilation
  4. run the project

Expected behavior
The project should run with the correct generated shader files.

Log and callstacks

System.AggregateException
  HResult=0x80131500
  Message=One or more errors occurred. (Could not compile shader. See error messages.Info: C:\Users\User\AppData\Local\Temp\tmpdvazal.vert
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpdvazal.vert:23: 'gl_InstanceID' : undeclared identifier (Did you mean gl_InstanceIndex?)
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpdvazal.vert:23: 'assign' :  cannot convert from ' temp float' to ' global highp uint'
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpdvazal.vert:23: '' : compilation terminated 
Info: ERROR: 3 compilation errors.  No code generated.
Info: SPIR-V is not generated for failed compile or link
Error: Failed to generate SPIR-V from GLSL
Info: C:\Users\User\AppData\Local\Temp\tmpxu3ojj.frag
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpxu3ojj.frag:208: 'DepthStencil_id80' : undeclared identifier 
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpxu3ojj.frag:208: 'DepthStencil_id80' :  left of '[' is not of type array, matrix, or vector  
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpxu3ojj.frag:208: '' : compilation terminated 
Info: ERROR: 3 compilation errors.  No code generated.
Info: ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point
Info: SPIR-V is not generated for failed compile or link
Error: Failed to generate SPIR-V from GLSL
)
  Source=System.Private.CoreLib
  StackTrace:
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Stride.Rendering.RootEffectRenderFeature.PrepareEffectPermutations(RenderDrawContext context)
   at Stride.Rendering.RenderSystem.Prepare(RenderDrawContext context)
   at Stride.Rendering.Compositing.GraphicsCompositor.DrawCore(RenderDrawContext context)
   at Stride.Rendering.RendererBase.Draw(RenderDrawContext context)
   at Stride.Engine.SceneSystem.Draw(GameTime gameTime)
   at Stride.Games.GameSystemCollection.Draw(GameTime gameTime)
   at Stride.Games.GameBase.Draw(GameTime gameTime)
   at Stride.Games.GameBase.RawTick(TimeSpan elapsedTimePerUpdate, Int32 updateCount, Single drawInterpolationFactor, Boolean drawFrame)
   at Stride.Games.GameBase.RawTickProducer()
   at Stride.Games.GameBase.Tick()
   at Stride.Games.GamePlatform.Tick()
   at Stride.Games.GamePlatform.OnRunCallback()
   at Stride.Games.GameWindowSDL.<>c__DisplayClass17_0.<Run>b__0()
   at Stride.Games.SDLMessageLoop.Run(Window form, RenderCallback renderCallback)
   at Stride.Games.GameWindowSDL.Run()
   at Stride.Games.GamePlatform.Run(GameContext gameContext)
   at Stride.Games.GameBase.Run(GameContext gameContext)
   at TR.Stride.TR_StrideApp.Main(String[] args) in C:\dev\GitControlledProjects\TR.Stride\TR.Stride.Windows\TR_StrideApp.cs:line 11

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
InvalidOperationException: Could not compile shader. See error messages.Info: C:\Users\User\AppData\Local\Temp\tmpdvazal.vert
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpdvazal.vert:23: 'gl_InstanceID' : undeclared identifier (Did you mean gl_InstanceIndex?)
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpdvazal.vert:23: 'assign' :  cannot convert from ' temp float' to ' global highp uint'
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpdvazal.vert:23: '' : compilation terminated 
Info: ERROR: 3 compilation errors.  No code generated.
Info: SPIR-V is not generated for failed compile or link
Error: Failed to generate SPIR-V from GLSL
Info: C:\Users\User\AppData\Local\Temp\tmpxu3ojj.frag
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpxu3ojj.frag:208: 'DepthStencil_id80' : undeclared identifier 
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpxu3ojj.frag:208: 'DepthStencil_id80' :  left of '[' is not of type array, matrix, or vector  
Info: ERROR: C:\Users\User\AppData\Local\Temp\tmpxu3ojj.frag:208: '' : compilation terminated 
Info: ERROR: 3 compilation errors.  No code generated.
Info: ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point
Info: SPIR-V is not generated for failed compile or link
Error: Failed to generate SPIR-V from GLSL


Additional context
I have been tracking the issues in a TR.Stride issues here to see if I can get it running in Linux.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions