Commit Graph

184 Commits

Author SHA1 Message Date
Benoit Jacob
ddfb4b1926 Bug 705904 - [5/6] - Kill nsRefPtrHashtables of WebGL objects, allow unreferenced objects to be freed, fix about:memory reporting of deleted objects - r=jgilbert
This patch takes care of WebGLRenderbuffer.
2011-12-04 14:15:43 -05:00
Benoit Jacob
3b06741971 Bug 705904 - [4/6] - Kill nsRefPtrHashtables of WebGL objects, allow unreferenced objects to be freed, fix about:memory reporting of deleted objects - r=jgilbert
This patch takes care of WebGLShader.
2011-12-04 14:15:43 -05:00
Benoit Jacob
ecba738742 Bug 705904 - [3/6] - Kill nsRefPtrHashtables of WebGL objects, allow unreferenced objects to be freed, fix about:memory reporting of deleted objects - r=jgilbert
This patch takes care of WebGLProgram.
2011-12-04 14:15:43 -05:00
Benoit Jacob
eebc9f9fb7 Bug 705904 - [2/6] - Kill nsRefPtrHashtables of WebGL objects, allow unreferenced objects to be freed, fix about:memory reporting of deleted objects - r=jgilbert
This patch takes care of WebGLBuffer.
2011-12-04 14:15:43 -05:00
Benoit Jacob
93f7c9fc64 Bug 705904 - [1/6] - Kill nsRefPtrHashtables of WebGL objects, allow unreferenced objects to be freed, fix about:memory reporting of deleted objects - r=jgilbert
This patch takes care of WebGLTexture, and introduces the WebGLFastArray helper (see comment).
2011-12-04 14:15:43 -05:00
Benoit Jacob
a4fe602cb3 Bug 704839 - [9/9] - Refactor mutual ownership of WebGL objects - r=jgilbert
This patch removes the old helper classes which we no longer use.
2011-12-04 14:15:43 -05:00
Benoit Jacob
4d9c6c8d26 Bug 704839 - [8/9] - Refactor mutual ownership of WebGL objects - r=jgilbert
This patch moves WebGLVertexAttribData further down in the file, where it belongs.
2011-12-04 14:15:43 -05:00
Benoit Jacob
1fe593ea97 Bug 704839 - [7/9] - Refactor mutual ownership of WebGL objects - r=jgilbert
This patch fixes framebuffer attachment deletion.
2011-12-04 14:15:43 -05:00
Benoit Jacob
c84135ec38 Bug 704839 - [4/9] - Refactor mutual ownership of WebGL objects - r=jgilbert
This patch switches to the new mutual ownership pattern for WebGL objects, based on maintaining a second WebGL-specific refcount mirroring the OpenGL refcount which we can't access, using the helper classes that were introduced in patches 1 and 2.
2011-12-04 14:15:42 -05:00
Benoit Jacob
f8faf98502 Bug 704839 - [3/9] - Refactor mutual ownership of WebGL objects - r=jgilbert
This patch renames GLuint mName to mGLName for consistency.
2011-12-04 14:15:42 -05:00
Benoit Jacob
8e6fa3fd66 Bug 704839 - [2/9] - Refactor mutual ownership of WebGL objects - r=jgilbert
This patch implements the WebGLRefPtr class, which is how WebGL objects can hold strong references to each other that work in the same way as the references held by the underlying OpenGL objects, i.e. that will be immediately destroyed even by explicit delete calls.
2011-12-04 14:15:42 -05:00
Benoit Jacob
f83af6a077 Bug 704839 - [1/9] - Refactor mutual ownership of WebGL objects - r=jgilbert
This patch implements WebGLRefCountedObject, a base class for WebGL objects that implements a "WebGL refcount" mirroring the OpenGL refcount, separate from the XPCOM refcount. It collaborates with the WebGLRefPtr class introduced in patch 2.
2011-12-04 14:15:42 -05:00
Benoit Jacob
2712ccf837 Bug 705673 - remove stale mUniformTextures - no review
According to legends, there are still mUniformTextures in caves going down to the center of Earth.
2011-12-04 14:15:42 -05:00
Benoit Jacob
1bb06ab264 Bug 705668 - Remove IIDs on WebGL implementation classes - r=ehsan
These IIDs were used in the past to check, using do_QueryInterface, that the objects passed to WebGL functions were really of the expected type. Now that WebGL classes are marked 'builtinclass' in the IDL and that check has been removed (see bug 638328), none of that is needed anymore.
2011-12-04 14:15:42 -05:00
Doug Sherk
a9cd727f00 Bug 660070: catch EGL_CONTEXT_LOST and send WebGL an event for it r=bjacob
Catches the EGL_CONTEXT_LOST error which occurs after driver resets, and sends a
WebGL context the canvas event webglcontextlost when this occurs.
2011-12-02 23:52:35 -08:00
Benoit Jacob
4cd22aea90 Bug 705663 - Fix braindead WebGLTexture::HasImageInfoAt - r=jrmuizel 2011-11-28 14:30:28 -05:00
Doug Sherk
ae918111a2 Bug 656824: changed WebGL robustness timer to not get reset after each draw operation r=bjacob
This patch should improve performance of the robustness timer by not resetting
it each time a draw operation happens. It still checks if there's any activity
and, if not, it will stop firing it. It includes a single extra timer firing
after activity dies to make sure we don't miss anything. Also includes a fix for
robustness being marked as existing when it really isn't.
2011-11-18 22:57:29 -05:00
Benoit Jacob
163b4e0b37 Bug 699516 - Rename WEBKIT_lose_context to WEBGL_EXT_lose_context - r=dsherk
See today's discussion on public_webgl list. WEBGL_EXT_lose_context will be officially created in a few days.
2011-11-03 20:29:57 -04:00
Doug Sherk
504f8b7886 Bug 682496 - fixed program-test.html test failures - r=bjacob
Fixed programs and shaders so that when they're marked for deletion and then detached completely, are deleted.
2011-11-03 10:50:40 -04:00
Jeff Gilbert
5b4030b08d Bug 697560 - Generate WebGL errors in readPixels according to spec - r=bjacob
* * *
Bug 697560 - Disallow conformance failures on read-pixels-test - r=bjacob
2011-10-31 16:55:01 -07:00
Benoit Jacob
0618beb3c4 Bug 677543 - Not clearing WebGL framebuffer in teapot demo - r=jgilbert
We are supposed to clear the WebGL framebuffer after it's been presented to the compositor and before the next draw operation, and were using the wrong way to know when we got composited. The right way is DidTransactionCallback.
2011-10-31 17:14:12 -04:00
Marco Bonardo
ddb3e139c0 Backout d9da4de6579c (Bug 682496) for M1 leaks. 2011-10-27 00:13:39 +02:00
Doug Sherk
1c15893d0b Bug 656824: Implemented ARB_robustness to detect driver resets in WebGL, only on GLX for now - r=bjacob
This patch implements ARB_robustness on GLX and allows scripts to handle driver resets
through events. The changes in this patch are very sweeping; they hit almost
every NS_IMETHODIMP function within WebGLContextGL.cpp and WebGLContext.cpp.
More work must be done on this to support EGL_CONTEXT_LOST.
2011-10-26 16:00:44 -04:00
Doug Sherk
46fabc604a Bug 682496: fixed program-test.html test failures
Fixed programs and shaders so that when they're marked for deletion and then detached completely, are deleted.
2011-10-26 16:00:44 -04:00
Jeff Gilbert
445287a1f5 Bug 615976 - Fix WebGL to default to trying to have anti-aliasing - r=bjacob 2011-10-19 15:09:57 -04:00
Benoit Jacob
99bb756bd6 Back out Jeff's patches because they lack a Bug number and/or a r= field. Sorry, should have checked that. Re-landing. 2011-10-19 15:31:33 -04:00
Jeff Gilbert
6c395a3be5 Fix WebGL to default to trying to have anti-aliasing 2011-10-19 15:09:57 -04:00
Ehsan Akhgari
2a602a5685 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Landing on a CLOSED TREE
2011-10-17 10:59:28 -04:00
Benoit Jacob
6831dd8707 Bug 638328 - fix bug in assertion, bad usage of queryinterface - r=roc
do_QueryInterface itself doesn't assign to the nsresult, have to assign to a nsCOMPtr
2011-10-14 10:01:15 -04:00
Benoit Jacob
a9b2e70434 Bug 638328 - use builtinclass and remove do_QueryInterface - r=peterv 2011-10-13 08:09:22 -04:00
Christoph Diehl
3fcd8718cf Bug 686732 - Implement minimal-capabilities WebGL mode - r=bjacob 2011-10-13 08:09:22 -04:00
Benoit Jacob
3b0d019742 Bug 522193 - WebGL calls are slow because of memory allocation churning - r=roc
WebGL objects keep an array of refptrs of other WebGL objects owning references to them. In practical cases, the size of this array can oscillate between 0 and 2 at high frequency. nsTArray throws away its whole storage (mHdr) when its size hits 0. This patch makes us use a nsAutoTArray with a pre-allocated size of 2 or 8 depending on WebGL object types.
2011-10-03 08:41:56 -04:00
Doug Sherk
5b5702d6a4 Bug 684853: implement OES_standard_derivatives
Implemented OES_standard_derivatives and fallbacks if it isn't available. Exposes dFdx, dFdy, and fwidth functions to WebGL scripts.
2011-10-01 00:45:50 -04:00
Benoit Jacob
b79d3d9d20 Bug 684882 - back out db67bdba5ca8 2011-09-29 10:13:49 -04:00
Benoit Jacob
50ebdccf9f Bug 684882 - back out b4fd4fd0dc3f 2011-09-29 10:13:49 -04:00
Michael Wu
d8e503c38b Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
--HG--
rename : tools/trace-malloc/bloatblame.c => tools/trace-malloc/bloatblame.cpp
2011-09-28 23:19:26 -07:00
Benoit Jacob
e0690707cd Bug 684882 - Random video memory grabbed into WebGL cube map textures on Mac OS, including on 10.7.1, on Intel GPUs - r=jrmuizel
This patch does 3 things on Macs with Intel GPUs:
 * prevents attaching a cube map to a framebuffer.
     Test case: http://codeflow.org/webgl/irradiance/
 * skips glGenerateMipmaps on cube maps
 * since cube maps are now missing their mipmaps, prevents setting on them a minification filter that requires a mipmap, but only from OpenGL's point of view, not from WebGL's.
