- 04 Jan, 2018 2 commits
-
-
Alexis Hetu authored
Because samplers can be stored within structures, register allocation of entire structures within the samplers registers was pushing sampler indices outside of the allowed limit. In order to solve this, sampler registers now exclusively contain samplers, and utility functions to compute sampler only type size were added to make this possible. Bug chromium:797264 Change-Id: Ic5a6f09665c39661944444cd736547bce4dff2ab Reviewed-on: https://swiftshader-review.googlesource.com/15728Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Krzysztof Kosiński authored
This also improves GetProcAddress performance by using binary search instead of linear search. Fixes bug b/20110899 Change-Id: I6c58e17f0580904338e4d806e310cccbec398f28 Reviewed-on: https://swiftshader-review.googlesource.com/15748Tested-by:
Krzysztof Kosiński <krzysio@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 03 Jan, 2018 10 commits
-
-
Nicolas Capens authored
Change-Id: I25567211a4603713ad89a1eb58aa3306b11be0ab Reviewed-on: https://swiftshader-review.googlesource.com/15689Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
-march=core2 implies support for both the SSE3 and SSSE3 instruction set extensions. Chrome should run on CPUs with only SSE2 as well. Also, make use of SSE on x86-32 for floating-point operations, to be consistent with x86-64, and don't favor any specific architecture for tuning. Bug chromium:797763 Change-Id: Ia17428734460ed855f3aa0f83c6d2f6b3775094c Reviewed-on: https://swiftshader-review.googlesource.com/15688Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
OpenGL ES 3.0 specifies that "For fixed-point depth buffers, the final fragment depth written by a fragment shader is first clamped to [0, 1] and then converted to fixed-point as if it were a window z value (see section 2.13.1). For floating-point depth buffers, conversion is not performed but clamping is." Change-Id: Ic7f22f7e47106aaa86c4916fbbbe23ad9c52e186 Reviewed-on: https://swiftshader-review.googlesource.com/15628Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
When the pixel shader writes the depth value, we can't use the interpolated implicit depth to perform a depth buffer test before the pixel shader executes. Change-Id: Icf80de50f4aa79f73b43e341c18478e7fd928b8d Reviewed-on: https://swiftshader-review.googlesource.com/15608Tested-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 LOD value was not being computed for 3D texture sampling when no mipmapping is done. We still need the LOD in case the minification and magnification filters differ. Change-Id: If32d7aaf8a92ace33bcc6ca6f0b60fe33c7e771b Reviewed-on: https://swiftshader-review.googlesource.com/15588Tested-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 array folding logic generated an error when a constant array didn't have an array of literal constants. Change-Id: I48f58936cfa7e19e0f4026fb940654f20d9a9d5e Reviewed-on: https://swiftshader-review.googlesource.com/15551Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
GLSL ES 3.00 spec says that length is only allowed on "array names", but according to https://bugs.chromium.org/p/angleproject/issues/detail?id=2142 that was not intended to be interpreted strictly and it has been clarified in GLSL ES 3.20. Change-Id: Id8944346908e1c122230fd2f94c9a26cf389498b Reviewed-on: https://swiftshader-review.googlesource.com/15550Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
Arrays of constants can be dynamically indexed, so they can't be propagated by value and handled as literals like other constants. Instead we store them in the constant register file. Change-Id: Idcee033d694b20d047c70e2d13974e5a6dce127b Reviewed-on: https://swiftshader-review.googlesource.com/15488Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
We were using a quad-layout depth format as the destination format for glReadPixels calls with GL_DEPTH_COMPONENT / GL_FLOAT format. Upload to a texture was also affected. Bug b/64542192 Change-Id: I8ad700bf86737debe3268ec6a3dbd237cd85ea1a Reviewed-on: https://swiftshader-review.googlesource.com/15548Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hétu authored
This reverts commit a141a075. Reason for revert: We need a different solution to fix this issue which doesn't require having a different sampler index and register index. Change-Id: If08a0fc4713e2bd8277630ca760bb8686a2effd2 Reviewed-on: https://swiftshader-review.googlesource.com/15649Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Alexis Hétu <sugoi@google.com>
-
- 22 Dec, 2017 1 commit
-
-
Lingfeng Yang authored
On low-resolution Android Emulator AVDs run with -gpu swiftshader_indirect, it's possible to run fast enough to see count == -1 on Resource acquisition. Check for that. bug: 70950184 Test: API 27 Chrome is usable on a 480x800 or smaller device Change-Id: I4f4cf9cd0ab1bc2bce846f0af6ffbbe243bc1a96 Reviewed-on: https://swiftshader-review.googlesource.com/15508Reviewed-by:
Lingfeng Yang <lfy@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Lingfeng Yang <lfy@google.com>
-
- 21 Dec, 2017 3 commits
-
-
Nicolas Capens authored
Unlike OpenGL ES 2.0, 3.0 allows framebuffer attachments to be of different sizes: "If the attachment sizes are not all identical, the results of rendering are defined only within the largest area that can fit in all of the attachments. This area is defined as the intersection of rectangles having a lower left of (0, 0) and an upper right of (width, height) for each attachment. Contents of attachments outside this area are undefined after execution of a rendering command (as defined in section 2.6)." Change-Id: Ib75be93650edd7d6a7f3d08d9206830094e3fbd8 Reviewed-on: https://swiftshader-review.googlesource.com/15469Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
Since OpenGL uses the last vertex, not the leading vertex, as the vertex used to select the triangle color, then the last vertex, instead of the first vertex, has to be consistently incremented for each triangle in the strip or fan. In order to make this work, when leadingVertexFirst is true, the first vertex is consistently the lowest (consistently incremented) vertex index and when leadingVertexFirst is false, the last vertex is consistently the highest vertex index. Fixes the 2 failures in: dEQP-GLES3.functional.rasterization.flatshading Change-Id: Ib2247a219fe8c6725dc141e6860ba2ff521dde8c Reviewed-on: https://swiftshader-review.googlesource.com/15468Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
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 1 commit
-
-
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>
-