Skip to content

Unable to generate working shaders #32

Open
@DoktorJ0nes

Description

@DoktorJ0nes

I am trying to get self written shaders to work for days now.
Because we cant use SPRIV or compile GLSL for the driver I need to rely on your documentation about generating shaders.
Unfortunately the provided documentation is very sparse. I tried to dig thru the code of the tests but without any luck.
I tested all your test examples and they all seem to work.

What I am trying at the moment:

  • Build an OpenGL application and insert the GLSL shader I want to use there. Dump the shader with help of Mesa.
  • Copy the 64bit asm hex code to the shaders,h of QPUassembler, change the used shader there and build the QPUassembler application
  • run the QPUassembler application, copy the generated asm code as a shader into my vulkan projects code.
  • edit the mapping of the vertex shader uniforms accordingly.

Unfortunately the shader just randomly lets some kind of geometry flicker sometimes on the screen.

I have a few questions:
a) Why are you passing the viewport X and Y scale to the shader? I looked up all test examples and you are always doing this. Does it have a reason?
b) Why are you using a compute shader in every test example? Even in the triangle test. You are also using the viewport scales there.
c) What versions of GLSL are supported when doing the toolchain I described above. I am guessing you also somehow "compiled" your shaders and not written them by hand in asm. In the Quake3Arena source code I saw the GLSL version used there is 450. Unfortunately on the Pi we are restricted to version 120 with the Mesa driver and so cant dump GLSL shaders using any higher version.
d) In the Quake3Arena project for your driver I saw some plain GLSL shaders. Is there a parser tool in the project which can be used to generate shaders for your driver?
e) Is my toolchain described above correct?
f) is there anything to change in the asm code manually?
g) Are there any additional steps necessary to do to get a shader working?

I really love the driver and its speed. Your work on an own Vulkan driver is outstanding. But I am asking myself if people really use it when its so hard to get shaders working without a real documentation. I think when you are able to answer my questions people could really benefit.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions