Re: [godot-devel] Help debug the WebGL2 code!

[ Thread Index | Date Index | More godotengine.org/devel Archives ]


On 2017-02-23 7:28 AM, Rémi Verschelde wrote:
If anyone can help Juan :D

---------- Forwarded message ----------
From: Juan Linietsky <reduzio@xxxxxxxxx>
Date: 2017-02-23 0:31 GMT+01:00
Subject: help with webgl2!
To: Rémi Verschelde <rverschelde@xxxxxxxxx>



If you read this message it means i'll be on a plane until Friday! I
still haven't got WebGL to work, am super close though.

The last error i'm gettnig is related to the size of Uniform Buffer
Objects, I have no idea how to tell which one is not working, but I
would really appreciate if you or anyone you can ask on irc can do the
folowing



1) Get this test project

https://www.dropbox.com/s/ay88qrktxh24bjc/test.zip?dl=0

2) Run http server on it:

python -m SimpleHTTPServe

3) Get Firefox and build it from source to run this :D

the error will be:

Error: WebGL: drawElementsInstanced: Buffer for uniform block is
smaller than UNIFORM_BLOCK_DATA_SIZE.

A dozen of UBOs are being used, all seem fine in code, so I have no
idea which one is wrong (error could be more helpful..), so..

4) Find in the firefox source code where this error is printed, and
change it to obtain the following information:

-Which uniform block binding point # is this error about (there can be
up to 16 i think)
-What size was being bound, and which size is expected

5) Let me know the result :D


Cheers and Thanks!

Juan

Managed to get Firefox building on my Windows machine, here's the log: http://pastebin.com/rRAi4aD9

'mDataSize' is the actual size, 'ByteCount' is the maximum available size.

'mIndexedUniformBufferBindings index' is the index of the failing uniform block's binding in a vector called mIndexedUniformBufferBindings (a member of WebGLContext). Is that what you're looking for? 'mIndexedUniformBufferBindings size' is the size of that vector. It's 24 rather than 16.

'uniformBlock index' is the index of the failing uniformBlock in a vector called uniformBlocks (a member of LinkedProgramInfo). Seems useless.
'uniformBlocks size' is the size of that vector.

I also included some other data that was easily accessible, maybe it's of some use.

If I'm reading this right:
WebGL first fails with drawElements in binding #7 once, with a block data size of 65520, far above the size available in the buffer, 1296. Then a bunch of failures with drawElementsInstanced in binding #4, which supposedly has a max size of 0.

Here's the relevant Firefox code:
https://hg.mozilla.org/mozilla-central/file/22ec1dab9e82/dom/canvas/WebGLContextDraw.cpp#l361
If you need some other data printed, let me know.
Even incremental builds can take 2 hours though, don't remember it being this bad on FreeBSD.

Have a good trip!



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/