# Geometry shader

**URL:** https://discourse.vtk.org/t/geometry-shader/917
**Category:** Support
**Created:** [May 6, 2019, 8:21pm UTC](https://discourse.vtk.org/t/geometry-shader/917 "2019-05-06T20:21:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![graphicsmonkey](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/3e96dc/32.png) [@graphicsmonkey](https://discourse.vtk.org/u/graphicsmonkey)
#### Post date: [May 6, 2019, 8:21pm UTC](https://discourse.vtk.org/t/geometry-shader/917/1 "2019-05-06T20:21:58Z")

</div>

Hi,

I’m working on a geometry shader and i’m having problems getting past a runtime error when i use  
`layout( triangles_adjacency ) in`

I’m not seeing the error when i use the following though  
`layout( triangles ) in`

My shader requires the adjacency information so i’m in a bit of a bind.

Any help appreciated.

Thanks.

---

<div class="post-metadata">

### Author: ![graphicsmonkey](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/3e96dc/32.png) [@graphicsmonkey](https://discourse.vtk.org/u/graphicsmonkey)
#### Post date: [May 6, 2019, 8:24pm UTC](https://discourse.vtk.org/t/geometry-shader/917/2 "2019-05-06T20:24:31Z")

</div>

My complete test shader code is this;

//VTK::System::Dec

// Input is triangle plus adjacency information  
layout( triangles\_adjacency ) in;

// Ouput has max 3 vertices  
layout( triangle\_strip, max\_vertices = 3 ) out;

void main() {  
// Just pass through to see if anything works  
gl\_Position = gl\_in[0].gl\_Position;  
EmitVertex();

```
gl_Position = gl_in[2].gl_Position;
EmitVertex();

gl_Position = gl_in[4].gl_Position;
EmitVertex();	

EndPrimitive();	

```

}

---

<div class="post-metadata">

### Author: ![dmreagan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dmreagan/32/7489_2.png) [@dmreagan](https://discourse.vtk.org/u/dmreagan)
#### Post date: [May 24, 2019, 6:29pm UTC](https://discourse.vtk.org/t/geometry-shader/917/3 "2019-05-24T18:29:17Z")

</div>

What kind of runtime error are you seeing?

When I tried a simple example with `lines_adjacency` or `triangles_adjacency` nothing was drawn, but there were no errors. I think the problem is that the OpenGL draw call needs to use special primitives like `GL_LINES_ADJACENCY` or `GL_TRIANGLES_ADJACENCY`, but a quick search through the VTK source doesn’t reveal any adjacency primitives in use.
