- 01 Mar, 2018 5 commits
-
-
Nicolas Capens authored
Change-Id: I491411ba77addcb514944717b19918e4d1b98898 Reviewed-on: https://swiftshader-review.googlesource.com/16228Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
The surface set during bindTexImage should be unset during releaseTexImage. Failing to do so may keep a dangling pointer to the surface, which can cause a crash later on (this was hit during the testing of new unit tests which will be added soon). Change-Id: Ic258fff8c880d449add825c5e9185435cc4ea419 Reviewed-on: https://swiftshader-review.googlesource.com/17548Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
The spec mentions them as color-renderable, but our IsColorRenderable() function only handles sized internal format, and adding them there might hide bugs in our renderbuffer implementation since they can only be constructed using sized internal formats. dEQP also has a note about this inconsistency, and consequently these formats are not part of the 'mustpass' set for dEQP-GLES3.functional.state_query.internal_format. So it might be a spec oversight. Change-Id: I08ca3dad4c0b5686536dafd3ade1e855e3968aa0 Reviewed-on: https://swiftshader-review.googlesource.com/16410Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Tomasz Wiszkowski authored
Current build system assumes single arch targets to be 32bit and produces 64bit libraries in an incorrect folder. The change allows build system to determine proper location of the libraries. Change-Id: Ic95a36f7108fcae8e6f120f0853ee00e9a8926c1 Reviewed-on: https://swiftshader-review.googlesource.com/17188Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
GL_APPLE_texture_format_BGRA8888 specifies that when using the BGRA_EXT format, it "must have an RGBA internal format". Note that GL_EXT_texture_format_BGRA8888 also allows BGRA_EXT as internalformat. Change-Id: I27e032054240efe96c32e27ebbdfb3c28213b1d8 Reviewed-on: https://swiftshader-review.googlesource.com/16248Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
- 28 Feb, 2018 2 commits
-
-
Nicolas Capens authored
We were expecting R or RG internal formats, instead of L, A, or LA. Change-Id: I6ee145341819460dda262b017db6d8105860f49a Reviewed-on: https://swiftshader-review.googlesource.com/17508Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
Imported texture rectangle tests from angle and fixed all texture rectangle related failures: - Rectangle textures can be rendered to - Rectangle textures only support level 0 - Rectangle textures can't be compressed - glTexStorage2D can no longer create a texture larger than the maximum size allowed Change-Id: I089291c94aad79e244782a8d56dd224c7510d237 Reviewed-on: https://swiftshader-review.googlesource.com/16908Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Alexis Hétu <sugoi@google.com>
-
- 27 Feb, 2018 5 commits
-
-
Nicolas Capens authored
This makes it easier to use a different address, in particular the port. Also add a missing header for std::max. Change-Id: I454dd6f4a92b5d8b97625e4cb50796e9f0940009 Reviewed-on: https://swiftshader-review.googlesource.com/16668Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
glBindRenderbufferOES() doesn't require anything except a non-zero renderbuffer to create a new Renderbuffer object (it is not required to use GenRenderbuffers before using BindRenderbuffer). This had been fixed for GLES 3.0 and 2.0, but the same also applies to GLES 1.1. Note that the Context already properly handles the case where renderbuffer is zero. Bug b/25983901 Change-Id: If5e97be8027fca7c97cce5c44d063cd054443700 Reviewed-on: https://swiftshader-review.googlesource.com/17490Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
When sampling from an incomplete texture, the OpenGL spec states that (0, 0, 0, 1) will be returned to the shader from the texture lookup function. Swizzling is only described for filtered texture values. Change-Id: Ie8a02b3b0b9e571fd2f86302e777a4ff985da022 Reviewed-on: https://swiftshader-review.googlesource.com/17488Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
With the egl::Image class now only storing the sized internal format, some OpenGL ES 1.1 functionality broke because it was still expecting a base format. Change-Id: Ib41e91f371a06b2a09471ea45dd1f8f56b94091f Reviewed-on: https://swiftshader-review.googlesource.com/17468Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
GL_NONE is primarily a renderbuffer format, and GL_NO_ERROR more clearly conveys the meaning when used as a validation return code. Also, GL_NONE is not defined in OpenGL ES 1.1 (but GL_NONE_OES is, as a renderbuffer format). Change-Id: Ie1c00009c30c8d2717de15c7e27db295ecd9de1e Reviewed-on: https://swiftshader-review.googlesource.com/17489Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
- 26 Feb, 2018 5 commits
-
-
Nicolas Capens authored
Surface::resolve() currently only supports these formats. Also this change reuses the GetColorComponentType() utility function instead of using a separate switch. Effectively, signed normalized formats now return 0 samples. Change-Id: I839ffa89a63d8e1b0a40913d3b1ad13e2ce0b5a8 Reviewed-on: https://swiftshader-review.googlesource.com/16389Tested-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 weren't handling several of the format/type/internalformat combos from table 3.2 of the OpenGL ES 3.0.5 spec. In particular those where the format/type of a glTexSubImage2D() call can be used to update images with an internal format not directly corresponding to it. Some of these cases were handled using the blitter, but not all GL formats have a SwiftShader equivalent. Also, the blitter is slower than specialized C++ pixel transfer code, and the blitter's fallback path is even slower. This patch provides specialized pixel rectangle transfer code for each combination of formats. We also now only store the effective sized internal format of the images. Validation also happens using the sized internal format wherever feasible, instead of unsized formats or SwiftShader formats. Change-Id: Id55db490002ab8fc2f16f766c43b43f121e5768e Reviewed-on: https://swiftshader-review.googlesource.com/17429Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
While in general one should strive to never hit an assert, and thus we should not worry about what happens in release mode when the condition is false, there are cases in which it becomes very hard to prove that a condition will always be true. For instance when another layer is responsible for validation, but the code experiences a lot of change, it could inadvertently expose an untested bad edge case which is only detected much later. For these cases, it is wise to still perform a less harmful action than just continue. The ASSERT_OR_RETURN macro will cause a return from the calling function when the condition is false. Bug b/73656151 Change-Id: I36953bb5c477ecca67647ae1a7e2fb97e7e4fca6 Reviewed-on: https://swiftshader-review.googlesource.com/17428Tested-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 external buffer of a surface is dirty, and we're trying to lock the internal buffer (or vice-versa), an 'update' needs to happen. This resulted in us locking the internal buffer for writing, thereby marking it as dirty. This triggered an assert which checks that both buffers can't be dirty at the same time. Also, in release mode this could result in redundant updates when the external buffer is locked again. We should mark the destination buffer dirty when we're about to make sure it's up to date, so a new lock type was added which is equivalent to a write lock but without setting the dirty flag. Also, we were allocating memory for a 0x0 stencil buffer for each render target, when there's no stencil component. So return nullptr when the format is NULL. Change-Id: Ie7b5528e3eedc3c3efdf8461047e6284b7bdfc84 Reviewed-on: https://swiftshader-review.googlesource.com/16828Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
Neither GL_EXT_texture_format_BGRA8888 nor GL_APPLE_texture_format_BGRA8888 make mention of GL_BGRA_EXT or GL_BGRA8_EXT being accepted as the internalformat parameter of glCopyTexImage2D, but there's a reasonable assumption that textures with BGRA format can be used as the read color buffer. GL_EXT_texture_format_BGRA8888 does mention that the format is color-renderable, and GL_APPLE_texture_format_BGRA8888 adds it to table 3.2 (but fails to mention changes to table 3.16). Bug swiftshader:96 Change-Id: I6d18faeaded73164a2c6af87ae6109fc77825964 Reviewed-on: https://swiftshader-review.googlesource.com/17448Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
- 14 Feb, 2018 1 commit
-
-
Nicolas Capens authored
Fixes building SubzeroTest on Mac. Change-Id: I8ca1f2ea8101bec496b8e9741c38025ff932b3d6 Reviewed-on: https://swiftshader-review.googlesource.com/17189Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
- 13 Feb, 2018 1 commit
-
-
Nicolas Capens authored
Change-Id: I0c186ddd43c28a3f2c49321da23d5db44abe9dbf Reviewed-on: https://swiftshader-review.googlesource.com/17148Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
- 08 Feb, 2018 2 commits
-
-
Alexis Hetu authored
Added missing resource initialization in order to prevent getting "uninitialized value" errors when running the fuzzer. Change-Id: I342441832a159b79cbf036d7ce87f05fcaf15e8c Reviewed-on: https://swiftshader-review.googlesource.com/17128Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
Change-Id: If8871d9286ef7c4d09fd075ad5c7b707079158dd Reviewed-on: https://swiftshader-review.googlesource.com/17108Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
- 07 Feb, 2018 6 commits
-
-
Alexis Hetu authored
TParseContext::addConstVectorNode() was returning a TIntermTyped* variable of the wrong type if a swizzle was of a different size than the vector's size. When parseVectorFields() fails, fields.num is reset to 1, which no longer matches fieldString.size(), so fieldString.size() should not have been used. To avoid future errors, the proper type is now set directly within TParseContext::addConstVectorNode(). Bug chromium:796776 Change-Id: Id5e8d1b94d0a03fcf5ef6f5deeb77581bc070288 Reviewed-on: https://swiftshader-review.googlesource.com/17089Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: Ida0a270c1e0ab0900109b7d3bce90dfee9a01960 Reviewed-on: https://swiftshader-review.googlesource.com/17091Tested-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: I53def31f6e63a9cf0884715078bbf236f00f3c51 Reviewed-on: https://swiftshader-review.googlesource.com/17090Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Apply xoffset, yoffset, and zoffset at image buffer lock so we don't have to pass them down to the row loading functions as parameters. Change-Id: I055549c80b1b207df4c49f6f59ecfb8286736040 Reviewed-on: https://swiftshader-review.googlesource.com/17068Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
glCompressedTexSubImage2D() takes an internalformat parameter which is already always a sized internal format. Change-Id: Iaf783e019e08d941053d5f347ee495bdd179f1ce Reviewed-on: https://swiftshader-review.googlesource.com/17050Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
We were passing the framebuffer to the texture's copying method, where the first render target was used, instead of the read buffer. Change-Id: I344b4082f675b7e5fc6a73af31a6764ab4d3b6a3 Reviewed-on: https://swiftshader-review.googlesource.com/17049Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
- 06 Feb, 2018 2 commits
-
-
Alexis Hetu authored
Allow not specifying a fragment output location. Change-Id: I76c6e6efdff3161586f5d5422e97731969b9396c Reviewed-on: https://swiftshader-review.googlesource.com/17028Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
We were enumerating the color buffer formats by sized internal format, which is simplified and made less fragile by retrieving the base internal format and implementing the spec's validation tables more directly. Change-Id: I46d244b9ed738e927b0cb5fe6d1deebf6f0cbae5 Reviewed-on: https://swiftshader-review.googlesource.com/16988Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 05 Feb, 2018 7 commits
-
-
Nicolas Capens authored
Change-Id: Iddd32408b090f00cbae15a76cab064d699f5098b Reviewed-on: https://swiftshader-review.googlesource.com/16968Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Also remove default constructors and unused members. Bug chromium:801648 Change-Id: I822ca1e1569708ca661796ee9252bae68a0a284a Reviewed-on: https://swiftshader-review.googlesource.com/16948Tested-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 refactoring makes the code for texture image upload significantly smaller. It also aligns better with the layout of table 3.2 in the OpenGL ES 3.0 specification which lists valid format/type combinations. Custom RGB565 format handling was removed because it corresponds with a regular 2-byte per pixel memcpy. Sized internal formats were removed because a recent change fixed not using the internalformat parameter as upload format. Change-Id: Ief6c6e60c3d9a734cac241022bc95ffc88d752c8 Reviewed-on: https://swiftshader-review.googlesource.com/16568Tested-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 were using the internal format to compute the size of the pixels provided for texture image upload. They can differ in size from the format/type combination. Change-Id: I7f3cd535cdefefc3c7ec4695d35d181b43ae20a4 Reviewed-on: https://swiftshader-review.googlesource.com/16629Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Deduplicate common functions and remove unsized color buffer formats. Change-Id: I76b3b507c27c8bfa932aab64a9338e2a124a25da Reviewed-on: https://swiftshader-review.googlesource.com/16289Tested-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 were generating GL_INVALID_OPERATION when a non-compressed format is used where a compressed one is expected or a compressed one is used where a non-compressed one is expected. Instead we can generate GL_INVALID_ENUM since these enums are never valid for these calls (GL_INVALID_OPERATION is for when the enum is valid in some situations but it's currently used incorrectly). Change-Id: I9ee92a92cda0574284e709a5a745d5bb8b825a31 Reviewed-on: https://swiftshader-review.googlesource.com/16888Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
The previous fix wasn't handling the case where the same fragment output variable would go through declareFragmentOutput() multiple times, so this cl fixes it. Fixes all dEQP-GLES3.functional.shaders.random failures. Still fixes original WebGL2 conformance tests failures in: all/deqp/functional/gles3/fragmentoutput Change-Id: Ia9c4f5ed5c444ab0c020cac8be511fcaad23c55d Reviewed-on: https://swiftshader-review.googlesource.com/16928Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 01 Feb, 2018 4 commits
-
-
Alexis Hetu authored
Unsigned integers in GLSL were being parsed using the regular integer parser, so it was limited to INT_MAX. All values from INT_MAX + 1 to UINT_MAX could not be parsed properly. Also, added constant folding for the 4 bit conversion glsl functions. Fixes shader compilation issue in the Epic Zen Garden example: https://s3.amazonaws.com/mozilla-games/ZenGarden/EpicZenGarden.html (unfortunately, the screen is still black, so there are other issues left) Fixes WebGL 2 test: conformance2/glsl3/float-parsing.html Change-Id: Iae52b2c8e083f0e1a22599e5a583297b9850444d Reviewed-on: https://swiftshader-review.googlesource.com/16648Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Change-Id: Ifd2c846c274840f19c1ea8c75fda42bf5640caa4 Reviewed-on: https://swiftshader-review.googlesource.com/16808Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
SwiftShader wasn't correctly handling having no restart indices in the index buffer while having primitive restart enabled. In the WebGL 2 conformance tests, the reference image is also computed while primitive restart is on, which means that Context::drawElements() may modify the internal primitive type, so indices must be adjusted to reflect that change, even if no restart indices are present in the index buffer. Fixes all WebGL 2 tests in: all/deqp/functional/gles3/primitiverestart Change-Id: I24f129e0f7bd42b5037b74617b48a32621440ddb Reviewed-on: https://swiftshader-review.googlesource.com/16548Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB was getting queried by Chromium since GL_ARB_texture_rectangle is exposed, and if this query fails, WebGL does not get enabled. Change-Id: Ie6b40f35f0cfc4547079e303609afa3778010dd1 Reviewed-on: https://swiftshader-review.googlesource.com/16849Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Alexis Hétu <sugoi@google.com>
-