Llamasoft does TxK for Sony Vita
- gilesgoat
- Sheepie Whore

- Posts: 27259
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Llamasoft does TxK for Sony Vita
.. ooh I am just LOVING Geometry Shaders .. they are so cool

Giles the billy goat
"Baa"
"Baa"
Re: Llamasoft does TxK for Sony Vita
Probably not an issue but if you're using the geoshader to create geometry, like using to make a new primitive type it can be faster using instancing. You can usually get similar results but the end up with a pipeline that's easier for the GPU to parallelize.
Based on old knowledge though, Dio can probably put me right if I've got it wrong
Based on old knowledge though, Dio can probably put me right if I've got it wrong
- gilesgoat
- Sheepie Whore

- Posts: 27259
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Llamasoft does TxK for Sony Vita
Well yes I've been thinking about it .. but DEPENDS on what/how you do, there's in fact a bit of a overhead in any case because the geom litereally needs extra buffers to 'expand' vertices and such some of which could not be fully resident on GPU space.gravy wrote:Probably not an issue but if you're using the geoshader to create geometry, like using to make a new primitive type it can be faster using instancing. You can usually get similar results but the end up with a pipeline that's easier for the GPU to parallelize.
Based on old knowledge though, Dio can probably put me right if I've got it wrong
However I did experiment ( with success ) with instancing as well and of course 'that's different' because fundamentally you are looping on stuff you already have in a buffer so IN THEORY for certain things "it should be faster than geom shader" BUT it's not the same thing.
But sure you have to consider when it would be more appropriate one solution VS the other, the experiments and things we done so far anyway proven that "there's so much power in the PS4 it's almost unbelievable".
One thing I've done yesterday and it came out working as a charm is a Geom Shader that inputs a LinesList and output the vectors as we done them in TxK, works well and allows me to do muuuch easier stuff without the need of all that CPU overhead , plus I found a better/faster way to compute that stuff
Anyway from my understanding of instancing even that "depends on case by case" because for example you may still need at least a prim buffer to start with and a 'parameter buffers' to associate with each prim instance to read, sure less data/faster than a bigger buffer but still .. don't know ..
To be honest I think "horse sense" .. if you are "pushing to the limits" it's a thing .. if you are "within reason" should be "0 problem" what it is one solution compared to another can make stuff easier to work with.
Giles the billy goat
"Baa"
"Baa"
Re: Llamasoft does TxK for Sony Vita
gilesgoat wrote: One thing I've done yesterday and it came out working as a charm is a Geom Shader that inputs a LinesList and output the vectors as we done them in TxK, works well and allows me to do muuuch easier stuff without the need of all that CPU overhead , plus I found a better/faster way to compute that stuff![]()
I did one the weekend but using instancing. I was worried about the CPU hit for dynamic line generation and also the vert count for lower end platforms.
You just send one of these verticies and it'll print a 2d line:
Code: Select all
struct cLineInstanceVert {
cVec3 mPosition0;
cVec3 mPosition1;
cVec4UByte mCol0;
cVec4UByte mCol1;
float mRadius;
float mLineHardness;
float mGlowRadius;
float mGlowIntensity;
};
As I say the glow needs to go in but I'm pretty happy with how simple the pixel shader ended up being by being a bit crafty with how the UV interpolant is set in the vertex shader. It's basically doing a per pixel distance from a line segment inside the quad fairly cheaply
Haven't put in the glow yet but the PS ended up being pleasingly simple
Code: Select all
in vec2 v_uv;
in vec4 v_color;
flat in float v_smallRadius;
flat in float v_hardness;
flat in float v_glowInensity;
out vec4 out_col;
void main()
{
float r = v_smallRadius;
vec2 uv = v_uv;
float d;
if (uv.s < 0 ) {
d = distance( uv, vec2(0,0) ) ;
} else if (uv.s > 1) {
d = distance( uv, vec2(1,0) );
} else {
d = abs(uv.t);
}
d = smoothstep( r , r* v_hardness, d );
out_col = v_color * d;
}
- gilesgoat
- Sheepie Whore