2011-09-23 20:29:40 -04:00
Benoit Jacob
b26a2af7ce Bug 685793 - WebGL buffer overflow issue and access to out of range memory - r=jrmuizel
We were not checking for integer overflow in a required-buffer-size computation. Fixing this by using CheckedInt.
2011-09-22 02:55:10 -04:00
Justin Wood
f90fd5539e m-c -> m-i merge 2011-09-09 22:04:09 -04:00
Benoit Jacob
247aca9d4a Bug 684882 - work around a glGenerateMipmap bug on Mac - r=jrmuizel 2011-09-09 18:00:20 -04:00
Benoit Jacob
7a24dd63e2 Bug 682335 - crash [@ WebGLContext::BufferSubData_array] - r=jrmuizel 2011-09-09 18:00:20 -04:00
Doug Sherk
f9a5610153 Bug 683710: added stripping of comments from shader sources before compiling and check for illegal characters, mostly from webkit code r=bjacob
This code is copied mostly from WebKit. It strips out comments from shader source code before actually compiling it, so that the comments can have illegal characters. It was benchmarked and it was noted that a test attached to the bug ticket took about twice as long with these changes.

This includes the patch from bug 680722 to check for illegal characters.
2011-09-07 17:17:44 -04:00
Phil Ringnalda
946b02e238 Back out d333f4021aaf, 5e90688c720e and bdb0bff93ce8 for Windows build redness 2011-09-07 15:20:26 -07:00
Doug Sherk
73534e1d22 Bug 683710: added stripping of comments from shader sources before compiling and check for illegal characters, mostly from webkit code r=bjacob
This code is copied mostly from WebKit. It strips out comments from shader source code before actually compiling it, so that the comments can have illegal characters. It was benchmarked and it was noted that a test attached to the bug ticket took about twice as long with these changes.

