Commit Graph
93 Commits
Author SHA1 Message Date
Jamie Madill fd3dd436e5 WebGL: Add 3D tex copying feedback loop detection.
When copying to and from the same texture, we need to reject only
the feedback loops formed with the same levels of the texture -
copying between different unrelated layers and levels is fine.

This change also fixes a couple bugs in our D3D11 CopyTexSubImage3D
implementation. We were missing some "!" operators, and we actually
would hit an ASSERT when trying to blit from a level of a 3D texture.

BUG=angleproject:1685

Change-Id: Id715bebafe8336cf8bb95d0d06275a8b95e522e1
Reviewed-on: https://chromium-review.googlesource.com/425494
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-02-07 21:20:57 +00:00
Jamie Madill 1d37bc5086 WebGL: Validate depth/stencil feedback loops.
BUG=angleproject:1685

Change-Id: I6019555af69800f07862a0038fd0c25a9bb5aab8
Reviewed-on: https://chromium-review.googlesource.com/425493
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-02-07 00:00:33 +00:00
Jamie Madill baa25fd779 Framebuffer: Remove ext check for depth/stencil textures.
The absence of the extension should not prevent depth/stencil textures
in FBOs in ES3, since they are core. In fact it shouldn't be possible
to make depth/stencil attachments at all without support, so the check
shouldn't be necessary.

BUG=angleproject:1828

Change-Id: Ibec1e95c78b79cec9654f06ba11beec447017f1c
Reviewed-on: https://chromium-review.googlesource.com/438604
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2017-02-06 23:40:35 +00:00
Corentin Wallez ccab69d64c Implement GL_OES_surfaceless_context
BUG=angleproject:1651

Change-Id: I733ccedad7c7424cdb70e21ef8d48b2a15ccdfd7
Reviewed-on: https://chromium-review.googlesource.com/434762
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2017-01-31 21:21:30 +00:00
JiangYizhou bddc46b4bb ES31: Implement multisampled Textures.
Implement TexStorage2DMultisample and getMultisamplefv entry point.
Also modify sample state for Textures and Framebuffers.

BUG=angleproject:1590
TEST=angle_unittests
TEST=angle_end2end_tests
TEST=dEQP-GLES31.functional.texture.multisample.samples_*.sample_position
TEST=dEQP-GLES31.functional.texture.multisample.samples_*.use_texture_color_2d
TEST=dEQP-GLES31.functional.texture.multisample.samples_*.use_texture_depth_2d
TEST=dEQP-GLES31.functional.texture.multisample.negative.fbo_attach_different_sample_count_tex_tex
TEST=dEQP-GLES31.functional.texture.multisample.negative.fbo_attach_different_sample_count_tex_rbo
TEST=dEQP-GLES31.functional.texture.multisample.negative.fbo_attach_non_zero_level
TEST=dEQP-GLES31.functional.texture.multisample.negative.texture_high_sample_count
TEST=dEQP-GLES31.functional.texture.multisample.negative.texture_zero_sample_count
TEST=dEQP-GLES31.functional.shaders.builtin_functions.texture_size.samples_1_texture_2d
TEST=dEQP-GLES31.functional.shaders.builtin_functions.texture_size.samples_4_texture_2d

Change-Id: I8fa7bd4e73b95745858a3e16b1b92004b4a18712
Reviewed-on: https://chromium-review.googlesource.com/414309
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Yunchao He <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-01-17 15:03:13 +00:00
Jamie Madill 7b57b9d738 Vulkan: Implement basic Clear and ReadPixels.
This enables the simple operations clear test on Vulkan. The current
implementation is very synchronous - it will block and finish the
current command buffer if there is any possibility of a race.

BUG=angleproject:1319

Change-Id: If01fe9a19ed6f539639a38786193d3626164cada
Reviewed-on: https://chromium-review.googlesource.com/367754
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-01-13 20:56:35 +00:00
Jamie Madill f695a3a14d WebGL: Validate texture copying feedback loops.
This adds basic validation for catching CopyTex{Sub}Image calls
whose source and destination textures overlap. It does not yet
implement full support for ES3 types (3D textures, array textures).

BUG=angleproject:1685

Change-Id: I83e7b1998df5575057fed8f99f7ee9970fb38df0
Reviewed-on: https://chromium-review.googlesource.com/425491
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-01-13 20:03:04 +00:00
Jamie Madill a4595b806f WebGL: Validate simple rendering feedback loops.
This adds the most basic form of rendering feedback loop detection:
when we're rendering to a texture that's also bound as an input. It
doesn't filter by selected mipmap level or 3D texture slice, or
do depth attachment validation. It also is missing checks for feedback
loops against the default Framebuffer.

BUG=angleproject:1685

Change-Id: Idb0ee2bfe1c35611544d132204c0da832c0f1c48
Reviewed-on: https://chromium-review.googlesource.com/425489
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-01-11 23:31:37 +00:00
He Yunchao 6be602dc69 Some improvements for BlitFramebuffer.
This change can
1. Skip color blitting when draw buffers are disabled.
2. Skip depth/stencil blitting when depth/stencil buffer has no image.
3. Return early if possible.
4. Move the logic above from D3D backend to common part.

BUG=angleproject:1677

Change-Id: I1662d214b72fb8caa4a95c86d9b8a67984b6071a
Reviewed-on: https://chromium-review.googlesource.com/423135
Commit-Queue: Yunchao He <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-01-03 16:38:04 +00:00
Corentin Wallez b1d0a255f1 WebGL compatibility: add stencil mask and ref restriction
BUG=angleproject:1523
BUG=chromium:668223

Change-Id: I0726769c938fdfd50af0fad1cef1746d4af2a589
Reviewed-on: https://chromium-review.googlesource.com/422084
Commit-Queue: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2016-12-22 02:31:45 +00:00
Antoine Labour 2ec65dc894 Handle GL_READ_BUFFER being GL_NONE in getReadAttachment()
Change-Id: If3883de8f49a3fb33ecc598ba0b86c658cd3f0ca
Reviewed-on: https://chromium-review.googlesource.com/415565
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2016-12-01 15:31:17 +00:00
Jamie Madill 44f264828a Framebuffer: Fix getDepthStencilAttachment check.
The check should be using the newer operator== to check if attachments
are the same - the id() method will hit an UNREACHABLE if it's called
on a Surface attachment.

I noticed this when using this method in the Vulkan RenderPass
implementation.

BUG=angleproject:1583

Change-Id: I387b35805893d04003b22a1c7c9c12fc41c726ce
Reviewed-on: https://chromium-review.googlesource.com/412801
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-11-18 20:57:35 +00:00
Jamie Madill a3944d4f49 Add gl::Format to represent a texture/rb/surface format.
This has a few advantages: it preserves all the information of the
internal format, such as if it is sized or unsized. It also saves
looking up the format multiple times in the table, which should
improve speed in some cases.

The extra sized-ness information will allow us to perform the
correct validation in CopyTexSubImage calls.

BUG=angleproject:1228

Change-Id: I42954771b0a9a968f5d787b8cf6e0af721791855
Reviewed-on: https://chromium-review.googlesource.com/362626
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-07-23 04:34:16 +00:00
Geoff Lang b21e20dae8 D3D: Validate that all color attachments are unique.
The previous logic of only checking the currently enabled draw buffers was
incorrect.  Also updated the logic to be more lenient and allow multiple
slices or mips of the same texture.

BUG=483282

Change-Id: I0d406d1a9a96e48342baefbaf11e0c2ecc6d390c
Reviewed-on: https://chromium-review.googlesource.com/361533
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2016-07-21 00:10:37 +00:00
Martin Radev 1be913cff8 Add support for ES31 context creation
The dEQP test for context creation passes.

SH_WEBGL3_SPEC has been added, but it should be considered whether we
should keep it, remove it or rename it. It was added so that there is
a webgl mapping to es 310 shaders. Check Compiler.cpp. The bison file
has been modified so that some tokens from es3 can be also used in
es31 as well.

A separate macro ES3_1_ONLY is added so that some tokens are limited
only for es 310 shaders.

BUG=angleproject:1442
TEST=angle_unittests

Change-Id: I2e5ca227c96046c30dc796ab934f3fda9c533eba
Reviewed-on: https://chromium-review.googlesource.com/360300
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-07-20 12:58:19 +00:00
Geoff Lang 4b7f12b2a7 FramebufferD3D: Only make sure that enabled attachments are not the same.
It's acceptable to have the same object attached to muliple framebuffer
attachments if they are not being drawn to.

This was triggering failures in the conformance2/state/gl-object-get-calls.html
test.

BUG=483282

Change-Id: If088ccd9b1189f060dfa33ebbe4d82f1f47559b0
Reviewed-on: https://chromium-review.googlesource.com/354570
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2016-06-28 15:29:02 +00:00
Jamie Madill 362876b157 Cache Framebuffer completeness.
Improves performance on the render-to-texture microbenchmark
by ~3x on the OpenGL back-end. Wipes out several of the top profling
hotspots on that benchmark.

BUG=angleproject:1388

Change-Id: I6a35a0b435b2ed3c83d32acdb9df090df98214ad
Reviewed-on: https://chromium-review.googlesource.com/348957
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2016-06-17 14:19:12 +00:00
Jamie Madill 51f40ecd7e Make Framebuffer::checkStatus non-const.
BUG=angleproject:1388

Change-Id: Ia9befba0c915c087f2fe0557d91060256f6d4950
Reviewed-on: https://chromium-review.googlesource.com/348955
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-06-15 20:32:14 +00:00
Jamie Madill dfde6abf9f Context: Remove mutable gl::State getter.
This will preserve layering - the API layer doesn't mutate the state
directly, it passes the API call through to the Context. Is also
removes the possiblity of any shenanigans of the Validation layer
changing the GL state.

Also, this CL refactors a few validation entry points to take
ValidationContext instead of Context. ValidationContext will be the
correct way to interact with the gl::Context in the Validation code.

Finally, additional refactorings make ContextState a proper class with
private data. This allows the ContextState itself to keep a mutable
pointer to the gl::State, so ValidationContext can modify it if
necessary (and it will be necessary for Framebuffer completeness
caching).

BUG=angleproject:1388

Change-Id: I86ab3561573caa9535c8d1b8aad4ab3d0e7cd470
Reviewed-on: https://chromium-review.googlesource.com/348954
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-06-14 17:16:46 +00:00
Olli Etuaho e8528d8983 Fix determining texture mipmap completeness
The code didn't previously take base level properly into account
when determining how many levels to check when checking for texture
completeness.

The code is refactored so that the "q" value in spec, that is the
maximum mipmap level for determining completeness, can be queried from
TextureState. This value is used now for checking completeness.

This requires moving ImageDescs under TextureState. Functions that
operate on the ImageDesc array are also moved from Texture to
TextureState. TextureState members are also renamed to start with the
"m" prefix and made private.

Also handle levels outside the base/max level range consistently in
eglCreateImageKHR validation. We interpret the spec so that if the
level used for the EGL image is not a part of the texture levels that
affect texture completeness, an error is generated.

BUG=angleproject:596
TEST=angle_end2end_tests

Change-Id: I038ef24aa83e0a6905ca3c0bbada5989eecb00d9
Reviewed-on: https://chromium-review.googlesource.com/344880
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2016-05-19 15:02:41 +00:00
Sami Väisänen a797e066c1 Support CHROMIUM_framebuffer_mixed_samples in the GL backend
BUG=angleproject:1378

Change-Id: I634c41f3507dbdeaa56234c4de1b498f81c848ed
Reviewed-on: https://chromium-review.googlesource.com/344520
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Sami Väisänen <[email protected]>
2016-05-18 09:26:37 +00:00
Jamie Madill 7aea7e056d Add EGLImplFactory.
Also rename ImplFactory to GLImplFactory.

This will allow us to use the same factory design pattern for EGL
objects, and to use State helper classes to share data with Impls.

BUG=angleproject:1363
BUG=angleproject:1369

Change-Id: I07a8fe40838d5d4ca32b04910c306edeab4d25a7
Reviewed-on: https://chromium-review.googlesource.com/342051
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-05-11 20:22:24 +00:00
Corentin Wallez 086d59ae38 In ES3, validate that depth and stencil are the same image
BUG=605775

Change-Id: I9508c70a588270dae871dde79fea1df1c3fd1558
Reviewed-on: https://chromium-review.googlesource.com/341440
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2016-05-08 22:12:50 +00:00
Jamie Madill 8415b5fd4a Pass ContextImpl to Framebuffer methods instead of ContextState.
BUG=angleproject:1363

Change-Id: I7e7524d95f2ca31c35918f9fe5c0cb681ed93616
Reviewed-on: https://chromium-review.googlesource.com/340746
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-05-03 21:21:26 +00:00
Jamie Madill 48ef11b2aa Rename gl::Framebuffer::Data to gl::FramebufferState.
Moving this out of the Framebuffer class allows us to forward-
declare it.

BUG=angleproject:1363

Change-Id: I91971c37a92151df508cdf7f0eb8c3e93506d112
Reviewed-on: https://chromium-review.googlesource.com/340741
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-04-29 15:27:58 +00:00
Jamie Madill 9082b982b9 Rename gl::Data to gl::ContextState.
Part of the new world order of renaming the Obj::Data classes to ObjState.

BUG=angleproject:1363

Change-Id: I15cf002b8b093d687f540b9e86f045874af24a7e
Reviewed-on: https://chromium-review.googlesource.com/340740
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-04-29 01:47:03 +00:00
Jamie Madill 1fbc59fe2e D3D11: Enable dirty bits for Framebuffer11.
This patch works using a notification scheme - whenever a Texture or
Renderbuffer changes in such a way as to recreate its RenderTarget, we
pass a signal to the Framebuffer to invalidate some internal state.
Everything is entirely tracked in the Renderer11 layer, and the GL
layer is left untouched.

A RenderTarget11 now tracks points to which it is bound, and the
Framebuffer11 is mostly responsible for managing those links.

The three locations where we notify a Framebuffer when its bound
RenderTargets might be dirty are:

 1) RenderTarget11::~RenderTarget
 2) EGLImageD3D::copyToLocalRendertarget
 3) TextureStorage11_2D::useLevelZeroWorkaroundTexture

This patch gives about a 10% score increase in the D3D11 draw call
benchmark on my system.

BUG=angleproject:1260

Change-Id: Ide38aeadff4a2681bf5bd685e8ca3c9e2612a380
Reviewed-on: https://chromium-review.googlesource.com/327255
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-02-25 04:18:00 +00:00
Geoff Lang a15472a3e0 Fix bugs with drawbuffer state.
* IsAttachmentEnabled was checking the wrong draw buffer state.  Instead
   of checking that drawbuffer[colorAttachment] is in use, it should have
   been scanning for a drawbuffer state that points to colorAttachment.
 * Allow for maxDrawBuffer != maxColorAttachments.  Tested by the GL
   backend on some systems that don't have the draw buffers extension.

Fixed by updating the helpers and adding a new getDrawBuffer helper.

BUG=angleproject:1121

Change-Id: Idd1b0a9ec4a3f944d332c708364408bf5d59e1fd
Reviewed-on: https://chromium-review.googlesource.com/292740
Reviewed-by: Corentin Wallez <[email protected]>
Tryjob-Request: Geoff Lang <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2016-01-27 16:17:03 +00:00
Jamie Madill 60ec6ea703 Implement dirty bits for Framebuffer.
The dirty bits set the stage for performance improvements in D3D, but
don't actually reduce any of the redundant work just yet.

BUG=angleproject:1260

Change-Id: Ib84e6a9b7aa40c37c41790f492361b22faaf4742
Reviewed-on: https://chromium-review.googlesource.com/318730
Reviewed-by: Geoff Lang <[email protected]>
Tryjob-Request: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2016-01-25 20:34:18 +00:00
Jamie Madill c29968bbba Refactor FBO related entry points.
Change the validation to the consistent style for easy auto-generation
and make the context itself implement the entry points. This will more
easily allow us to sync state without passing the Context to the
Texture methods, or doing work in the entry point.

BUG=angleproject:1260
BUG=angleproject:747

Change-Id: I7ed6ec5418b7f51d9e59529267b14b76b87743fb
Reviewed-on: https://chromium-review.googlesource.com/319823
Tryjob-Request: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2016-01-20 22:02:42 +00:00
Geoff Lang 70d0f4996a Implement GL_KHR_debug.
BUG=angleproject:520

Change-Id: I9ced3e7ab1515feddf2ec103c26b2610a45b1784
Reviewed-on: https://chromium-review.googlesource.com/319830
Tryjob-Request: Geoff Lang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2016-01-02 15:09:23 +00:00
Geoff Lang 66988745f2 Revert "Implement GL_KHR_debug."
This reverts commit 6c521b7a70.

Change-Id: I6ff981198e31f34d3e405edea6277ee75516d6ee
Reviewed-on: https://chromium-review.googlesource.com/319820
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2015-12-22 19:39:40 +00:00
Geoff Lang 6c521b7a70 Implement GL_KHR_debug.
BUG=angleproject:520

Change-Id: I78d14cc8c94f5cef58604220f0ca847473b25bf8
Reviewed-on: https://chromium-review.googlesource.com/317820
Tryjob-Request: Geoff Lang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2015-12-22 15:36:53 +00:00
Jamie Madill 3215b207b2 Validation cube completeness for FBO attachments.
ES3 adds a clause that cube map FBO attachments must be cube complete
to produce complete framebuffers. ES2 doesn't have this clause, but
some (if not all, unverified) OpenGL back-ends don't support these
incomplete cube map attachments.

BUG=angleproject:1259

Change-Id: Idd4564488375b8646dde712e6ce4a158c23020ee
Reviewed-on: https://chromium-review.googlesource.com/318264
Tryjob-Request: Jamie Madill <[email protected]>
Reviewed-by: Rafael Cintron <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-12-16 14:03:01 +00:00
Dian Xiang 4028159e32 Using dirty bit notification for D3D11 viewport state
BUG=angleproject:1161

This is a continuation of the dirty bit refactor

Change-Id: I101f415094dd406f6b0a40cb260f1cbbfec7b62c
Reviewed-on: https://chromium-review.googlesource.com/313249
Reviewed-by: Corentin Wallez <[email protected]>
Tryjob-Request: Dian Xiang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Dian Xiang <[email protected]>
2015-12-04 19:06:05 +00:00
Jamie Madill 0df8fe448d D3D11: Don't read or write to the unused depth buffer.
When using STENCIL8, we emulate it on D3D11 with D24S8, since there
is no native stencil-only format. However in many places we would
write to the depth part of this format, and confuse the D3D runtime
when it would use the depth test. Fix this by never modifying the
depth portion of the buffer, or reading from it.

BUG=angleproject:1232

Change-Id: Ifd2e54eceae84e8deea85f439c132d07981b2286
Reviewed-on: https://chromium-review.googlesource.com/313996
Tryjob-Request: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-12-03 16:41:21 +00:00
Jamie Madill 81176780c4 Return correct error in Framebuffer::checkStatus.
UNSUPPORTED is a specific error meaning an implementation-specific
incompatibility. For cases where the attachments are invalid according
to the spec, we should be returning INCOMPLETE_ATTACHMENT.

BUG=angleproject:1231

Change-Id: I4b4332ee5661738374e93c825a53d66d7ba1fad5
Reviewed-on: https://chromium-review.googlesource.com/313995
Tryjob-Request: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-12-01 17:11:19 +00:00
Jamie Madill 984ef41abd Ignore clear commands if rasterizer discard is enabled.
From the 3.0 spec (Section 3.1):

"When enabled, RASTERIZER_DISCARD also causes the Clear and
ClearBuffer* commands to be ignored."

BUG=angleproject:1227

Change-Id: I0316103827927e8af9732d7b4565d787b881ccb8
Reviewed-on: https://chromium-review.googlesource.com/313993
Tryjob-Request: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-11-30 15:27:42 +00:00
Jamie Madill 6b120b9f9d Add checks for FBO attachment layer.
We would allow the app to attach layers that were out-of-bounds. Fix
this by checking against the underlying resource dimensions. Also
rework the code a bit to clean up the texture size query, which is
available from the ImageDesc.

BUG=angleproject:869

Change-Id: I984f1db16daea6ca650d795884d8ec2cb8f05ebb
Reviewed-on: https://chromium-review.googlesource.com/313991
Tryjob-Request: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-11-24 21:07:10 +00:00
Jamie Madill cc86d64ec2 Make Framebuffer size check ES2-only.
This is an ES2-only incompleteness check. We also need to require
matching dimensions in D3D11, but make this an implementation
specific check. Also make all implementation specific errors
'UNSUPPORTED' since that catches all "non-ES" framebuffer
restrictions.

Note that we can't be conformant here in D3D11 currently, since the
spec only makes an exception for mismatching formats for UNSUPPORTED,
not for size checks. However, we don't have an easy solution.

BUG=angleproject:1225

Change-Id: Ic80a04bce397fc12643b010c874f432033babc5d
Reviewed-on: https://chromium-review.googlesource.com/313990
Reviewed-by: Geoff Lang <[email protected]>
Tryjob-Request: Jamie Madill <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-11-24 18:31:43 +00:00
Geoff Lang 242468f316 Sync scissor state before calling BlitFramebuffer.
Now passes:
 * dEQP-GLES3.functional.fragment_ops.scissor.framebuffer_blit_center
 * dEQP-GLES3.functional.fragment_ops.scissor.framebuffer_blit_corner
 * dEQP-GLES3.functional.fragment_ops.scissor.framebuffer_blit_none

BUG=angleproject:885

Change-Id: Ifec2995562c684b3a4b287619c9bf7a25512b1fd
Reviewed-on: https://chromium-review.googlesource.com/302384
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2015-09-30 17:38:39 +00:00
Corentin Wallez 37c3979e47 Revert "Revert "Make the default framebuffer owned by Surface""
Reland the commit after fixing a bug in FramebufferAttachment.

This reverts commit 18fdcbcf1d.

BUG=angleproject:891

Change-Id: I07e08de52bfce8d84d070fc7bc15883009298a4d
Reviewed-on: https://chromium-review.googlesource.com/294831
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Corentin Wallez <[email protected]>
2015-08-20 19:07:13 +00:00
Jamie Madill 18fdcbcf1d Revert "Make the default framebuffer owned by Surface"
Seems to be causing failures on the Mac GPU FYI bots.
SurfaceTest.DestructionDeletesImpl seems to crash.

BUG=angleproject:891
BUG=522557

This reverts commit 264ab56f2e.

Change-Id: I80aeecb8e191de011d9afe6534d0285dcffa82a3
Reviewed-on: https://chromium-review.googlesource.com/294540
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-08-19 18:23:33 +00:00
Corentin Wallez 264ab56f2e Make the default framebuffer owned by Surface
Reland with a fix for SurfaceTest in angle_unittests and fixes for
signed-unsigned warnings

In CGL there is no notion of default Framebuffer and MakeCurrent only
makes a context current but not a drawable. Instead, everything is done
via render to texture. For that reason, different surfaces will have
different FBOs as default framebuffers, which causes that change.

BUG=angleproject:891

Change-Id: I0664896bc335b1a757226aaa212536b8f9d0f08f
Reviewed-on: https://chromium-review.googlesource.com/293752
Reviewed-by: Corentin Wallez <[email protected]>
Tested-by: Corentin Wallez <[email protected]>
2015-08-18 20:39:57 +00:00
Corentin Wallez 11cd6af623 Revert "Make the default framebuffer owned by Surface"
Compilation warning on Windows

This reverts commit 6cb2ae8292.

Change-Id: I4ecadf5d8e909f986da186a7326cfa0922ae8710
Reviewed-on: https://chromium-review.googlesource.com/294241
Reviewed-by: Corentin Wallez <[email protected]>
Tested-by: Corentin Wallez <[email protected]>
2015-08-18 19:54:51 +00:00
Corentin Wallez 6cb2ae8292 Make the default framebuffer owned by Surface
Reland with a fix for SurfaceTest in angle_unittests and fixes for
signed-unsigned warnings

In CGL there is no notion of default Framebuffer and MakeCurrent only
makes a context current but not a drawable. Instead, everything is done
via render to texture. For that reason, different surfaces will have
different FBOs as default framebuffers, which causes that change.

BUG=angleproject:891

Change-Id: Ie9a72de01a58e583a1bfa3f4a055debb860b912f
Reviewed-on: https://chromium-review.googlesource.com/293713
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Corentin Wallez <[email protected]>
2015-08-18 19:21:08 +00:00
Cooper Partin 4d61f7edad Reland Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'
Additional warnings found with more testing and added C4267 warning disable only for angle_libpng

BUG=angleproject:1120

Change-Id: Ic403dcff5a8018056fa51a8c408e64207f3362eb
Reviewed-on: https://chromium-review.googlesource.com/293028
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2015-08-13 13:28:42 +00:00
Corentin Wallez 1bf40bfe2a Revert "Make the default framebuffer owned by Surface"
This reverts commit 87e63a9982.

Speculative revert to fix the webgl cts on Windows D3D9 and the
unittests on Linux.

BUG=

Change-Id: I488f4e0b2dc67270eed45f1c10bfba1d13c98739
Reviewed-on: https://chromium-review.googlesource.com/293350
Reviewed-by: Corentin Wallez <[email protected]>
Tested-by: Corentin Wallez <[email protected]>
2015-08-12 22:54:03 +00:00
Corentin Wallez 87e63a9982 Make the default framebuffer owned by Surface
In CGL there is no notion of default Framebuffer and MakeCurrent only
makes a context current but not a drawable. Instead, everything is done
via render to texture. For that reason, different surfaces will have
different FBOs as default framebuffers, which causes that change.

BUG=angleproject:891

Change-Id: I3f6da7b587353316026ea39a5c87f91265e0f1ba
Reviewed-on: https://chromium-review.googlesource.com/289872
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Corentin Wallez <[email protected]>
2015-08-12 21:04:58 +00:00
Jamie Madill b195643c16 Revert "Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'"
Seems to have quite a few warnings in 64-bit on my machine.

BUG=angleproject:1120

This reverts commit c5cf9bc47d.

Change-Id: I86768b900aeba52e7a2242d9ae8949f93f1a5ba9
Reviewed-on: https://chromium-review.googlesource.com/293280
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-08-12 17:36:09 +00:00