Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7677999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:32:43+00:00 2026-05-31T17:32:43+00:00

I have a very strange problem with using geometry shaders. I made a very

  • 0

I have a very strange problem with using geometry shaders. I made a very simple geometry shader which takes a point and transforms it into a triangle.

here is the shader:

struct GS_OUTPUT
{
    float4 pos : SV_POSITION;
};

struct VS_INPUT
{
    float3 pos : ANCHOR;
};

VS_INPUT VShader(VS_INPUT input)
{
    return input;   
}

float4 PShader(float4 position: SV_POSITION) : SV_Target
{
return float4(0.0, 1.0, 0.5, 0.0);
}

[maxvertexcount(3)]
void Triangulat0r( point VS_INPUT input[1], inout TriangleStream<GS_OUTPUT> OutputStream )
{   
    GS_OUTPUT output;
float3 _input;

_input = input[0].pos;

output.pos = float4(_input.x + 0.1, _input.y - 0.1, _input.z, 1.0);
OutputStream.Append( output );


output.pos = float4(_input.x - 0.1, _input.y - 0.1, _input.z, 1.0);
OutputStream.Append( output );


output.pos = float4(_input.x, _input.y + 0.1, _input.z, 1.0);
OutputStream.Append( output );

}

I send it 4 vertices like this:

// create test vertex data, making sure to rewind the stream afterward
var vertices = new DataStream(12*4, true, true);
vertices.Write(new Vector3(-0.5f, -0.5f, 0f));
vertices.Write(new Vector3(-0.5f, 0.5f, 0f));
vertices.Write(new Vector3(0.5f, 0.5f, 0f));
vertices.Write(new Vector3(0.5f, -0.5f, 0f));
vertices.Position = 0;

// create the vertex layout and buffer
var elements = new[] { new InputElement("ANCHOR", 0, Format.R32G32B32_Float, 0) };
var layout = new InputLayout(device, inputSignature, elements);
var vertexBuffer = new Buffer(device, vertices, 12 * 4, ResourceUsage.Default, BindFlags.VertexBuffer, CpuAccessFlags.None, ResourceOptionFlags.None, 0);

// configure the Input Assembler portion of the pipeline with the vertex data
context.InputAssembler.InputLayout = layout;
context.InputAssembler.PrimitiveTopology = PrimitiveTopology.PointList;
context.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(vertexBuffer, 12, 0));

And I get this output:

output from the program, with the strange middle triangle

As you can see, I only sent 4 triangles to the input assembler, and 5 are coming out in the output..

Any ideas on why this happens? I’m afraid it might be related to extra memory being allocated by the buffers… but I can’t seem to figure out where exactly the problem is.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:32:44+00:00Added an answer on May 31, 2026 at 5:32 pm

    If you try to draw more vertices than whats in your vertex buffer, all “extra” vertices will have the value zero. You would see the following warning if you ran your program through Windbg (won’t show in Visual studio).

    D3D10: WARNING: ID3D10Device::Draw: Vertex Buffer at the input vertex
    slot 0 is not big enough for what the Draw*() call expects to
    traverse. This is OK, as reading off the end of the Buffer is defined
    to return 0. However the developer probably did not intend to make use
    of this behavior. [ EXECUTION WARNING #356:
    DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL ]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very strange problem. Using Gmap3, I place the pin on the
I have encountered a very strange problem in using jQuery load() . I used
I'm encountering a very strange problem using g++ 4.1.2. I have a very basic
I have very strange problem with mySQL and simple query with simple index. I
I have a very strange problem. I am using jQuery to intercept a particular
I have a very strange problem. (fyi - I'm using forms authentication and manually
I have a very strange problem when I using ajax in symfony 1.4. I've
I have a very strange problem. I have an AsyncTask which appears to block
I have a rather strange problem. I have a very simple application that reads
I am into a very strange problem. I have developed an app for myself,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.