Commit graph

364 commits

Author SHA1 Message Date
Anthony Ramine
dac7740b8c Reuse input buffer for RGB/UNSIGNED_BYTE in rgba8_image_to_tex_image_data 2018-09-10 14:13:23 +02:00
Anthony Ramine
e1486f7d71 Reuse input vector for LUMINANCE_ALPHA/HALF_FLOAT 2018-09-10 12:43:38 +02:00
Anthony Ramine
7e7441749b Fix the remaining LUMINANCE* cases in rgba8_image_to_tex_image_data 2018-09-10 12:41:57 +02:00
Anthony Ramine
6d3609dbe8 Fix the UNSIGNED_SHORT_4_4_4_4 case of premultiply_pixels 2018-09-09 12:22:01 +02:00
Anthony Ramine
d8b7394fa3 Fix the UNSIGNED_SHORT_5_5_5_1 case of premultiply_pixels 2018-09-09 12:21:56 +02:00
Anthony Ramine
f726f18291 Remove some useless argument mutability
I wonder why this doesn't trigger a warning.
2018-09-09 12:21:55 +02:00
Anthony Ramine
e61c7b757f Fix the LUMINANCE of rgba8_image_to_tex_image_data
The internal format and format values match, thus the canvas or image input
must be interpreted as already in LUMINANCE format.
2018-09-09 12:21:54 +02:00
Anthony Ramine
9a362391d5 Fix the LUMINANCE_ALPHA case of rgba8_image_to_tex_image_data
The internal format and format values match, thus the canvas or image input
must be interpreted as already in LUMINANCE_ALPHA format.
2018-09-09 12:21:54 +02:00
Anthony Ramine
74e6f40abe Reuse the input vector in more cases of rgba8_image_to_tex_image_data 2018-09-08 18:21:45 +02:00
Anthony Ramine
6a692228fc Fix the ALPHA/FLOAT case of rgba8_image_to_tex_image_data
I'm pretty sure this is supposed to write the ALPHA component.
2018-09-08 18:06:51 +02:00
Anthony Ramine
e192e4d97f Reuse input of rgba8_image_to_tex_image_data in some cases 2018-09-08 13:42:07 +02:00
Anthony Ramine
27951bb7c8 Make rgba8_image_to_tex_image_data not overallocate in some case 2018-09-08 13:42:07 +02:00
Anthony Ramine
145086e150 Make rgba8_image_to_tex_image_data a free-standing function 2018-09-08 13:42:06 +02:00
Anthony Ramine
a5f9d03229 Make remove_premultiplied_alpha mutate its input 2018-09-08 13:42:06 +02:00
Anthony Ramine
1864edbb36 Make premultiply_pixels mutate its input 2018-09-08 13:42:06 +02:00
Anthony Ramine
4bd8efa49e Use byte channels to send textures to the WebGL thread 2018-09-08 13:42:06 +02:00
Anthony Ramine
408e540c55 Use ipc::bytes_channel in ReadPixels 2018-09-08 13:42:06 +02:00
Anthony Ramine
4e9281dcbf Simplify WebGLRenderingContext::get_image_data 2018-09-08 13:42:06 +02:00
Anthony Ramine
9f924013bc Use a bytes channel in BufferData
This means we don't need to copy the input ArrayBuffer at all on the DOM side.
2018-09-07 11:28:59 +02:00
Anthony Ramine
1293692ef8 Simplify WebGLBuffer::buffer_data
There is no need to pass the target to that buffer method, given the buffer
has been retrieved by looking up the one bound to that target in the context.
2018-09-07 11:28:11 +02:00
Anthony Ramine
5a206d5137 Make validate_framebuffer return a WebGLResult<()> 2018-09-06 11:25:22 +02:00
Anthony Ramine
0579fbe4fa Use WebGLResult for returns of instanced draw methods 2018-09-06 10:41:58 +02:00
Anthony Ramine
900a19058e Support unions of objects in overloads
Part of #20513, implementing the parts useful for WebGL.
2018-08-30 16:15:40 +02:00
Anthony Ramine
4cf944eab8 Fix gl.isBuffer for buffers that are marked for deletion but still attached 2018-08-30 16:15:39 +02:00
Anthony Ramine
7b673de4d6 Always emit INVALID_OPERATION on null element buffers in drawElements 2018-08-30 16:15:39 +02:00
Anthony Ramine
0ba66f9f12 Fix the error for invalid arrays passed to gl.vertexAttrib*v() 2018-08-30 16:15:38 +02:00
Simon Sapin
1333b6ee45 Fix the build for NLL
Test with `RUSTFLAGS="-Zborrowck=mir -Ztwo-phase-borrows" cargo build`

