- 14 Dec, 2017 6 commits
-
-
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 3 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>
-
Alexis Hetu authored
Device::stretchRect() now supports out of bounds coordinates. To avoid linear interpolation errors, source coordinates now have to be in floating point rather than integer format. Most changes in this cl are just to accommodate that int->float change for the source rect. Fixes all (28) failures in: dEQP-GLES3.functional.fbo.blit.rect Change-Id: I8fd017e60b61f2d7d6517b0e648b324be441cddd Reviewed-on: https://swiftshader-review.googlesource.com/14648Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 06 Dec, 2017 6 commits
-
-
Alexis Hetu authored
Used range-based for loop where it was trivial to do so. This change should be noop in terms of functionality. Change-Id: I3d692cc2706f35f5b710e7539fa084365cf28af1 Reviewed-on: https://swiftshader-review.googlesource.com/14628Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: I3a239325ed802e9188839c1c743d45930643c273 Reviewed-on: https://swiftshader-review.googlesource.com/14608Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
Renderbuffer objects are defined to have an initial internalformat of GL_RGBA4, but the red/green/blue/alpha bits are 0. This inconsistency is resolved by setting the internalformat to GL_NONE but reporting GL_RGBA4 when queried. Change-Id: Ie9a342c05eaa23f81773b37ebb942ca2e5b1addb Reviewed-on: https://swiftshader-review.googlesource.com/14588Tested-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_BACK, GL_DEPTH, and GL_STENCIL are only valid for the default framebuffer, while GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT, GL_DEPTH_STENCIL_ATTACHMENT, and GL_COLOR_ATTACHMENTi are only valid for non-default framebuffer objects. Also implement the color encoding query. Change-Id: I153ae9407850a30ed14d9ae145ee3504ba71029a Reviewed-on: https://swiftshader-review.googlesource.com/14569Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
- Attribute location aliasing was allowed prior to shader version 300, so location aliasing is now possible. - Attribute binding refers to the linked location of attributes, so locations set using glBindAttribLocation() will only be returned by glGetAttribLocation() after the program is linked. Before that, it will return the location allocated during the previous glLinkProgram() call. In order to do that, an extra map was added. "linkedAttributeLocation" represents the attributes' location, as a result of linking a program. "attributeBinding" represents the attributes' future location, when the next program linking occurs. On top of that, the shader's version was not being passed down from TranslatorASM to es2::Shader, or from es2::Shader to Program, so this information also needed to be properly transferred. Fixes all failures in: dEQP-GLES3.functional.attribute_location* Change-Id: I4ba7dc7c2f6d444e805cadeb5445f5ff371c3d95 Reviewed-on: https://swiftshader-review.googlesource.com/14568Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
Textures and renderbuffers were storing both the OpenGL internalformat and the SwiftShader implementation format (i.e. sw::Format). This change removes the implementation format, only keeping it in the Image class. Change-Id: Ie6ac96f6450b9a55ea9b49c6cf4b2c0681e95522 Reviewed-on: https://swiftshader-review.googlesource.com/14528Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 05 Dec, 2017 2 commits
-
-
Nicolas Capens authored
Change-Id: Ib153f6af75c982fae0325a104da3c0a4fc9ee9dc Reviewed-on: https://swiftshader-review.googlesource.com/14548Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
- Use internalformat parameter if valid, instead of deriving from format/type parameters. - Validate format/type/internalformat parameters in CopyTexSubImage(). - Moved early-out optimizations after validation. - Removed duplicate validation. - Use GLint consistently for internalformat parameters. Change-Id: I377c6bb5381602d13d281f19985aa4f11d201099 Reviewed-on: https://swiftshader-review.googlesource.com/14488Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 04 Dec, 2017 2 commits
-
-
Alexis Hetu authored
- Added *ALPHA8*/*LUMINANCE8* formats and *_SNORM formats to non color renderable formats - Added a new function IsMipMappable in order to allow mipmapping of the *ALPHA8*/*LUMINANCE8* formats Fixes all (24) failures in: dEQP-GLES3.functional.texture.mipmap.2d.generate* dEQP-GLES3.functional.texture.mipmap.cube.generate* Also fixes WebGL test: conformance/textures/misc/texture-npot.html Change-Id: I5f3210094fbc5b2e5bae25c88a5ef4f1ffb69cbd Reviewed-on: https://swiftshader-review.googlesource.com/14130Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
Because of the 3 reserved uniforms used for gl_DepthRange, the number of uniforms allowed in fragment and vertex shaders was too small by 3, so their allowed number was increased by 3. As for attributes and varyings, their numbers needed to be increased in order to pass all OpenGL ES 3.0 dEQP tests. Change-Id: I6527334e1503c08281303915654087cbac8089a0 Reviewed-on: https://swiftshader-review.googlesource.com/4034Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 01 Dec, 2017 14 commits
-
-
Nicolas Capens authored
Change-Id: I29e493f91df9ebef948b02096421102eb328d545 Reviewed-on: https://swiftshader-review.googlesource.com/14490Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Drawing without a current program is not an error and we can early-out, but not until after other validation which could generate an error has completed. Validation happening on a valid program happens afterwards though. Likewise, providing insufficient vertices for even one primitive results in drawing nothing, but validation still needs to happen. Change-Id: I5385ffe352fc38343caa41eb99f5549472da3b4f Reviewed-on: https://swiftshader-review.googlesource.com/14489Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
Added some validation for uniforms and uniform blocks. Fixes some failures in (only 1 failure left): dEQP-GLES3.functional.negative_api.state* Change-Id: I507c7e8784230f85b0d312d162e5ff82bdbd15ed Reviewed-on: https://swiftshader-review.googlesource.com/14428Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: I03a369139b733a75a7790e65afc514b929e32090 Reviewed-on: https://swiftshader-review.googlesource.com/14468Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
Bug chromium:769026 Change-Id: I059117a0209e3ac13877736abafe3599310f0670 Reviewed-on: https://swiftshader-review.googlesource.com/14448Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
The addressing is offset by 1 to account for the border. Note that this could be avoided by locking at (0, 0) instead of (-1, -1) instead, but then negative address offsets have to be allowed and this complicates the subsequent calculations and only unsigned extension from 32-bit to 64-bit is typically for free during memory accesses. Change-Id: I5fb843401d440a9d77d141782124a9c260765830 Reviewed-on: https://swiftshader-review.googlesource.com/13289Tested-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 border addressing mode should ideally blend with the border color when using linear filtering. Until we have a border of pixels around 2D textures, we should probably avoid bleeding pixels from the opposite edge and just clamp the coordinates. Change-Id: I7afbb629998732b62413e00ba7bcd55340c7b9bb Reviewed-on: https://swiftshader-review.googlesource.com/14289Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
Change-Id: Ic259645ab7950b0b2800964bbfd14f3294de50b1 Reviewed-on: https://swiftshader-review.googlesource.com/14288Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
The cube texture borders will be used for linear interpolation, in order to produce seamless edges. Change-Id: Idd17c72c6aaf7dcc65188b065ac8ba179b58cc37 Reviewed-on: https://swiftshader-review.googlesource.com/8209Tested-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
Borders are required to support seamless cubemap sampling. Subsequent patches will fill the borders with pixels from adjacent cube faces. The border is expressed in pixels and is added on all edges, resulting in an image of dimensions (width + 2 * border) x (height + 2 * border). The surface still exposes dimensions of width x height through the API and points to the same pixel when locked. Change-Id: I06d5121267ce1a2c50e628490d8690de71bfeb08 Reviewed-on: https://swiftshader-review.googlesource.com/8208Tested-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Uses 0, -1 offsets instead of 0, 1 to be able to use it as a mask. Optimize calculation of the integer coordinates and fraction by always having xyz1 = xyz0 + 1 (before wrap). Optimize the clamping/wrapping of the integer coordinates. Skip addressing operation of the third component for cube sampling (since already projected to 2D face). Change-Id: If2e7c74aac9ae923a0c1ffc278fcdfec00f216f3 Reviewed-on: https://swiftshader-review.googlesource.com/14269Tested-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: I35cd9c9e4510529a324f6bd3dfd91e56b834cbca Reviewed-on: https://swiftshader-review.googlesource.com/14268Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
We previously computed the LOD of cube maps using the 3D Euclidean distance between the intersections of the sampling rays of a quad with the cube. This underestimates the gradient at the edges where these rays intersect multiple faces. Instead use the Manhattan distance. This may overestimate the footprint dimensions, but only leads to slight blurring instead of aliasing. Change-Id: I5ddbb39765462b1c55c4143b5806154cbdfe7130 Reviewed-on: https://swiftshader-review.googlesource.com/5173Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Previously the derivatives in y were computed using the difference between the second and fourth pixel in the quad. For consistency with the x derivative, use the first and third pixel instead. Also, some shuffling can be eliminated by having the x derivative in the y component, and the y derivative in the z component. Change-Id: I985dcd3c5e2c47c10caf020cf5cb79587b3b3aab Reviewed-on: https://swiftshader-review.googlesource.com/14168Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-