on 05-06-2012 03:10 PM
I think I'm seeing a bug with the vertex buffers. If you try to reuse the same vertex buffer with the same texture, shader, parameters, etc., but different vertices and indices, you get some glitchees in the PS Vita (but not in the simulator).
I'll try to get a program to reproduce that concrete bug so that I can clearly isolate it, but I'd appreciate it if anyone could confirm it's not an already known bug or something.
on 06-06-2012 07:23 AM
No, not that.
I mean something like this:
public void Init()
vb = new VertexBuffer(1024, 2048, vertexFormat);
public void Render()
graphicsContext.DrawArrays(DrawMode.Triangles, 0, numValidIndexes1);
graphicsContext.DrawArrays(DrawMode.Triangles, 0, numValidIndexes2);
That's generating some glitches to me in the Vita but it works just fine in the emulator.
on 06-06-2012 01:58 PM
Thanks for the reply now I understand but I think that this could be wrong, why? because opengl ES don't use glMapBuffer and probably is never copy complete before the next call of the renderer and thats why in vita is not working. They didn't say that the emulator is exactly the same as the vita =C.
on 07-06-2012 08:04 AM
Thanks for the answer! Yeah, I supposed the problem went around these lines.
Anyway, even if it does work in the emulator, that's not what bothers me. I think it's not ok to present an interface with an apparently valid operation (what I described before) and then simply don't work given an InternalErrorException.
What I'd like is that Sony either fixes it or documents it, alongside with best practices on how to work around the issue.
This is all happening to me in a batch rendering class I have. I don't like to do news in the game loop, it's highly recommended not to 'leak' memory like that. So I set a buffer, normally big enough to render everything, but if it fills up I just flush everything and start again using the same buffer. I could opt to resize the buffer everytime I need to. Anyway I'm not sure that's the best option or what's the maximum size the buffer may have (4K verts? 32K? does it depend on the platform?).
On the other hand I could have an array of buffers so that when one fills I use the next one. I tried that with 2 buffers and if I reduce the buffer size a lot (256 verts) so that they repeat several times the glitches appear again. That probably means that internally it's using several vertex buffer units and these units may get to bo overwritten.
So anyway, I think this is a bug, if for nothing else, because of the lack of documentation. I'd like Sony to either document best practices on the subject or fix the bug. I understand fixing it may not be easy due to architecture decisions, but I believe that documentation should be feasible. In the meantime I can easily work around it increasing the size and number of buffers I use.
on 07-06-2012 02:58 PM
Good!. Well I guess the best you can do now it's to add this issue in suggestion/recommendation part of the forum if you think so my be some one of th guys liek James can answer or try find out why this happening on Vita.
on 08-06-2012 02:57 PM
Thank you for reporting the issue and for the detailed feedback. There are a number of problems that may arise when we are dealing with multiple graphics hardware. The most common hypothesis in this particular case would be that it is being caused by a restriction on the PS Vita which is documented in the release notes as “GraphicsContext.SetVertexBuffer() applies only the first VertexBuffer “ . You will find this note in the PlayStation Suite SDK Documentation under > Related Pages>Other Information>Release Notes> Graphics. What this means is that your second call for setting the vertices and indices may have been ignored on the PS Vita and caused problems.
Additionally it would be great if you could provide a description or possibly an image of the ‘glitches’ that you have mentioned i.e. what exactly happens on the screen. If you would require us to have a more detailed look please feel free to post your source code or private message it to me directly, as you see fit.
on 09-06-2012 07:44 AM
Thanks for the answer! I'll try to get you all the info before the end of the weekend.
I had read that description in the SDK release notes, but I thought that if you assigned the vertex buffers to the same index that wouldn't apply. I'm always using SetVertexBuffer(0, vb).
I understand you're dealing with a lot of different devices with potentially very different hardware and this is a beta version. So I understand this is the sort of things this beta version is for: for us to identify some bugs that you may or may not have already identified, and then you get the chance to fix them. So thanks again for taking a look at it.
I'll do my best to give you enough and comprehensive info on the subject ASAP.
Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]