Does the Geometry Shader not accept definable uniforms?

Post Reply
Discostew
Posts: 103
Joined: Sun Mar 08, 2009 7:24 pm

Does the Geometry Shader not accept definable uniforms?

Post by Discostew » Wed Mar 25, 2015 11:23 pm

I've been attempting to reduce the amount of input that gets sent to the vertex shader by having the geometry shader handle generating vertices that are a set distance from the single vertex input through the use of uniforms. When using a uniform constant set from within the shader, it works fine, but when I shift it to program code where other uniform functions reside (which are used for the vertex shader) for the designated command list, it displays nothing, even when using the same static values that make up the uniform when it was constant.

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: Does the Geometry Shader not accept definable uniforms?

Post by elhobbs » Thu Mar 26, 2015 12:18 am

Discostew wrote:I've been attempting to reduce the amount of input that gets sent to the vertex shader by having the geometry shader handle generating vertices that are a set distance from the single vertex input through the use of uniforms. When using a uniform constant set from within the shader, it works fine, but when I shift it to program code where other uniform functions reside (which are used for the vertex shader) for the designated command list, it displays nothing, even when using the same static values that make up the uniform when it was constant.
Did you take a look at the text.vsh shader in portal3ds? It looks like smea is using a uniform with emitted vertices in the geometry shader.

Discostew
Posts: 103
Joined: Sun Mar 08, 2009 7:24 pm

Re: Does the Geometry Shader not accept definable uniforms?

Post by Discostew » Thu Mar 26, 2015 4:25 am

elhobbs wrote:
Discostew wrote:I've been attempting to reduce the amount of input that gets sent to the vertex shader by having the geometry shader handle generating vertices that are a set distance from the single vertex input through the use of uniforms. When using a uniform constant set from within the shader, it works fine, but when I shift it to program code where other uniform functions reside (which are used for the vertex shader) for the designated command list, it displays nothing, even when using the same static values that make up the uniform when it was constant.
Did you take a look at the text.vsh shader in portal3ds? It looks like smea is using a uniform with emitted vertices in the geometry shader.
Took a look at it, and other than a few differences to other things, the actual use of the uniform didn't seem to differ. I then went to examine his gs.c source code, and found out the problem. blargSNES uses an old GPU function of assigning an array of values to a uniform id, which I believe defaults to the vertex shader with no chance of choosing. The newer form allows you to assign whether the uniform gets used for vertex or geometry. I'll see if making the adjustment will work. At the very least, looking over this stuff and making up some adjustment to the overall shader source finally allowed me to use an updated version of aemstro.

Thanks for pointing me to where I could figure this out.

Seems being able to use uniforms for geometry shaders is a new development, because the version of libctru that comes with devkitARM r44 doesn't have the newer uniform function.

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests