locked
Passing from Vertex Shader to Geometry Shader

    Question

  • Okay, I've downloaded the SpriteBatch sample from the Dev Center.  I'm trying to edit it so that it can support animated sprites through sprite sheets.  My problem is that the Geometry shader doesn't seem to be getting the frame input from the vertex shader.  I've debugged the vertex shader and my custom frame attribute (just a float) is there.  But, when I debug the geometry shader the frame attribute is 0.  Any help?

    Input Layout:

    Edit: Code erased.

    Geometry Shader:

    Edit: Code erased.

    Just in case this helps-Vertex Shader:

    Edit: Code erased.

    • Edited by DualOpAmp Friday, July 27, 2012 11:58 AM
    Wednesday, July 18, 2012 9:35 PM

Answers

  • It was a very simple mistake.  The struct that described the InstanceData had an int instead of a float for the frame.

    My bad.

    • Marked as answer by DualOpAmp Friday, July 27, 2012 12:00 PM
    Friday, July 27, 2012 12:00 PM

All replies

  • Did you get any error message when you load the shader?

    NEU_ShieldEdge

    Friday, July 20, 2012 9:10 AM
  • Nope, no error messages. Runs just fine.  My attempt was just to get the UVs to screw all wackily.  That way, I know it's working.  Then, I would copy my code I had made earlier into the geometry shader, for updating the UVs so that they would scroll through a sprite sheet.  But, it didn't work.  The pictures drew successfully, with no distorting in the UVs.  And I know this method works, I've already had a vertex shader playing through a sprite sheet.

    Anyway, I did a graphics diagnostic and stepped through the vertex shader, and the frame variable gets handed the number, then I stepped through the geometry shader, and the frame variable is zero.  I don't know what's wrong.


    • Edited by DualOpAmp Friday, July 20, 2012 5:31 PM
    Friday, July 20, 2012 5:30 PM
  • Try VS2012's graphic debugging (ALT+F5).

    But seems ARM devices do not support Geometry Shader, only Feature_Level_9_1.


    C++ DX11

    Wednesday, July 25, 2012 2:43 AM
  • It was a very simple mistake.  The struct that described the InstanceData had an int instead of a float for the frame.

    My bad.

    • Marked as answer by DualOpAmp Friday, July 27, 2012 12:00 PM
    Friday, July 27, 2012 12:00 PM