Graphics

Reply

Level 1

Level 1
Barkley13031981
Posts: 7
Registered: ‎02-06-2012
Message 1 of 8 (306 Views)

Bug with VertexBuffer

Hi all,

 

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.

 

Cheers,

Barkley

Please use plain text.

Re: Bug with VertexBuffer

Hi :

 

Did you mean that you change the vertexs inside the VertexBuffer and this make wrong behavior? sorry to ask.

 

Cheers

Please use plain text.

Level 1

Level 1
Barkley13031981
Posts: 7
Registered: ‎02-06-2012
Message 3 of 8 (289 Views)

Re: Bug with VertexBuffer

No, not that.

 

I mean something like this:

 

VertexBuffer vb;

 

public void Init()

{

...;

vb = new VertexBuffer(1024, 2048, vertexFormat);

}

 

public void Render()

{

vb.SetVertices(vertArray1);

vb.SetIndices(indArray1);

 

graphicsContext.SetVertexBuffer(0, vb);

graphicsContext.DrawArrays(DrawMode.Triangles, 0, numValidIndexes1);

 

 

vb.SetVertices(vertArray2);

vb.SetIndices(indArray2);

 

graphicsContext.SetVertexBuffer(0, vb);

graphicsContext.DrawArrays(DrawMode.Triangles, 0, numValidIndexes2);

}

 

That's generating some glitches to me in the Vita but it works just fine in the emulator.

 

Thanks,

Barkley

Please use plain text.

Re: Bug with VertexBuffer

Hi =D

 

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.

 

Cheers,

Please use plain text.

Level 1

Level 1
Barkley13031981
Posts: 7
Registered: ‎02-06-2012
Message 5 of 8 (258 Views)

Re: Bug with VertexBuffer

Hi Alex

 

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.

 

Cheers,

Barkley

Please use plain text.

Re: Bug with VertexBuffer

Hi =):

 

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.

 

 

Cheers,

Alex

Please use plain text.

Re: Bug with VertexBuffer

Hi Barkley13031981,

 

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.

 

Kind Regards

M

PlayStation®Mobile Dev Team
I am like you, I have no name.
Please use plain text.

Level 1

Level 1
Barkley13031981
Posts: 7
Registered: ‎02-06-2012
Message 8 of 8 (196 Views)

Re: Bug with VertexBuffer

Hi M,

 

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.

 

Best regards,

Barkley

Please use plain text.
Announcements

Welcome to the PlayStation Mobile Developer Forums


This is a community for the discussion of technical topics with other developers and SCE engineers. Posting ideas/requests are also appreciated. Join the discussion!

PlayStation®Mobile開発者フォーラムでは世界中の開発者の皆様と一緒に、議論や情報交換が可能です。SCEも議論に参加し、皆様の開発をサポートします。アイデアやリクエストも大歓迎です。ぜひご参加ください。

PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.

フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと PSM DevPortalを一度ログアウトし、再度ログインしてください。