Skip to content

Hangs When Using Geometry Shader In Combination With 3D Drawing #53

@iMackshun

Description

@iMackshun

To begin, I draw sprites using the geometry shader. I often draw 2D in 3D in various orders to achieve certain effects, such as 2D Background -> 3D Model -> Text. It seems that drawing in certain orders causes citro3D to hang, such that the main thread gets stuck in a loop. I didn't have this issue when I'd draw using only a vertex shader, so I'm sure it is related to me using the geometry shader. Under normal circumstances, the shader program works as expected. It is only when I draw sprites, and then draw a model that citro3D hangs. When drawing models, I use C3D_DrawElements to draw triangles with an index buffer. Whenever it hangs, I can no longer trigger the Luma menu, and must hard power off my 3DS.

To be more specific, here is a list of tests I've tried and the results.

  • Early 2D Draw (Works)
  • 3D Draw (Works)
  • 2D Draw (Works)
  • Early 2D Draw -> 3D Draw -> 2D Draw (Hangs)
  • 3D Draw -> 2D Draw (Works)
  • Early 2D Draw -> 3D Draw (Hangs)
  • Early 2D Draw (Works)
  • Early 2D Draw -> 2D Draw (Works)
  • 2D Draw -> 3D Draw (Hangs)

Here are the shaders I use.
Vertex Shader: https://pastebin.com/562LdNGk
Geometry Shader: https://pastebin.com/sHLtFUME

Here is the log of code execution.
Log: https://pastebin.com/mMnth0xD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions