Commit Graph
125 Commits
Author SHA1 Message Date
Mohan Maiya 6caa265261 Vulkan: Support float textures and renderbuffers
Fixed support in the vulkan backend for legacy
GLES2.0 formats (luminance, alpha,
luminance_alpha)

Correctly exposed the following extensions:
OES_texture_float
OES_texture_half_float
OES_texture_float_linear
OES_texture_half_float_linear
EXT_color_buffer_float
EXT_color_buffer_half_float

Some of the above extensions have different
requirements depending on other extension support
and the context client version, and were
incorrectly assuming the most restrictive
requirements to be exposed.

Implemented end2end tests for:
OES_texture_float
OES_texture_half_float
OES_texture_float_linear
OES_texture_half_float_linear
EXT_color_buffer_float
EXT_color_buffer_half_float

Bug: angleproject:2898
Bug: angleproject:2726
Test: ./angle_end2end_tests --gtest_filter='Texture2DFloatTest*'
Change-Id: I7024aa1393eadafb5a0fb83c23e9035aae650b67
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1740276
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-09-13 20:59:00 +00:00
Hyunchang Kim b1580a2767 Vulkan: Set half float vertex format to valid in 2.0 context
- OES_vertex_half_float extension requires this patch
- Add end2end tests to verify OES_vertex_half_float extension

BUG=angleproject:3191
BUG=angleproject:3802
Test:
 angle_end2end_tests --gtest_filter=*VertexAttributeTest.HalfFloatClientMemoryPointer*
 3DMark Icestorm GT1

Change-Id: Ia597021a5ae6b4853ee1199989ec3f9cc23c7fac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1793354
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-09-12 19:05:56 +00:00
Geoff Lang f29125be93 Update the rules for unsized float renderability.
dEQP uses the following rules for unsized float format renderability in
ES2:

HALF_FLOAT_OES + RED : GL_EXT_texture_rg and GL_OES_texture_half_float
HALF_FLOAT_OES + RG  : GL_EXT_texture_rg and GL_OES_texture_half_float
HALF_FLOAT_OES + RGB : GL_EXT_color_buffer_half_float and GL_OES_texture_half_float
HALF_FLOAT_OES + RGBA: GL_EXT_color_buffer_half_float and GL_OES_texture_half_float

FLOAT + RED : GL_EXT_texture_rg and GL_OES_texture_float
FLOAT + RG  : GL_EXT_texture_rg and GL_OES_texture_float
FLOAT + RGB : never
FLOAT + RGBA: never

BUG=angleproject:3283

Change-Id: I4c4c0d290d2c7dec45419a0765fa27b79f0ad774
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1773304
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Commit-Queue: Courtney Goeltzenleuchter <[email protected]>
2019-09-09 20:49:45 +00:00
Jaedon Lee 3b46885e19 Vulkan: Implement EXT_texture_type_2_10_10_10_REV
- Expose GLES 3.0 feature of 2_10_10_10_REV texture type
  on GLES 2.0 as EXT.
- Handle alpha channel value as 1.0 when used with RGB format.
- Add test for "RGB+UNSIGNED_INT_2_10_10_10_REV" case into TextureUploadFormatTest.

BUG=angleproject:3232.
Test:
 dEQP-GLES2.capability.extensions.uncompressed_texture_formats.GL_EXT_texture_type_2_10_10_10_REV
 dEQP-GLES2.functional.fbo.completeness.renderable.texture.*2_10_10_10_rev
 dEQP-GLES3.functional.fbo.completeness.renderable.texture.*2_10_10_10_rev
 KHR-GLES2.core.internalformat.*2_10_10_10_rev*
 KHR-GLES3.core.internalformat.*2_10_10_10_rev*

Change-Id: Iac00517971f9242161115c7256117a69093fb5df
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1732618
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-08-23 15:28:26 +00:00
Stuart Morgan 9d737966ac Standardize copyright notices to project style
For all "ANGLE Project" copyrights, standardize to the format specified
by the style guide. Changes:
- "Copyright (c)" and "Copyright(c)" changed to just "Copyright".
- Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1").
- Fixed a small number of files that had no copyright date using the
  initial commit year from the version control history.
- Fixed one instance of copyright being "The ANGLE Project" rather than
  "The ANGLE Project Authors"

These changes are applied both to the copyright of source file, and
where applicable to copyright statements that are generated by
templates.

BUG=angleproject:3811

Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-08-14 23:05:33 +00:00
James Darpinian 22ec7dc900 Remove all global constructors and exit time destructors.
WebKit compiles with -Wglobal-constructors, so they want this. I decided
to do -Wexit-time-destructors at the same time.

Bug: angleproject:3439
Bug: angleproject:1459
Change-Id: I4b44ae4f8e6f066e07dc7f9f6ced9a5d49dc8f8a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1738438
Commit-Queue: James Darpinian <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-08-07 21:34:14 +00:00
Clemen Deng f2412bca35 Get rendering to texture working
Other small fixes for desktop compatibility

Bug: angleproject:3620
Change-Id: I8e75bce1f850fb891c8bb6e16f79302a6d59276c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1707932
Commit-Queue: Clemen Deng <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-07-26 16:25:02 +00:00
Clemen Deng 8bb46c5b9f Refactor: add InternalFormat::isInt()
Bug: angleproject:3727
Change-Id: I33ee85563e3b070b4b86afc37230d3f5af54f446
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1713091
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2019-07-23 18:03:22 +00:00
Geoff Lang d9c1710779 Add support for GL_OES_texture_compression_astc
This extension adds 3D compressed texture formats, something ANGLE has
not seen before.  This requires tracking a compressed block depth for
validation and image size computations.

Update the ldr and hdr extension checks to be in line with the spec.
HDR requires LDR and is not detectable by texture formats alone.

Expose all of the ASTC extensions on the GL backend.

BUG=angleproject:3675

Change-Id: Id04c7c8ef8541e9556579536cdba899b64303caf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1695923
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2019-07-15 19:27:55 +00:00
James Dong 9917988a2e Vulkan: change packed attrib to ANGLE format ID
This prevents later issues with some VkFormat values being over 256,
as well as providing more information to pipeline creation.
A preliminary step towards handling mismatched vertex attributes.

Bug: angleproject:3634
Change-Id: Idb15a14088a2d73b43b4b92d3cfdb12587c5f711
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1696212
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-07-11 20:23:14 +00:00
Jamie Madill ee21a18734 Store angle::Format in gl::VertexAttribute.
Instead of storing type/size/normalized/pureInteger we instead store a
pointer to the angle::Format. This makes some code logic simpler and
will let us more easily check if a vertex attribute format changes in
calls to VertexAttribPointer or VertexAttribFormat.

This CL adds extra information to angle::Format to represent the vertex
format info needed. It also caches the channel count so that it can be
queried faster.

Also renames "Int" -> "Sint" in UtilsVk for consistency.

Bug: angleproject:3256
Change-Id: I5ef9b983dad8a58c341113c802500b89ce081566
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1684293
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
2019-07-04 14:11:46 +00:00
Mohan Maiya 141a23f64f Add support for OES_depth24
Allow 24-bit depth as a valid Renderbuffer format.

