- 21 Dec, 2017 1 commit
-
-
Nicolas Capens authored
GL_R11F_G11F_B10F is a renderable format (in the EXT_color_buffer_float extension) with unsigned floating-point values, which we implement using (signed) half- or single-precision floating-point types. So we need to clamp values to a positive range before writing to them. Change-Id: Ic21a5b0b33905c0aeab35299fc268158f8c679f9 Reviewed-on: https://swiftshader-review.googlesource.com/15448Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
- 20 Dec, 2017 3 commits
-
-
Nicolas Capens authored
This change uses half-precision floating-point implementation formats for all OpenGL half-precision floating-point formats, as well as the R11F_G11F_B10F and RGB9_E5 special internal formats. sw::FORMAT_X16B16G16R16F was implemented for the formats without alpha. RGB9E5 conversion was optimized to not require powf(2.0, x), and 11- and 10-bit floating-point formats were optimized to map directly to 16-bit half-precision floating-point. Change-Id: Ic33f903d01f37394244aec9f53b0e67d1c978764 Reviewed-on: https://swiftshader-review.googlesource.com/15410Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
GL_UNSIGNED_INT_10F_11F_11F_REV and GL_UNSIGNED_INT_5_9_9_9_REV were using sw::FORMAT_A32B32G32R32F as the implementation format, which resulted in using bad alpha values when it was rendered into. Change-Id: If29da49a9dc7f7a52d8846417da66f7af929f276 Reviewed-on: https://swiftshader-review.googlesource.com/15408Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
Instead of testing for the number of samplers used so far in the shader, the Program object was checking for the register index, which could have been larger or equal to MAX_VERTEX_TEXTURE_IMAGE_UNITS or MAX_TEXTURE_IMAGE_UNITS, making the shader compilation fail erroneously. Changed sampler arrays to maps in order to get the sampler data from the register index. Change-Id: Iba6cbf0dbbcdbd926f2670af4413710550e341a9 Reviewed-on: https://swiftshader-review.googlesource.com/15428Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 19 Dec, 2017 12 commits
-
-
Nicolas Capens authored
Change-Id: I68d7dbb445eee85e8a2ff4ac3a6fc6b31c6ea305 Reviewed-on: https://swiftshader-review.googlesource.com/15369Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: I9c01d1a20920ab7e33d979fc69711c7e69113912 Reviewed-on: https://swiftshader-review.googlesource.com/15368Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
We can avoid adding the base level to the computed lod by putting the base level at index 0 of the mipmap array. Change-Id: I0bdebec3e4d0a3617dea9e3d28fdeb5dae40444b Reviewed-on: https://swiftshader-review.googlesource.com/15329Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: I611815fb0dcbba97e67f3c146dffb463f133447e Reviewed-on: https://swiftshader-review.googlesource.com/15248Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
The 'top' level is the last valid mipmap level nearest to the top of the pyramid. Start searching for it from the 'base' of the pyramid. Change-Id: I2d2ea3a1834f6cff2e2d342876d0649205004581 Reviewed-on: https://swiftshader-review.googlesource.com/15348Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: Ibc557e4843d8106c07ae2f92c9628e10f228b1ae Reviewed-on: https://swiftshader-review.googlesource.com/15208Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
The OpenGL ES 3.0.5 spec section 3.8.10.5 states: "For cube map textures an INVALID_OPERATION error is generated if the texture bound to target is not cube complete". Change-Id: I4304ecf125528b9406a011a95d7822b1f868ee14 Reviewed-on: https://swiftshader-review.googlesource.com/15328Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
Updated glGetProgramBinary and glProgramBinary in order to properly reflect that SwiftShader doesn't support any binary format. Fixes dEQP-GLES3.functional.negative_api.shader.get_program_binary Change-Id: I068ce7eb7ce824719cecca2fdc651a9e6c14190c Reviewed-on: https://swiftshader-review.googlesource.com/15330Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: If37158efec1555a3b4e14774dff081f284292245 Reviewed-on: https://swiftshader-review.googlesource.com/15308Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: Ifa2239e897cfa8878a43ce6e51ab731f2b67b7b1 Reviewed-on: https://swiftshader-review.googlesource.com/15288Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: I93171764df5e13a7a5be6a9116e1a5db1ed59ad5 Reviewed-on: https://swiftshader-review.googlesource.com/15268Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
<unordered_map> is not available on Android J-L. Bug b/28006371 Change-Id: I7e06ebef092a7d3eef217f88e6fb6347c8d40ac1 Reviewed-on: https://swiftshader-review.googlesource.com/15149Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 18 Dec, 2017 8 commits
-
-
Alexis Hetu authored
Since EAC is no longer decoded to an 8 bit format, but ETC2 alpha still is, we need to distinguish between the 2. Added an argument to DecodeBlock for that purpose. Change-Id: Ied4263cecc43f88609a357437c11f4e43af229b8 Reviewed-on: https://swiftshader-review.googlesource.com/15228Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
The convert_float_int was not scaling the [0,1] value to the full 1.31 fixed-point range before clamping the value. Fixes all failures in: dEQP-GLES3.functional.state_query.floats* Change-Id: Ic558eb45f1f351d3c30a0a5047a1b252edb56bd0 Reviewed-on: https://swiftshader-review.googlesource.com/14968Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
Note that glReadPixels() does not perform sRGB conversion. Change-Id: I3f9089b79652ce42cb5695d5b6a8ce92d15c27a8 Reviewed-on: https://swiftshader-review.googlesource.com/14492Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: Ife3342c64dfc846f8b7722f2e80612fc71f93688 Reviewed-on: https://swiftshader-review.googlesource.com/15128Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: Idba9017de6bf92142e2281bdca3cb6c73ea2451d Reviewed-on: https://swiftshader-review.googlesource.com/14491Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Previously sRGB data was converted to linear space on upload. This caused a loss of precision. This change performs the conversion after texel lookup. Note that we had a code path for performing the conversion after filtering, but that leads to failures in dEQP and unacceptable darkening between texels. Also, glTexSubImage calls can update sRGB textures using a format/type combination with no indication of the color space, which caused an unintentional conversion on upload. Likewise we were missing support for an A2B10G10R10UI implementation format. Change-Id: Ib10845f628fb2d1849e88d7a9350868cdec32fa2 Reviewed-on: https://swiftshader-review.googlesource.com/15068Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
- Updated preprocessor code from Angle revision 9fc8733187c02470a9eadb6d295348b6d37a2004 - Reran generate_parser.sh (flex 2.6.4, bison (GNU Bison) 3.0.4) - Made a few trivial changes in src/OpenGL/compiler in order to adapt to the new preprocessor code. Fixes all 24 failures in: dEQP-GLES3.functional.shaders.preprocessor.* Change-Id: I00d0b511d617ab81a0f57310174e1ba8bf7c22e5 Reviewed-on: https://swiftshader-review.googlesource.com/15109Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
The ETC2 decoder spec has a slight difference with the EAC decoder spec when it comes to handling the 0 multiplier corner case. For ETC2, we have (OpenGL ES 3.0 spec, section C.1.3): "An encoder is not allowed to produce a multiplier of zero, but the decoder should still be able to handle also this case (and produce 0 x modifier = 0 in that case)." For EAC, we have (OpenGL ES 3.0 spec, section C.1.5): "If the multiplier value is zero, we should set the multiplier to 1.0/8.0" In order to take this into account, the EAC decoded output can no longer be represented by an 8 bit value, but must be represented by a minimum of 11 bits, as the spec requires. For now, the EAC decoder decodes EAC into a 32 bit integer format, which then gets converted to a 32 bit float format internally. Eventually, it would be possible for the EAC decoder to decode the image to a signed 16 bit integer internal format, if it was supported. Fixes all failures in: dEQP-GLES3.functional.texture.wrap* Change-Id: I32106383ade56e375229231ff230a2574791caa6 Reviewed-on: https://swiftshader-review.googlesource.com/15188Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 14 Dec, 2017 7 commits
-
-
Nicolas Capens authored
Change-Id: I879eb3c3d9093f769f88bd3a2dcc67f91bd6eb47 Reviewed-on: https://swiftshader-review.googlesource.com/15049Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Fixes (suppresses) Visual Studio 2017 warning (error) about std::tr1. Change-Id: I3319dfa77d00e81e48ef7ef0ab884e131e9a039e Reviewed-on: https://swiftshader-review.googlesource.com/15048Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
This stores the layer as part of the framebuffer object, instead of the renderbuffer, and passes it to the renderer at draw time. Change-Id: I947f8a58ba7a119cc9d890659c99e7e05d0d1d91 Reviewed-on: https://swiftshader-review.googlesource.com/14728Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
This adds the ability to render to a specific layer of a 2D array texture. Change-Id: I3055d62c9964b2729704785efb068b82eef4f9ce Reviewed-on: https://swiftshader-review.googlesource.com/14668Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
Previously, multisampled images used the 'depth' member of 3D images or 2D arrays as the number of samples. This caused rendering to a layer of a 2D array to be interpreted as rendering to a multisampled render target. This change adds a 'samples' member which is orthogonal to 'depth'. Note that write operations put the same color into each of the samples, while read operations (still) assume multisampled images have been resolved into the first slice. Change-Id: Ib33a0cf8194e19fcbb569b0c257ba1e1bd9c4821 Reviewed-on: https://swiftshader-review.googlesource.com/14808Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
The stencil buffer always has a quad layout, and can't be copied using copyBuffer() even when copying the full buffer, because it copies one row at a time (i.e. it assumes a linear layout). Likewise a depth buffer may optionally have a quad layout and copying the full buffer still doesn't allow using copyBuffer(). To keep maximum performance for the typical case of copying between equally sized buffers, a new code path it added to copy the entire slice in one memcpy() call. Change-Id: I77f60f66e5cdcd7cf0a73d03f3d3485809d7ebe6 Reviewed-on: https://swiftshader-review.googlesource.com/15008Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Several depth-only formats were implemented using depth+stencil formats. This resulted in unintended stencil operations happening, as well as unnecessary allocations and blitting of stencil data. This change also introduces quad-layout depth+stencil formats for more efficient rendering. Note that as before the 'internal' buffer's format also indicates the presence of a stencil component, even though it only stores the depth component, while the 'stencil' buffer now has an S8 format or NULL for a depth-only format. Change-Id: I245f0cb5a999851e24082f3ab1ea78a5f5956af3 Reviewed-on: https://swiftshader-review.googlesource.com/14988Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 13 Dec, 2017 1 commit
-
-
Alexis Hetu authored
drawBuffer and readBuffer default to GL_BACK in the default Framebuffer, but for all other Framebuffer objects, the default value should have been GL_COLOR_ATTACHMENT0. Fixes all failures in dEQP-GLES3.functional.state_query.integers* Change-Id: I060db67c50561d2678d57de1d7067bd7f8d2a53a Reviewed-on: https://swiftshader-review.googlesource.com/14948Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 12 Dec, 2017 3 commits
-
-
Alexis Hetu authored
Added pureInteger member to VertexAttribute in order to keep track of whether the attrib was set using glVertexAttribIPointer or glVertexAttribPointer and properly return that state when querying GL_VERTEX_ATTRIB_ARRAY_INTEGER. Fixes dEQP-GLES3.functional.state_query.shader.vertex_attrib_integer Change-Id: Ie6cfcd2008f7abb61d457a41124600fe7cea229a Reviewed-on: https://swiftshader-review.googlesource.com/14828Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
The typeSpecifier.array check was doubled inside and outside of the mShaderVersion check. The typeSpecifier.array check should only be done when mShaderVersion < 300. Fixes dEQP-GLES3.functional.state_query.shader.program_active_uniform_types Change-Id: I2907676c346a9f53d4f8c8da172b7ce0bc7b4083 Reviewed-on: https://swiftshader-review.googlesource.com/14848Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
VertexAttribute objects should have a default size of 4. Fixes dEQP-GLES3.functional.state_query.shader.vertex_attrib_size Change-Id: I597d2095f7be087f35a4adfb01bb2a3ba5200701 Reviewed-on: https://swiftshader-review.googlesource.com/14928Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 08 Dec, 2017 3 commits
-
-
Nicolas Capens authored
If the format and internalformat parameters are the same, only the combinations in Table 3.3 of the OpenGL ES 3.0 specification are valid. GL_RGB10_A2 and GL_RGB10_A2UI have GL_UNSIGNED_INT_2_10_10_10_REV type. GL_OES_vertex_type_10_10_10_2 is a vertex attribute type, part of the GL_OES_vertex_type_10_10_10_2 extension. GL_RGB10_A2 internal format is valid for glReadPixels with a combination of format GL_RGBA and type GL_UNSIGNED_INT_2_10_10_10_REV. Change-Id: I590b43fcf9f1dc4beee9a64b45fe94fd74388b7a Reviewed-on: https://swiftshader-review.googlesource.com/14788Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
The read buffer state is part of the framebuffer object, so determining the index is moved to the Framebuffer class. Also make sure GL_NONE is handled without causing invalid access by using GL_INVALID_INDEX. Change-Id: I26476024cd8dd820b0e3f53d9c3dd5a7d46c082e Reviewed-on: https://swiftshader-review.googlesource.com/14748Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: I62047cd0bf6c9f066e7a63c1316288d227caa9aa Reviewed-on: https://swiftshader-review.googlesource.com/14768Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 07 Dec, 2017 2 commits
-
-
Isaac Chen authored
Bug: 70191319 Test: $ lunch aosp_arm-userdebug; BOARD_VNDK_VERSION=current m -j $ emulator # boot to home screen Change-Id: Id19a847072f2f0b55184c183647889c1a1b53aef Reviewed-on: https://swiftshader-review.googlesource.com/14688Reviewed-by:Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
In order to avoid creating confusion between shader model and the actual shader's version, as specified by the #version token in a glsl shader, version was renamed to shaderModel. Change-Id: I481b6e3fc43168b504c2f2d9506422a697abc3a2 Reviewed-on: https://swiftshader-review.googlesource.com/14629Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-