This includes the patch from bug 680722 to check for illegal characters.
2011-09-07 17:17:44 -04:00
Benoit Jacob
d36cfc4ea7 back out 1b09c80c46c3 (bug 680722, WebGL shader validation) because of regression, see bug 684312 and 683710 2011-09-02 15:43:03 -04:00
Doug Sherk
ffb5ce184d Bug 682172: fixed tex2DImage WebGL function, which was rejecting 0-size textures and doing an incorrect validation - r=bjacob
There was actually some surrounding logic breaking 0-size textures. It was because there was code that basically checked "did uint=negative_num*other_vars overflow". For incorrect validation, two copies of the same variable (one stored internally and one passed in) were available to the function, but the one stored internally was being validated, while the version passed in wasn't. The fix for this was simply checking the passed var instead.
2011-09-01 15:28:34 -04:00
Doug Sherk
e3fe16b123 Bug 680722: added invalid character checks to WebGL functions r=bjacob 2011-08-25 14:27:52 -04:00
Benoit Jacob
b097dfda2f Bug 669013 - Despite supporting OES_texture_float, getSupportedExtensions still returns no extensions - r=joe 2011-08-15 15:53:02 -04:00
Benoit Jacob
6a1b59abd3 Bug 638549 - fix leak of WebGL about:memory reporters - r=jrmuizel
See bug 638549 comment 25. We had to ref-count these pointers.
2011-08-10 18:25:23 -04:00
Benoit Jacob
2bc65bec27 Bug 674042 - WebGL: crash in getUniformLocation with too long uniform identifiers - r=jrmuizel
This limits the length of uniform and attrib identifiers to 4095 characters, to steer clear GL implementation bugs with too long identifiers. The 4095 is totally arbitrary, all we know is that crashes happen after 2^22 chars.
2011-07-28 17:12:31 -04:00