Bug: angleproject:3229
Test: angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.DepthBuffer/*
Change-Id: I166639ec0e000595dc55848e4b8b7bef627b6471
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1661050
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2019-06-18 12:32:35 +00:00
Courtney Goeltzenleuchter eaf2d928e6 Add support for OES_depth_texture
Note: Includes workaround for http://anglebug.com/3452 - some Android
devices do not indicate filtering support on VK_FORMAT_D16_UNORM.

Bug: angleproject:3103
Test: angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.DepthTexture/*
angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.PackedDepthStencil/*
angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.DepthTextureRender/ES2_VULKAN

Change-Id: Ic325fb94ab0e619a17c2e149e0e0865fa4142f3a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575426
Commit-Queue: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-05-15 16:47:37 +00:00
Courtney Goeltzenleuchter b76bf1b99e Refactor in preparation of adding OES_depth_texture
Rename existing depthTexture extension flag to depthTextureANGLE to
distinguish it from OES depth texture extension to be added.

Bug: angleproject:3103
Test: angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.DepthTexture
Change-Id: I44c69a69b925a84f931518e0374e662893813061
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575425
Commit-Queue: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-05-08 16:54:38 +00:00
Jamie Madill 896e7ded5f Use compressed internal format as 'format' in tables.
Previously we would store the unsized 'base' format as the internal
format. For instance for GL_COMPRESSED_RGB_S3TC_DXT1_EXT we would store
GL_RGB. With the new spec validation for TexSubImage it becomes clearer
to store the internal format of the compressed texture as the 'format'.

Bug: angleproject:3170
Change-Id: I7446418896eabd3d4f143e9cae4976889b973674
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1553379
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-04-04 17:32:02 +00:00
Jeff Gilbert 6446c8882f Combine SizedFloatRGBA[Renderbuffer,TextureAttachment]Support.
Bug: angleproject:3332
Change-Id: Ia937727062d3296af9691a95d296c89b8e9476ac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1544779
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2019-03-29 02:49:41 +00:00
Jeff Gilbert 954467546f Add support to CHROMIUM_color_buffer_rgba for creating RGBA32F renderbuffers on ES2.
This is desired for implementing WEBGL_color_buffer_float support on
WebGL1 on ANGLE's ES2 driver, for Firefox.

Bug: angleproject:3322
Change-Id: I599f86db62402333d3ef9235956c63e667f1513d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1541722
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
2019-03-28 23:03:02 +00:00
Geoff Lang 979f3bbe2c Mark RGB HALF_FLOAT_OES as renderable with EXT_color_buffer_half_float and WebGL
The EXT_color_buffer_half_float spec states:

    If OES_texture_half_float is supported, textures created with:

        <internalformat> = RGBA
        <format> = RGBA
        <type> = HALF_FLOAT_OES

    are renderable.

But WebGL content relies on being able to render to both RGB and RGBA unsized
HALF_FLOAT_OES textures.

Framebuffers may still return unsupported for this format.

BUG=941671

Change-Id: I42d909d26508b9cdf7cda6d1dc025b0e2ed87732
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1523530
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2019-03-14 17:57:26 +00:00
Jamie Madill dd34b3b9b7 Pack VertexAttribType enum.
This improves performance slightly in vertex array format checks.
Instead of needing to switch on GLenum values we can use packed arrays
and tables to determine the values we need.

Does not significantly affect performance but will enable future work.

Bug: angleproject:3074
Change-Id: I6f4821a463e9b41fe3f8c8967eb3ed4c1d6b84be
Reviewed-on: https://chromium-review.googlesource.com/c/1393903
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-01-16 18:25:16 +00:00
Jamie Madill 3f0c4a56e7 Vulkan: Faster state transitions.
Implements a transition table from Pipeline Cache entry to
state change neighbouring Pipeline Cache entries. We use
a 64-bit mask to do a quick scan over the pipeline desc.
This ends up being a lot faster than doing a full hash
and memcmp over the pipeline description.

Note that there could be future optimizations to this design.
We might keep a hash map of the pipeline transitions instead
of a list. Or use a sorted list. This could speed up the search
when there are many transitions for cache entries. Also we could
skip the transition table and opt to do a full hash when there
are more than a configurable number of dirty states. This might
be a bit faster in some cases. Likely this will be something we
can add performance tests for in the future.

Documentation is also added in a README file for the Vulkan back
end. This will be extended over time.

Improves performance about 30-35% on the VBO state change test.

Bug: angleproject:3013
Change-Id: I793f9e3efd8887acf00ad60e4ac2502a54c95dee
Reviewed-on: https://chromium-review.googlesource.com/c/1369287
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2019-01-10 19:46:59 +00:00
Jamie Madill dbc605cecc Vulkan: Optimize VBO state changes.
Also has some minor optimizations for the front-end.

12% improvement on the Vulkan VBO change test.

Bug: angleproject:3014
Change-Id: I38e1a8194edfc14bfe57424be348cb9688e928f4
Reviewed-on: https://chromium-review.googlesource.com/c/1369286
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-01-05 02:04:05 +00:00
Jamie Madill b980c5630e Reformat all cpp and h files.
This applies git cl format --full to all ANGLE sources.

Bug: angleproject:2986
Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f
Reviewed-on: https://chromium-review.googlesource.com/c/1351367
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2018-11-27 18:27:13 +00:00
Markus Tavenrath 0d665139fe Don't generate TypeInfo objects as static objects within GetTypeInfo function
Generating static objects within a function results in multithread safe
code. This code generates the static objects upon the first execution of the
line which declares the object. This results in high runtime cost for
synchronization and a bigger code size.

Instead introduce a new function uint32_t GetPackedTypeInfo(GLenum type)
which returns a packed representation for the Type class. This
representation is usually returned in a register on the assembly level.
As a result we save constant storage for the TypeInfo object and one
indirection when reading any value from this object. The Type constructor
accepts the packed representation and unpacks it an inline function. For
fields which are not used the compiler also applies dead code
elimination which reduces the cost furthermore.

As a result of this change the cost of GetTypeInfo is reduced by a
factor of 4-5.

Bug: angleproject:2974
Change-Id: I8ed0bf2f09d087fa4cffa04f82e3b7f8c183fe30
Reviewed-on: https://chromium-review.googlesource.com/c/1340221
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-11-26 16:27:51 +00:00
Geoff Lang 836674c28b Expose GL_CHROMIUM_compressed_texture_etc on top of ES drivers.
This allows Chrome to expose the ETC texture formats in WebGL on top of ANGLE.

BUG=angleproject:1552

Change-Id: I6a6c3912791e121826b2083421e37df7c0dc38e7
Reviewed-on: https://chromium-review.googlesource.com/c/1342420
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Kai Ninomiya <[email protected]>
2018-11-20 20:10:27 +00:00
Frank Henigman d633b1569a Get rid of VertexFormatType.
The enum VertexFormatType is redundant with angle::FormatID.  The Vulkan
back end has already eschewed VertexFormatType, this change updates the
D3D back ends.

BUG=angleproject:2531

Change-Id: I67ea2203ca80be828f4c757a37810fe67a279364
Reviewed-on: https://chromium-review.googlesource.com/c/1263899
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Frank Henigman <[email protected]>
2018-10-16 20:44:11 +00:00
Olli Etuaho f2ed299569 Add support for EXT_texture_compression_bptc
After validation, the enums are simply forwarded to the native
drivers. The BPTC formats are supported on both OpenGL and D3D.

The included test coverage covers the API quite well, but only has
basic coverage for correct decoding of texture data. More coverage for
texture data could be added later.

BUG=angleproject:2869
TEST=angle_end2end_tests

Change-Id: I3de37972dcf13c6fa3fc1bc429a2627523a4a082
Reviewed-on: https://chromium-review.googlesource.com/c/1261675
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-10-11 22:25:21 +00:00
Yuly Novikov d082819ca2 Fix format support conditions
This fixes format support tables in formatutils.cpp and formatutilsgl.cpp
to conform to the core and extension GLES specs,
for a large portion of the formats.
ExtsOnly SupportRequirement was enhanced to accept multiple sets of extensions.
Format is supported if all the extensions in one of the sets are available.

Also fixes determining support for extensions based on those formats.

And some fixes to tests which fail due to more strict format support.

Bug: angleproject:2567

Change-Id: I6050fff9c597f658fdcea2477bff59a603cdb7e8
Reviewed-on: https://chromium-review.googlesource.com/1105612
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2018-10-01 22:41:41 +00:00
Jamie Madill ba365939b9 Rename angle::Format::ID to angle::FormatID.
This allow for predeclaring the enum. It solves some include dependency
issues.

Bug: angleproject:2729
Change-Id: Ibbbab0796e466c62848404ba277c5f454fd9ac62
Reviewed-on: https://chromium-review.googlesource.com/1142299
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Frank Henigman <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-07-20 16:59:17 +00:00
Jamie Madill ca2ff38b7a Refactor internal format pixel math methods.
This removes the use of the ErrorOrResult class from these methods.
This will enable more performant Error handling. Also cleans up the
ANGLE_TRY_CHECKED_MATH macro to be more general.

Bug: angleproject:2713
Change-Id: I349947d320907839ca88ec1f9251e6ddc3858a08
Reviewed-on: https://chromium-review.googlesource.com/1128920
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Frank Henigman <[email protected]>
2018-07-11 18:40:20 +00:00
Geoff Lang cb8a921b7a Vulkan: Support RGB/BGR backbuffers emulated on RGBA/BGRA.
BUG=angleproject:2692
BUG=angleproject:2523
BUG=angleproject:2715
BUG=angleproject:2716

Change-Id: I538b385f8b66fb97e176953b0fc4a6299849c005
Reviewed-on: https://chromium-review.googlesource.com/1118713
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Luc Ferron <[email protected]>
2018-07-10 20:28:29 +00:00
Yuly Novikov f15f886c2d Differentiate texture and renderbuffer framebuffer attachment capabilities
ANGLE used to describe the abitily to attach textures and renderbuffers
of a specific format to a framebuffer using a single notion of "renderable".
However, for some formats, only one can be supported, but not the other.

Split TextureCaps::renderable into textureAttachment and renderbuffer.
Also, split InternalFormat::renderSupport into
textureAttachmentSupport and renderbufferSupport.

The only functional change is in a few places which now explicitly check
for texture or renderbuffer attachement support.
Information in format support tables was duplicated for the two capabilities,
so behavior should remain the same. It should be corrected in future CLs.

Note: additional information in those tables may need to be added
in order to properly support GenerateMipmap and TexStorage2DMultisample,
this is beyond the scope of this CL.

Bug: angleproject:2567
Change-Id: I18bce4100525be35709d8bbf4de08ec812aab502
Reviewed-on: https://chromium-review.googlesource.com/1086491
Commit-Queue: Yuly Novikov <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-06-08 21:58:15 +00:00
Frank Henigman 95fb2a1774 Add vertex formats and lookup function.
Add an angle::Format for each ES2 vertex data format.  Add function
GetVertexFormatID() to get the angle::Format for a vertex attribute.
These will be used later to support vertex formats in Vulkan (by mapping
angle::Format to Vulkan format) and to eliminate the redundant enum
gl::VertexFormatType.
No functional change.

BUG=angleproject:2405
BUG=angleproject:2531

Change-Id: I871ae23ce9fba57d90c554376e84b03f8514f7fc
Reviewed-on: https://chromium-review.googlesource.com/1044874
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Frank Henigman <[email protected]>
2018-05-30 17:12:16 +00:00
Geoff Lang b0e9ddb553 Refactor a hex streaming into a generic FmtHex function.
The length of the printed value can be determined from size of the type.

BUG=angleproject:2546

Change-Id: I39a4f9550f381dd82183f50019b3f7d117c52472
Reviewed-on: https://chromium-review.googlesource.com/1070220
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2018-05-23 17:55:27 +00:00
Jeff Gilbert 31d3deb41a Add formatType arg to computeSkipBytes.
Fix texture upload format tests:
- Format tests should definitely run on ES3 also.
- Also set filters to NEAREST since some formats aren't filterable.
- Fix RGB9_E5 test reference encoding and add a test for it.
- True int/uint textures require i/usamplers.

Bug: angleproject:2576
Change-Id: Ia5bac34cdee6554a88db339de443689a71a0cf70
Reviewed-on: https://chromium-review.googlesource.com/1068142
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-05-22 22:46:32 +00:00
Geoff Lang e88e454803 Implement extensions exposing ETC2 compressed texture formats in ES2.
BUG=angleproject:2527

Change-Id: I000f68366de4119375b6d3c79bc2eff3ebd5db9e
Reviewed-on: https://chromium-review.googlesource.com/1042885
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2018-05-04 21:21:14 +00:00
Geoff Lang e24032a2c4 The 'format' of unsized SRGB internal formats should be SRGB too.
EXT_sRGB requires calling TexImage with SRGB as the 'format' parameter.
This was causing issues when we would take an InternalFormat struct
representing an unsized sRGB format and be unable to use it's format
member to make GL calls without transforming it.

BUG=693090

Change-Id: I8b9baf2591a998a0088e5275f42ffc568e37100d
Reviewed-on: https://chromium-review.googlesource.com/984965
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-04-19 12:49:49 +00:00
Lingfeng Yang 56e9540ac4 GLES1: caps: Allow ES1 to use formats from core ES2
BUG=angleproject:2306

Change-Id: I93e85f3014e7d9a645e13d3c3025b5360e2a63db
Reviewed-on: https://chromium-review.googlesource.com/925550
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-03-05 20:36:55 +00:00
Nico Weber b5db2b497b Enable -Wimplicit-fallthrough for ANGLE.
Also teach MSVC that ANGLE_CRASH() can't return.

Also fix instances of the warning in build configurations where
UNREACHABLE() can return (e.g. release without dcheck_always_on
or debug).

If the UNREACHABLE()s are truly unreachable, this change has
no behavior change.

Bug:  chromium:810767

Change-Id: I68f3587cf3e268c3ef634dce7ae3d70399859d0f
Reviewed-on: https://chromium-review.googlesource.com/914842
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Nico Weber <[email protected]>
Commit-Queue: Nico Weber <[email protected]>
2018-02-15 18:54:20 +00:00
Olli Etuaho ceffd20ce2 Set colorspace of D3D pbuffers according to DXGI format
When a EGL pbuffer is created based on a D3D SRGB texture using
EGL_ANGLE_d3d_texture_client_buffer, SRGB conversions are performed as
if it was an SRGB surface. The value of EGL_GL_COLORSPACE now
reflects that correctly. If the pbuffer is bound to a texture and used
as a framebuffer attachment, querying GL_FRAMEBUFFER_COLOR_ATTACHMENT
also reflects that correctly.

The behavior is the same on both the D3D backend, where there is no
native interop involved, and on the GL backend using
WGL_NV_DX_interop(2).

There are a few limitations on the GL backend that relies on native
interop:

1. SRGB conversion for textures created this way can't be disabled
using the GL_FRAMEBUFFER_SRGB_EXT toggle that's exposed in ANGLE
through EXT_sRGB_write_control. This is now documented in the
EGL_ANGLE_d3d_texture_client_buffer spec. On the D3D backend this is
not a problem since EXT_sRGB_write_control is not supported either
way.

2. Creating a pbuffer out of a D3D11 texture with the format
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB does not work, even though it was
listed as one of the supported formats in the
EGL_ANGLE_d3d_texture_client_buffer spec. It's now mentioned that
support for this format is optional.

BUG=angleproject:2300
TEST=angle_white_box_tests

Change-Id: I70ee0646680805e4469291a5b2ce59e92fda009e
Reviewed-on: https://chromium-review.googlesource.com/866743
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-01-16 15:21:51 +00:00
Jamie Madill acf2f3adba Apply Chromium style fixes.
This addresses several minor code quality issues that are validated
in Chromium, but not yet applied to ANGLE:

* constructors and destructors must be defined out-of-line
* auto is not allowed for simple pointer types
* use override everywhere instead of virtual
* virtual functions must also be defined out-of-line

Slightly reduces binary size for me (~2k on Win, 150k on Linux).

Bug: angleproject:1569
Change-Id: I073ca3365188caf5f29fb28d9eb207903c1843e6
Reviewed-on: https://chromium-review.googlesource.com/779959
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-11-22 06:34:40 +00:00
Jeff Gilbert 485903582c Remove formatType arg from computeCompressedImageSize.
BUG=angleproject:2230

Change-Id: Ie291ba05efa89bc4ea52966e975d5a21431a461f
Reviewed-on: https://chromium-review.googlesource.com/757877
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-11-11 18:01:37 +00:00
Geoff Lang 86f8116ba2 Make compressed texture format extensions enableable.
Fix allowing CompressedTexSubImage calls on ETC1 texture types
(disallowed in the extension spec).

BUG=angleproject:1523

Change-Id: Ic90175ff4626da0170b6c94f204a9d31fd0154a7
Reviewed-on: https://chromium-review.googlesource.com/744443
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-11-01 21:09:36 +00:00
Geoff Lang d84a00b9dd Make GL_OES_rgb8_rgba8 enableable.
Allow unsized RGB/UNSIGNED_BYTE without the rgb8rgba8 extension.

BUG=angleproject:1523

Change-Id: Ic7b4236c7b8389952b093719f26840ea2bbd01bf
Reviewed-on: https://chromium-review.googlesource.com/742501
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-10-31 00:39:10 +00:00
Geoff Lang c71ea661e3 Return HALF_FLOAT as an implementation read type in ES3.
BUG=765953

Change-Id: I4dc79921766975cd75c489887b7e57ec4666fbbb
Reviewed-on: https://chromium-review.googlesource.com/685897
Reviewed-by: Zhenyao Mo <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-09-26 22:07:15 +00:00
Kenneth Russell 6938285b19 Fix BlitFramebuffer validation for BGRA sources and targets.
It is legal to blit between GL_RGBA8 and GL_BGRA8 sources and
destinations when resolving multisampled renderbuffers. Expand
BlitFramebuffer's validation to handle this case.

Query GL_MAX_VERTEX_OUTPUT_COMPONENTS on the Core Profile to work
around an error generated on macOS when querying
GL_MAX_VARYING_COMPONENTS.

Expand the BlitFramebuffer tests to cover these cases and start
running them on the OpenGL backend.

Fix detectition of multisampled D3D11 rendertargets when the sample count
is 1.

BUG=angleproject:891

Change-Id: Ief5531756651caa66f612e647d3d5c05c8c51ff5
Reviewed-on: https://chromium-review.googlesource.com/587459
Reviewed-by: Kenneth Russell <[email protected]>
2017-07-27 18:43:17 +00:00
Corentin Wallez 26cf35a8e7 Revert "Fix BlitFramebuffer validation for BGRA sources and targets."
This reverts commit 17d270311e.

Reason for revert:
 - New test fails on NVIDIA and AMD on Windows when using the backbuffer FAST_PATH.
 - SetUp code ASSERT_GL_NO_ERROR (line 269) but a GL error happens on all Windows and Linux Intel OpenGL.

Original change's description:
> Fix BlitFramebuffer validation for BGRA sources and targets.
> 
> It is legal to blit between GL_RGBA8 and GL_BGRA8 sources and
> destinations when resolving multisampled renderbuffers. Expand
> BlitFramebuffer's validation to handle this case.
> 
> Work around a bug in macOS' OpenGL driver querying the number of
> samples for GL_BGRA8.
> 
> Query GL_MAX_VERTEX_OUTPUT_COMPONENTS on the Core Profile to work
> around an error generated on macOS when querying
> GL_MAX_VARYING_COMPONENTS.
> 
> Expand the BlitFramebuffer tests to cover these cases and start
> running them on the OpenGL backend.
> 
> BUG=angleproject:891
> 
> Change-Id: I4829585d2b6428ce0bc7509c4734d33709a0930b
> Reviewed-on: https://chromium-review.googlesource.com/582268
> Commit-Queue: Geoff Lang <[email protected]>
> Reviewed-by: Kenneth Russell <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>

[email protected],[email protected]

Change-Id: I220bc482194cf7fad5e7e732a6d043ce0d504d79
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:891
Reviewed-on: https://chromium-review.googlesource.com/586428
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2017-07-26 11:02:22 +00:00
Kenneth Russell 17d270311e Fix BlitFramebuffer validation for BGRA sources and targets.
It is legal to blit between GL_RGBA8 and GL_BGRA8 sources and
destinations when resolving multisampled renderbuffers. Expand
BlitFramebuffer's validation to handle this case.

Work around a bug in macOS' OpenGL driver querying the number of
samples for GL_BGRA8.

Query GL_MAX_VERTEX_OUTPUT_COMPONENTS on the Core Profile to work
around an error generated on macOS when querying
GL_MAX_VARYING_COMPONENTS.

Expand the BlitFramebuffer tests to cover these cases and start
running them on the OpenGL backend.

BUG=angleproject:891

Change-Id: I4829585d2b6428ce0bc7509c4734d33709a0930b
Reviewed-on: https://chromium-review.googlesource.com/582268
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-07-25 22:30:35 +00:00
Olli Etuaho 50c562de05 Re-land: Don't expose non-conformant multisampling modes on GL
Re-landing with a fallback for failed internal format queries to work
around issue seen on Shield TV. Also fixed wrong handling of integer
RG formats in isRequiredRenderbufferFormat.

Some NVIDIA GL drivers expose non-conformant multisampling modes. The
conformance of multisampling modes can be queried using the extension
NV_internalformat_sample_query. Use it to filter out the
non-conformant modes from the modes that are exposed by ANGLE.

The MAX_SAMPLES value and other similar values stored in caps also
need to be lowered to match the maximum number of samples exposed
for required formats.

There seems to be an NVIDIA driver bug related to querying
STENCIL_INDEX8 multisample format. Work around this by querying
DEPTH24_STENCIL8 instead.

There's also some confusion around whether RGB9_E5 should be
renderable. Once the floating point texture extensions got rolled
into the core GL spec, it was eventually made clear that RGB9_E5
is intended not to be renderable. The extension specs that predate
float textures in the core spec do suggest that it would be
renderable, but in practice drivers that advertise the extension
strings don't reliably implement RGB9_E5 as renderable. Solve this
by disabling it as a renderable format and adding an explanatory
comment.

BUG=chromium:682815
TEST=angle_end2end_tests,
     dEQP-GLES31.functional.state_query.internal_format.renderbuffer.*

Change-Id: I727f03045a1534d6764b571e6d839243705d25b3
Reviewed-on: https://chromium-review.googlesource.com/551957
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-07-05 16:12:28 +00:00
Yuly Novikov c8a8b84353 Revert "Don't expose non-conformant multisampling modes on GL"
This reverts commit 3cd0dd370f.

Reason for revert: crashes on NVIDIA Shield TV
https://build.chromium.org/p/chromium.gpu.fyi/builders/Android%20Release%20%28NVIDIA%20Shield%20TV%29/builds/1816

Original change's description:
> Don't expose non-conformant multisampling modes on GL
> 
> Some NVIDIA GL drivers expose non-conformant multisampling modes. The
> conformance of multisampling modes can be queried using the extension
> NV_internalformat_sample_query. Use it to filter out the
> non-conformant modes from the modes that are exposed by ANGLE.
> 
> The MAX_SAMPLES value and other similar values stored in caps also
> need to be lowered to match the maximum number of samples exposed
> for required formats.
> 
> There seems to be an NVIDIA driver bug related to querying
> STENCIL_INDEX8 multisample format. Work around this by querying
> DEPTH24_STENCIL8 instead.
> 
> There's also some confusion around whether RGB9_E5 should be
> renderable. Once the floating point texture extensions got rolled
> into the core GL spec, it was eventually made clear that RGB9_E5
> is intended not to be renderable. The extension specs that predate
> float textures in the core spec do suggest that it would be
> renderable, but in practice drivers that advertise the extension
> strings don't reliably implement RGB9_E5 as renderable. Solve this
> by disabling it as a renderable format and adding an explanatory
> comment.
> 
> BUG=chromium:682815
> TEST=angle_end2end_tests,
>      dEQP-GLES31.functional.state_query.internal_format.renderbuffer.*
> 
> Change-Id: I2218e3a23ea7b48a0615fea77a91897dc7d5fe9e
> Reviewed-on: https://chromium-review.googlesource.com/525515
> Reviewed-by: Geoff Lang <[email protected]>
> Commit-Queue: Olli Etuaho <[email protected]>

[email protected],[email protected],[email protected],[email protected]

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:682815
Change-Id: I1ebdf52c3fab1526f5a561ac4c8555e305ef2243
Reviewed-on: https://chromium-review.googlesource.com/551164
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2017-06-28 05:49:26 +00:00
Olli Etuaho 3cd0dd370f Don't expose non-conformant multisampling modes on GL
Some NVIDIA GL drivers expose non-conformant multisampling modes. The
conformance of multisampling modes can be queried using the extension
NV_internalformat_sample_query. Use it to filter out the
non-conformant modes from the modes that are exposed by ANGLE.

The MAX_SAMPLES value and other similar values stored in caps also
need to be lowered to match the maximum number of samples exposed
for required formats.

There seems to be an NVIDIA driver bug related to querying
STENCIL_INDEX8 multisample format. Work around this by querying
DEPTH24_STENCIL8 instead.

There's also some confusion around whether RGB9_E5 should be
renderable. Once the floating point texture extensions got rolled
into the core GL spec, it was eventually made clear that RGB9_E5
is intended not to be renderable. The extension specs that predate
float textures in the core spec do suggest that it would be
renderable, but in practice drivers that advertise the extension
strings don't reliably implement RGB9_E5 as renderable. Solve this
by disabling it as a renderable format and adding an explanatory
comment.

BUG=chromium:682815
TEST=angle_end2end_tests,
     dEQP-GLES31.functional.state_query.internal_format.renderbuffer.*

Change-Id: I2218e3a23ea7b48a0615fea77a91897dc7d5fe9e
Reviewed-on: https://chromium-review.googlesource.com/525515
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-06-20 06:52:19 +00:00