https://internals.rust-lang.org/t/help-us-get-non-lexical-lifetimes-nll-over-the-finish-line/7807/7
2018-08-24 17:49:58 +02:00
Anthony Ramine
8b1c753c6c Properly check limit in gl.activeTexture() 2018-08-23 15:15:33 +02:00
Josh Matthews
7c32ad7c3d Revert "Fix the build for NLL"
This reverts commit d1733aa502.
2018-08-07 20:24:55 -04:00
Simon Sapin
d1733aa502 Fix the build for NLL
Test with `RUSTFLAGS="-Zborrowck=mir -Ztwo-phase-borrows" cargo build`

https://internals.rust-lang.org/t/help-us-get-non-lexical-lifetimes-nll-over-the-finish-line/7807/7
2018-08-08 00:09:56 +02:00
Anthony Ramine
04c81c5cc3 Merge code from Draw* and Draw*Instanced methods
This made me realise we weren't supporting OES_element_index_uint in the
ANGLE_instanced_arrays extension.
2018-08-02 22:54:39 +02:00
bors-servo
c5aaae7333
Auto merge of #21324 - servo:webgl, r=emilio
Properly set initial values for WebGL texture filters

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21324)
<!-- Reviewable:end -->
2018-08-02 12:08:12 -04:00
Anthony Ramine
f7124886bc Use the DOM cache for gl.getTexParameter(gl.TEXTURE_*_FILTER)
Part of #20596.
2018-08-02 18:06:58 +02:00
bors-servo
bde8a1e239
Auto merge of #21313 - jdm:glstuff, r=nox
Framebuffer and renderbuffer fixes

This commits address two separate panics that occur when running the framebuffer-object-attachment.html test. The test still panics due to another framebuffer completion status problem, so the overall test results don't demonstrate any improvement.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21252
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21313)
<!-- Reviewable:end -->
2018-08-02 09:26:35 -04:00
Anthony Ramine
fba6d801a1 Always use a WebGLVertexArrayObject to handle vertex attribs
This lets us clean up how buffers are reference-counted.
2018-08-02 12:46:19 +02:00
Josh Matthews
03eb7e4dd2 webgl: Emulate some renderbuffer formats in non-GLES. 2018-08-02 02:05:53 -04:00
Anthony Ramine
15d1215949 Properly check for context ownership of objects passed to gl.is*() 2018-07-31 11:12:45 +02:00
Anthony Ramine
76f23f7d78 Simplify gl.getShaderParameter() (fixes #20562)
The expectation change is due to the shader now using its DOM-side compile status.
It is actually a bug for the shader to think it actually compiled successfully,
but at least it does so consistently now.
2018-07-31 11:12:45 +02:00
Anthony Ramine
a0fc4c9832 Fix program and shader lifetime cycle 2018-07-31 11:12:40 +02:00
Anthony Ramine
5a9ad01145 Cache which capabilities are enabled in the context (fixes #20534)
This is needed for #20555.
2018-07-25 19:58:02 +02:00
Anthony Ramine
3179ed59c5 Properly check for GL object ownership (fixes #21133) 2018-07-24 15:05:35 +02:00
Anthony Ramine
661e258b28 Store a reference to the WebGLRenderingContext in WebGLObject 2018-07-24 13:27:33 +02:00
Anthony Ramine
b64232d77b Invalidate all WebGLUniformLocation values on program relink 2018-07-19 11:34:04 +02:00
Anthony Ramine
3e8c2d659a Implement gl.getUniform() 2018-07-18 21:37:41 +02:00
Anthony Ramine
476640c3ab Use active uniforms data to implement gl.uniform* checks 2018-07-17 01:26:44 +02:00
Anthony Ramine
cbac5d05be Store active uniforms on the DOM side 2018-07-16 10:16:29 +02:00
Anthony Ramine
ef7d495838 Properly implement the checks for gl.renderbufferStorage (fixes #20563) 2018-07-09 15:27:51 +02:00
Anthony Ramine
4e6eea221a Implement instanced WebGL drawing calls (part of #20791) 2018-07-08 10:44:45 +02:00
Anthony Ramine
0aefffc5bf Correctly implement the vertex buffer checks in drawArrays
This is half of #20599. The check for drawElements is a bit more complex
to implement.
2018-07-08 10:44:45 +02:00
Anthony Ramine
f0ca100e87 Return an empty typed array from gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS) 2018-07-08 10:44:42 +02:00