- Posts: 27259
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Llamasoft does TxK for Sony Vita
Yes but that's fundamentally computing a per-pixel distance from a line inside a PS.
Sure it's faster/less consumption that doing triangles ?
My - not huge - experience with all those "mobile" GPUs is "as LESS as you can do in a PS the better it goes", there seems to be "reasonable performance" in
drawing primitive but where normally things crumble is precisely in doing per-pixel calculations.
Fundamentally for mobile "the less you can do the better it goes"
GPUs are mediocre, CPUs are mediocre and the OS is mediocre at best 
[edit] - INTERVAL -
I am just as we speak/writing here now having a MASSIVE YELLING OF SWEARWORDS at a monitor that first decided to start with "OSD Power Lock" then the OSD went totally Bezerk then I tried a few thing suggested on the HP support site, finally it entered a loop where at random every 20 seconds or so was shutting itself on and off and finally decided that "it was time to shut off for good or such" ..
This is the second monitor so far I've seen going totally bezerk with OSDs and such ... no the cables are brand new so the PC I cannot believe there's any problem in the cables.
I just removed it and threw it in another room I think my progress on shaders stuff today will be with one single monitor ( and lot of switching between one input and the other ) I see a stream of more swearwords coming ( until I'll get a new one ) ..
If I would be super rich I'd sue Welsh Power, don't know what the fuck they have around here but power here is ALL but stable and quite often has VEEEEERY WEEEIRD things going on in totally unexpected moments.
The weirdest of all all that stuff seems NOT to happen when the weather is shit, or when it rains or when it's wind or whatever .. no at the contrary seems to happen when "weather could be not better than this" ( for Wales ) .
Sure it's faster/less consumption that doing triangles ?
My - not huge - experience with all those "mobile" GPUs is "as LESS as you can do in a PS the better it goes", there seems to be "reasonable performance" in
drawing primitive but where normally things crumble is precisely in doing per-pixel calculations.
Fundamentally for mobile "the less you can do the better it goes"
[edit] - INTERVAL -
I am just as we speak/writing here now having a MASSIVE YELLING OF SWEARWORDS at a monitor that first decided to start with "OSD Power Lock" then the OSD went totally Bezerk then I tried a few thing suggested on the HP support site, finally it entered a loop where at random every 20 seconds or so was shutting itself on and off and finally decided that "it was time to shut off for good or such" ..
This is the second monitor so far I've seen going totally bezerk with OSDs and such ... no the cables are brand new so the PC I cannot believe there's any problem in the cables.
I just removed it and threw it in another room I think my progress on shaders stuff today will be with one single monitor ( and lot of switching between one input and the other ) I see a stream of more swearwords coming ( until I'll get a new one ) ..
If I would be super rich I'd sue Welsh Power, don't know what the fuck they have around here but power here is ALL but stable and quite often has VEEEEERY WEEEIRD things going on in totally unexpected moments.
The weirdest of all all that stuff seems NOT to happen when the weather is shit, or when it rains or when it's wind or whatever .. no at the contrary seems to happen when "weather could be not better than this" ( for Wales ) .
Giles the billy goat
"Baa"
"Baa"
Re: Llamasoft does TxK for Sony Vita
The trade I'm making is pixel shader ALU cycles for a big decrease in overdraw into the main buffer. Currently lines are overdrawn and I know that lack of fill rate can be a killer on mobile. There's no texture read either.gilesgoat wrote:Yes but that's fundamentally computing a per-pixel distance from a line inside a PS.
Sure it's faster/less consumption that doing triangles ?
I'm pretty sure it's going to be a good speed up for mobile compared to the current way of doing things and probably faster than using a GS. If you've massive fill rate the equation ends up being different.
We'll see
Re: Llamasoft does TxK for Sony Vita
The geometry shader is a bit of a hack. It's a tool for doing things that can't be efficiently done any other way, but if there is a non-GS using algorithm it will often be faster to do it that way.
It depends on which bottleneck you're hitting, but I wouldn't be surprised if the PS is the faster route in some / most cases.
It depends on which bottleneck you're hitting, but I wouldn't be surprised if the PS is the faster route in some / most cases.
Re: Llamasoft does TxK for Sony Vita
Just found this interesting response to a question about GeoShaders efficiency.
http://gamedev.stackexchange.com/questi ... am-so-much
Didn't even think about the impact a GS would have on optimisation choices for the rest of the pipeline.
http://gamedev.stackexchange.com/questi ... am-so-much
Didn't even think about the impact a GS would have on optimisation choices for the rest of the pipeline.
Re: Llamasoft does TxK for Sony Vita
He says better what I said above:
"Here is a basic rule of thumb about GS's: never use a GS because you think it will make rendering faster. You should use it when it makes what you're trying to do possible. If what you're trying to do is an optimization, use something else."
"Here is a basic rule of thumb about GS's: never use a GS because you think it will make rendering faster. You should use it when it makes what you're trying to do possible. If what you're trying to do is an optimization, use something else."
- gilesgoat
- Sheepie Whore

- Posts: 27259
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Llamasoft does TxK for Sony Vita
@DIODio wrote:He says better what I said above:
"Here is a basic rule of thumb about GS's: never use a GS because you think it will make rendering faster. You should use it when it makes what you're trying to do possible. If what you're trying to do is an optimization, use something else."
<angry coder rant>
WTF (*&$(*&@# someone then is WASTING time ( and money ) into R & D of graphic cards to implement a thing like GS then ?
One thinks that "finally, we can do some things GPU side ( possibly all inside 'GPU space' ) instead of doing them CPU side and such should be nicer & faster "
And then after one :
1. wasted time to understand how those things works
2. wasted time to make them work
3. wasted time dealing (swearing) with certain-things-I-cannot-talk-here for 2
And then you hear something like "it's a hack" and "you should never use it if you think it's going to be faster".
REALLY if I could I'd be coming to whoever invented/spent time to invent that thing and I'd personally would give it lots of kicks in the arse
Is it been the "ingenious invention" of some "commercial guy" that say "let's do this let's sell it as the new best thing ?".
Finally one thinks "he may be free of some dirty tricks" done with shaders and things to supply "the missing" of certain things and now that finally are it's like "no but actually don't use them ..".
What's the fucking point in inventing things that one should NOT use .. "of course everything could be done GPU side and fill buffers and render this end of the story".
Now tell me now that "the other shaders" are a hack too and that tasselation should not be used and stuff like that and then we'll be "perfect".
NGH!
<angry coder rant>
Giles the billy goat
"Baa"
"Baa"
Re: Llamasoft does TxK for Sony Vita
I think it came from the software side first, MS specced it out I think.gilesgoat wrote:@DIODio wrote:He says better what I said above:
"Here is a basic rule of thumb about GS's: never use a GS because you think it will make rendering faster. You should use it when it makes what you're trying to do possible. If what you're trying to do is an optimization, use something else."
<angry coder rant>
WTF (*&$(*&@# someone then is WASTING time ( and money ) into R & D of graphic cards to implement a thing like GS then ?
Re: Llamasoft does TxK for Sony Vita
Tess does tend to hit the same rule - but it's hard to do what tess can do with alternative algorithms. That means that it's more useful and that also means there's been more effort put into optimising it.gilesgoat wrote:Now tell me now that "the other shaders" are a hack too and that tasselation should not be used and stuff like that and then we'll be "perfect".
Some of those optimisations (notably, increased buffering between the geometry-generating front ends and the rasteriser) have also helped the GS, but there is a lot of legacy hardware out there which has relatively poor GS performance.
GS isn't really the kind of idea we'd have generated out of hardware. It's not a very hardware-friendly way of thinking of things. It's for similar reasons that point sprites have had highly variable levels of hardware support in the past.
- gilesgoat
- Sheepie Whore

- Posts: 27259
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Llamasoft does TxK for Sony Vita
I don't give a thing in this moment at legacy HW .. tell me instead how goes on PS4 ...Dio wrote:Tess does tend to hit the same rule - but it's hard to do what tess can do with alternative algorithms. That means that it's more useful and that also means there's been more effort put into optimising it.gilesgoat wrote:Now tell me now that "the other shaders" are a hack too and that tasselation should not be used and stuff like that and then we'll be "perfect".
Some of those optimisations (notably, increased buffering between the geometry-generating front ends and the rasteriser) have also helped the GS, but there is a lot of legacy hardware out there which has relatively poor GS performance.
GS isn't really the kind of idea we'd have generated out of hardware. It's not a very hardware-friendly way of thinking of things. It's for similar reasons that point sprites have had highly variable levels of hardware support in the past.
Giles the billy goat
"Baa"
"Baa"
Re: Llamasoft does TxK for Sony Vita
Instancing would be faster 
But to be honest if it already works then leave it. That machine's got enough power where it just doesn't matter if things aren't done the most efficient way.
But to be honest if it already works then leave it. That machine's got enough power where it just doesn't matter if things aren't done the most efficient way.
Re: Llamasoft does TxK for Sony Vita
Simple question is if you're front or back end limited. If you're geometry limited GS will make it worse. If you're pixel limited GS may help.
You should be able to measure that with the perf counters (assuming there's a dev kit that exposes them and someone has worked out the right sacrifice to the counter gods).
But as Gary says no point in optimising unless you know it helps. Wouldn't have thought anything coming off a Vita would have the slightest issue on a PS4, the CPU/GPUs have about twenty times the watts to work with.
You should be able to measure that with the perf counters (assuming there's a dev kit that exposes them and someone has worked out the right sacrifice to the counter gods).
But as Gary says no point in optimising unless you know it helps. Wouldn't have thought anything coming off a Vita would have the slightest issue on a PS4, the CPU/GPUs have about twenty times the watts to work with.