History log of /external/swiftshader/src/Renderer/Surface.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ae7756e000b6eccf7f9c4a5410c3c29e16b1eb06 22-Feb-2018 Nicolas Capens <capn@google.com> Fix assert while updating surface buffers.

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/16828
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
26a867586fab18872c7a379b4e443a7448d16382 31-Jan-2018 Nicolas Capens <capn@google.com> Support compressed textures unconditionally.

Change-Id: Ifd2c846c274840f19c1ea8c75fda42bf5640caa4
Reviewed-on: https://swiftshader-review.googlesource.com/16808
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
67fdd834b8df137da2edf8a767bfaf51cf0bfecd 21-Dec-2017 Nicolas Capens <capn@google.com> Clamp unsigned floating-point formats.

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/15448
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
a6bc61d61d6fe9551d72f917629bf6bccfeafce0 20-Dec-2017 Nicolas Capens <capn@google.com> Use half-precision for special internal formats.

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/15410
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
975adb73358867b1dcdabf7f718c1220d5fe7407 19-Dec-2017 Nicolas Capens <capn@google.com> Rename signed normalized formats.

Change-Id: I9c01d1a20920ab7e33d979fc69711c7e69113912
Reviewed-on: https://swiftshader-review.googlesource.com/15368
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
1efac52953d62f226bb1b1e6feb7af7db0bfceea 01-Dec-2017 Nicolas Capens <capn@google.com> Implement sRGB conversion for the fallback path.

Change-Id: Idba9017de6bf92142e2281bdca3cb6c73ea2451d
Reviewed-on: https://swiftshader-review.googlesource.com/14491
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
5555af49d0e25a373939b557762041b4d384f8ad 14-Dec-2017 Nicolas Capens <capn@google.com> Implement sRGB texture sampling.

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/15068
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
f46493fe09205383fc22ab18bbb6cc1ddcb94079 18-Dec-2017 Alexis Hetu <sugoi@google.com> Fixed EAC failures

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/15188
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
c4a3f242b8cd3b9aba21828d1299e18ddbb855c3 11-Dec-2017 Nicolas Capens <capn@google.com> Implement framebuffer layer support.

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/14728
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
bfa23b3f4de49586d2bd25efb77fa92734bd6f26 11-Dec-2017 Nicolas Capens <capn@google.com> Separate image depth and samples count.

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/14808
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
57e7cea706d4e61c1423f0516bfc223c9d51e052 14-Dec-2017 Nicolas Capens <capn@google.com> Implement missing depth/stencil formats.

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/14988
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
10c74a62ed7bcde6e4f48445bd43e2f8707c30d6 29-Nov-2017 Alexis Hetu <sugoi@google.com> Allow out of bounds coordinates in glBlitFramebuffer

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/14648
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
73e18c1b726b4b510e703715772f72450d9f8477 28-Nov-2017 Nicolas Capens <capn@google.com> Update cube texture borders when dirty.

Change-Id: Ic259645ab7950b0b2800964bbfd14f3294de50b1
Reviewed-on: https://swiftshader-review.googlesource.com/14288
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
a76a1bfdd9ee5817e99f561d6686946e2b168efa 29-Nov-2016 Alexis Hetu <sugoi@google.com> Functionality to update borders of cube textures.

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/8209
Tested-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>
/external/swiftshader/src/Renderer/Surface.cpp
9c6d52227bcdddbce7d206e9be38f719a95e7416 29-Nov-2016 Alexis Hetu <sugoi@google.com> Add support for borders around textures.

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/8208
Tested-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>
/external/swiftshader/src/Renderer/Surface.cpp
e4a88b913255e5b8f28d257e9971ffa9ab6af217 30-Nov-2017 Nicolas Capens <capn@google.com> Support 3-component integer formats natively.

Change-Id: Id48bc7a232c50b753da64cb914e75b5d590ae47d
Reviewed-on: https://swiftshader-review.googlesource.com/14369
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
426cb5e11112c9a9c3a7f145474a29e5e81463ca 20-Jul-2017 Nicolas Capens <capn@google.com> Fix clearing all samples of multisample render targets.

Only libGLESv2 was clearing all the samples of a multisample buffer.
Since all known APIs always clear all the samples, this could be
handled in the Renderer.

Bug swiftshader:77

Change-Id: Ib9adc3c61d263420ed0a0ae4828a693bd360b076
Reviewed-on: https://swiftshader-review.googlesource.com/10788
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
91dd1c4c3e28a9485139b5bdbf1d2451e8549ebb 18-Jul-2017 Alexis Hetu <sugoi@google.com> Unnormalized integer formats now all use the same path

Integer formats are: UInt32/Int32/UInt16/Int16/UInt8/Int8
The 32 bit formats required using the floating point path for precision,
while the 16 bit and 8 bit formats were going through the short integer
path. Since all formats need to be treated as Int within a 32 bit Float
in the end, this cl unifies all integer formats under the same path.

Related dEQP tests are: functional.texture.format.sized.2d.*

Bug swiftshader:76

Change-Id: Ia2e0972243290e8b1139081222a3f19ab9e65c9f
Reviewed-on: https://swiftshader-review.googlesource.com/10748
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
027288cc059bf507bc8bfb692344d6e6369c38ed 07-Jul-2017 Nicolas Capens <capn@google.com> Intialize memory to zero to silence MSan.

The MemorySanitizer tool can't instrument JIT-compiled code, so it's
unaware that the vertex processing routine writes the clip flags before
they're being read by triangle setup. This false positive can be
silenced by zeroing the memory at allocation. For good measure, zero
out all intermediate buffers.

Bug chromium:737875

Change-Id: Ic37ff5c64cb63bbddb151744af1d7dff0a254c2d
Reviewed-on: https://swiftshader-review.googlesource.com/10431
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
fc2b84d57ce0a5ec7b4173cb1f010b7d0ce1ad36 10-Jun-2017 Antoine Labour <piman@chromium.org> Synchronize in ~ImageImplementation

The egl::Image destructor synchronizes with the threads accessing that image.
However, that is too late because by the time ~Image runs, ImageImplementation
has already been destructed - concurrently with the other threads running, i.e.
data race. In particular, since those threads access virtual member functions on
Image, they may end up calling the base class ones (which are pure) instead of
the derived class ones.

So make sure to synchronize in ~ImageImplementation instead.

Bug: swiftshader:62

Change-Id: I91240d1dbb45dd126c65d86f9aecf77833b4488d
Reviewed-on: https://swiftshader-review.googlesource.com/10029
Reviewed-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
f41f0332bfb9dfbf09253bbf10f3b46e820a4f8e 30-May-2017 Nicolas Capens <capn@google.com> Avoid dummy key methods by using pure abstract classes.

Sanitizer tools desire having the vtables of any class with non-pure
virtual methods, even when none of them are called in the current
linkage unit. Work around this by making the affected classes pure
abstract and implementing them in a derived class in the respective
library responsible for creating them.

Bug swiftshader:31

Change-Id: I40046f605731eb1cc3825c1ede2d8d9b5826d0f5
Reviewed-on: https://swiftshader-review.googlesource.com/9914
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
bf7a8145635e7dc6625596be127733ac7418cf21 19-May-2017 Nicolas Capens <capn@google.com> Fix locking a destroyed mutex.

Surface should not lock the resource of a parent texture at destruction, because
it can already have been destroyed. For example when a texture's image was bound
as a render target, and the texture is deleted by the app, then the image holds
the last reference to the texture. When the render target image gets deleted, it
first releases its parent texture, and then the underlying surface gets
destroyed.

This is fixed by synchronizing, by locking and unlocking the (parent) resource,
earlier. The derived class is responsible for calling Surface::sync() before
releasing the parent resource.

Bug chromium:716803

Change-Id: Ifc3685dcf9e25e8419000af65d4bb7407f26bbcb
Reviewed-on: https://swiftshader-review.googlesource.com/9750
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
47dc8676fcff01274de3d3fe98e1de607ff076d3 25-Apr-2017 Nicolas Capens <capn@google.com> Fix ARM compilation.

This does not provide full support for ARM,
but merely makes things (statically) compile.

Bug b/37478805

Change-Id: I01d1d84e396c04c84e74d521946595014d2eafb5
Reviewed-on: https://swiftshader-review.googlesource.com/9430
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
400667e6604eb07e53a2894ede1f492fc3c0b117 29-Mar-2017 Nicolas Capens <capn@google.com> Fix floating-point color buffer support.

- Implemented GL_EXT_color_buffer_float.
- Removed duplicate glRenderbufferStorageMultisample implementation.
- Refactored internalformat validation.
- Removed GL_R11F_G11F_B10F as renderable format. OpenGL ES 3.0 only supports
this as a texture format.

Change-Id: I83ce8225c1b310006f5ce983349ea8cb8b2f7c29
Reviewed-on: https://swiftshader-review.googlesource.com/9048
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
492887ad2373092136bb9acfc5a3fc8205230933 27-Mar-2017 Nicolas Capens <capn@google.com> Refactor read pixel format/type validation.

Bug swiftshader:38

Change-Id: I74c642b3c7346541d042acde78aa2e0213beb5f6
Reviewed-on: https://swiftshader-review.googlesource.com/9028
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
69bc6e8ac26d38aec85946dbf1bc60c32fb6e5d3 20-Mar-2017 Tom Anderson <thomasanderson@google.com> Fix GCC build

This CL fixes building the 'all' target in a Chromium checkout with the following args.gn:
is_debug = false
is_clang = false
use_sysroot = false
proprietary_codecs = true
ffmpeg_branding = "Chrome"
is_component_build = true
enable_nacl = false
use_goma = true

Bug chromium:697528
Change-Id: Ie725988e8a1cb9ee672eb1e8e20d718ac91004fa

Change-Id: Ie725988e8a1cb9ee672eb1e8e20d718ac91004fa
Reviewed-on: https://swiftshader-review.googlesource.com/8888
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Tom Anderson <thomasanderson@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
147f6686abc4a3cc2d40a442bef6f3a8f9d24ec2 09-Feb-2017 Alexis Hetu <sugoi@google.com> Fixed Mac build

The Linux build fix had broken the Mac build, so the new
"typeinfo" virtual function were moved from the header files
to the source files to fix both builds simultaneously.

Change-Id: I37f5ef4bd5ec4da34a19531dcb85df6a98728aa1
Reviewed-on: https://swiftshader-review.googlesource.com/8748
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
2e363b0b42fdb3070c6c5f6c27f8622467b63717 14-Dec-2016 Nicolas Capens <capn@google.com> Consistently treat non-existant components as unsigned.

Change-Id: I6554202f899559903062155833d49fe43456149b
Reviewed-on: https://swiftshader-review.googlesource.com/8310
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
c018e08121fb7212b87aae470d6e6330f2271a4e 13-Dec-2016 Nicolas Capens <capn@google.com> Fix missing switch cases for blitting B32G32R32F.

Change-Id: I09e3615399db4db256d94ba83d44a7b6b17ee2ec
Reviewed-on: https://swiftshader-review.googlesource.com/8291
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
48ef1252cf2743b433b5f97ae748f6e22ddb66d1 07-Nov-2016 Nicolas Capens <capn@google.com> Don't use Long1 for stencil operations.

Bug swiftshader:15

Change-Id: I4fa5356109e35ac13f9f8d5a97e9059262901051
Reviewed-on: https://swiftshader-review.googlesource.com/7950
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8156
Reviewed-by: Alexis Hétu <sugoi@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
b9dda64e0e31dc5ac3eb7a19948062385a097cdb 06-Oct-2016 Alexis Hetu <sugoi@google.com> glBlitFramebuffer support for depth/stencil formats

Added support for depth and stencil formats for glBlitFramebuffer:
- Blitter now supports quad layout and stencil
- Device::stretchRect() now supports specific buffers, so that a
caller can specifically choose which buffer to copy

Change-Id: Iae0898df11e0a1d3c006113486ed15a3fd2f90a9
Reviewed-on: https://swiftshader-review.googlesource.com/7510
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
a52dfbdae4b91f970793a0e3b1df6f210e3e1312 05-Oct-2016 Alexis Hetu <sugoi@google.com> Adding functionality to stencils

Two minor features are required for the blitFramebuffer
implementation in OpenGL ES 3:
- lockStencil with x,y coordinates
- getting the stencil format (new getStencilFormat function)

Change-Id: I83ccccefe70dbbedd05b5d82bc75d30f689c4abe
Reviewed-on: https://swiftshader-review.googlesource.com/7490
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
1d672448bff04f493a553eed4181ed5e97ab5891 23-Jun-2016 Alexis Hetu <sugoi@google.com> Fixed Windows warnings

- Removed unused variables
- Removed unreachable code
- Fixed size_t <-> int conversions
- Fixed uninitialized variables

Change-Id: Ifc3912e92b8f0710094e939bd0da4757148b559a
Reviewed-on: https://swiftshader-review.googlesource.com/5681
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
7208e932c933a3b52c014e558c7f3f1d03dc80b2 02-Jun-2016 Alexis Hetu <sugoi@google.com> Moved or removed unused variables

Some variables were either unused or only used in certain contexts,
like debug or tracing, so these were either removed (when unused)
or moved to the right scope (when used conditionally).
Also fixed a string format warning and a missing case warning.

Change-Id: I2d130faa992b5dc06fb332d7404a8aebc7c121ef
Reviewed-on: https://swiftshader-review.googlesource.com/5462
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
0bac285a78df6a6d7a6b68784748b92805420ffb 07-May-2016 Nicolas Capens <capn@google.com> Apply the Apache 2.0 license.

Change-Id: I4a7aeefedcd2d891093520d5a10ebefadcddb5be
Reviewed-on: https://swiftshader-review.googlesource.com/5320
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
049a187a80a1b9f873593bf2af1b5349d6575e18 25-Apr-2016 Alexis Hetu <sugoi@google.com> SRGB implementation

The SRGB conversion code was already available, but wasn't used
specifically for the SRGB type framebuffers. Also, the SRGB
conversion should always be applied after blending.

According to the GLES 3.0 spec, section 4.1.8 - sRGB Conversion:
"the R, G, and B values after blending are converted
into the non-linear sRGB color space by computing."

All related dEQP tests pass.

Change-Id: I9342d2f74aa650f28835a951bdfa8bd371bc6924
Reviewed-on: https://swiftshader-review.googlesource.com/5189
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
dbd1a8e6cb781672840a5f7d53d162247a4dbe98 13-Apr-2016 Alexis Hetu <sugoi@google.com> Added FORMAT_X32B32G32R32F as a renderable format

Added code to properly render to alphaless floating point formats.

Change-Id: I2e226fb787d8456f61a2946fb9c0d8a9dbb58243
Reviewed-on: https://swiftshader-review.googlesource.com/5128
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
0a8d3d114c62098853277c91f62c438034bfeab6 12-Feb-2016 Nicolas Capens <capn@google.com> Fix potential division by zero.

Bug 25351344

Change-Id: Iaf0ce657a3a98c9b70902240340ed5f3f8076281
Reviewed-on: https://swiftshader-review.googlesource.com/4769
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
c39901ecf661bfef98d5c5ae9ff45e6c8dd5577e 21-Mar-2016 Nicolas Capens <capn@google.com> Refactor buffer clearing.

Bug 27460431

Change-Id: I90de3285c86c0d3187969270dcbd78a8b02feee9
Reviewed-on: https://swiftshader-review.googlesource.com/4978
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
f389861766fe7649383e740797369412adb10b19 24-Nov-2015 Nicolas Capens <capn@google.com> Pass the gralloc buffer stride to sw::Surface.

Bug 19979104

Change-Id: If9dd668b4b6a1d82b38d1840648cb578e80495bf
Reviewed-on: https://swiftshader-review.googlesource.com/4302
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
f999a00639316addd417e63b25f73663ada6e5f8 17-Dec-2015 Alexis Hetu <sugoi@google.com> Implemented support for RGB10_A2 in blitter

Added RGB10_A2 implementation in the Blitter and cases in
related Surface utility functions.

Change-Id: I2b1a9cdc1acc605085fb0f853741cc2f75bf1c9b
Reviewed-on: https://swiftshader-review.googlesource.com/4420
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
358a144979e529e157d81d90e673f590c6d611ae 03-Dec-2015 Alexis Hetu <sugoi@google.com> Fixed stencil clear

Fixed a few mistakes in the stencil clearing code to fix both
masking and scissoring. Also added a few variable in both the
depth clearing code and stencil clearing code to make them
more readable.

Bug 25971463

Change-Id: If33e2b0685fd35ef2edd31c56aea088cfbf2b430
Reviewed-on: https://swiftshader-review.googlesource.com/4335
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
2b052f89871381147870b8a868315b25a444b408 25-Nov-2015 Alexis Hetu <sugoi@google.com> Fixed stencil masking

This is odd, but stencil masking was simply disabled, so
clearing the stencil buffer would only work if the mask
was 0xFF, or it would simply skip the clearing entirely.
I removed this condition to fix the issue. Also removed
some dead code and added an early exit if the mask is 0.

Change-Id: I359b10ed3382b75cb9d078470f237e68f1a6e7b9
Reviewed-on: https://swiftshader-review.googlesource.com/4303
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
925c28279d20c3eb86dc8070bac189b7b965638a 24-Nov-2015 Alexis Hetu <sugoi@google.com> Adding RGB support to the blitter

Added both RGB8 and BGR8 formats to the blitter and related
functions so that these formats may be used with glReadPixels.

Change-Id: I22ee13f837b66af5f2135abc77fe81cc2e995fec
Reviewed-on: https://swiftshader-review.googlesource.com/4294
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
75b650f0e501750ae0ba66a435741731905dffc1 19-Nov-2015 Alexis Hetu <sugoi@google.com> Blitter clear implementation

The "clear" operation can now be done through the blitter.
The few changes are:
- The blitter now supports RGBA masking
- The blitter now supports RGB565
- When in "clear" mode, the blitter does a one read/multiple writes

The old clearing code has been deleted from Surface.

Change-Id: I970c3a0323f63ee5c89f02d94a2705e4bcf83866
Reviewed-on: https://swiftshader-review.googlesource.com/4291
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
d3a2d3d7bf4840b997fe49e40dff90ebe01b3689 22-Oct-2015 Alexis Hetu <sugoi@google.com> New read/write cases for integer types

Added new read/write functionality for integer types. Also added cases for integer types in some utility functions.

Change-Id: I5efc7c4957d3a1591b47a5df888a9534776033be
Reviewed-on: https://swiftshader-review.googlesource.com/4114
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
43577b8cc676a157ceab055ead33a441c23b2cf5 21-Oct-2015 Alexis Hetu <sugoi@google.com> Integer types support in Blitter

The blitter now supports integer types. This means:
- It supports conversions to/from integer types from/to
other already supported types.
- It supports integer to integer conversions without going
to an intermediate float format.

Also added a Blitter::GetScale() function to avoid having
2 instances of the same switch statement in the code and
added the read/write utility functions. The final Blitter
code is not longer peppered with switch statements and is,
hopefully, easier to read that way.

Change-Id: I80de519aaaa768f8cedd98f97dc4414dda75bf54
Reviewed-on: https://swiftshader-review.googlesource.com/4113
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
0de50d45bcb034864c837c27c7fc5ed2d30d80c4 09-Sep-2015 Alexis Hetu <sugoi@google.com> ETC2 decoder

A new ETC2 decoder was added to SwiftShader, based on the
OpenGL ETC2 specification. The decoder is fully standalone
and does not rely on any outside code (there are no files
included in the header and the source file only include the
header file, so it can easily be ported to any other project).

Things to note:
- In Surface.cpp, signed ETC2 images are decoded to full 32FP
images, because of the lack of support for signed 8 bit R
and RG internal formats. This should be fixed as soon as
these formats are made available.
- sRGB conversion is not performed within the decoder, so it has
been added as a loop inside Surface::decodeETC2 after the ETC2
decoding is performed. This is to make sure that there is no
loss of precision, should we choose to do the conversion to a
higher bit precision format. The loop is fairly straightforward
and does the conversion in place, so the impact on performance
compared to doing the sRGB conversion in the decoder should be
minimal.

Change-Id: I3a1af623353344bf35818ba9c9f4cf349b587e2f
Reviewed-on: https://swiftshader-review.googlesource.com/3960
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
5a86ee9424796e118fb4f378ca655d80756752c2 04-Sep-2015 Nicolas Capens <capn@google.com> Enable R5G6B5 as an internal format.

Bug 20891368

Change-Id: Iea526eebe65616079578563126a6958d87647eb1
Reviewed-on: https://swiftshader-review.googlesource.com/3255
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
0e12a92c57cda9fb03a3b01a65d3ebe9f41cc743 04-Sep-2015 Nicolas Capens <capn@google.com> Implement RGB565 multisample resolve.

Bug 20891368

Change-Id: I29054ccc0a91fdc41d26d26dd4f55dfd4dfca7e4
Reviewed-on: https://swiftshader-review.googlesource.com/3952
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
667472623f1f8a9d48c8a45c47b11c6ef537b07d 22-Sep-2015 Nicolas Capens <capn@google.com> Improve color clear precision.

Change-Id: Ib9dadf3d8fee0f63deb10e6754856c0530c928ab
Reviewed-on: https://swiftshader-review.googlesource.com/3995
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
460e41f2376f4b28503b954fa7e0aa84839ea792 01-Sep-2015 Alexis Hetu <sugoi@google.com> Handling ETC2, EAC and ASTC related enums

Note that no decoding functionality is added here.
This cl merely acknowledges textures of the ETC2, EAC
and ASTC format by handling their related enums in
SwiftShader, and the byte data is then allowed to be
passed down all the way to the Surface object, where
the decoding code will be added. Also note that this
cl does not add the extensions strings required for
ASTC support, so ASTC is still unsupported after this cl.

Change-Id: I1d8aed0fb64b0d4c72846e87410750d1e485c46b
Reviewed-on: https://swiftshader-review.googlesource.com/3938
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
8e8a7e85cb5749b2cf86c5a6756d951c433a54c9 01-Sep-2015 Nicolas Capens <capn@google.com> Implement support for YV12 texture sampling.

Bug 21572252

Change-Id: Iaf54b4d960dbc243c40f981e1c73c199481e2d28
Reviewed-on: https://swiftshader-review.googlesource.com/3930
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
56dd42fb6f9fe8fc5a2adcebca4884ca1f48f85d 28-Aug-2015 Alexis Hetu <sugoi@google.com> ETC1 fix for npot textures

Simple fix that replaces width by pitch where needed to avoid misalignment
due to the difference between pitch and width in npot textures.

Change-Id: I7acddc28fae21dddf870a6ef80ac7984cfaf8e0f
Reviewed-on: https://swiftshader-review.googlesource.com/3931
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
00555c4791ab055de3c7bf36efc607a38893efde 21-Jul-2015 Nicolas Capens <capn@google.com> Fix ETC1 decoding writing outside of internal buffer.

Bug 22632766

Change-Id: Ib2fccdd498a6da43af7bb945179b278026cdba18
Reviewed-on: https://swiftshader-review.googlesource.com/3744
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
6ea7187ce9fd7610db170a6c63a77e81aa7e92bf 26-Jun-2015 Nicolas Capens <capn@google.com> Fix texture sampling buffer overrun.

Sampling byte4 data currently reads 8 bytes for unpacking purposes.
Allocate 4 more bytes to prevent reading outside the image, even
though it's unused data.

Bug 21935792

Change-Id: I162fb3f3575131cedb008f82ef5170e773719e41
Reviewed-on: https://swiftshader-review.googlesource.com/3572
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
db17b5d40c10d9854207f9026023c55ef90149d1 26-Jun-2015 Nicolas Capens <capn@google.com> Remove image size rounding to 4x4 multiple.

Bug 21935792

Surface::size() already takes into account that compressed images
need their dimensions rounding up to whole 4x4 tiles.

Change-Id: Ie6b7b5d23294e8d3c85b3b362670cfe0c569585d
Reviewed-on: https://swiftshader-review.googlesource.com/3571
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
0085c440fbbd143181322771c980e49e9c8b99b3 12-Jun-2015 Alexis Hetu <sugoi@google.com> Fixed some warnings

- Changing "char*" to "const char*" when a
function can receive string literals
- Removed some unused variables and members
- Fixed some signed vs unsigned comparisons
- Added braces for safety on code like:
if(...) if(...) ... else ...
to make it:
if(...) { if(...) ... else ... }
otherwise the else is ambiguous
- Reordered some member initializations to
fit the declaration order in the class
- OutDir must end with a backslash in VS

Change-Id: I903bd7afac882090841da0c0f4ebb30db0a5dd37
Reviewed-on: https://swiftshader-review.googlesource.com/3501
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
477314b8f176e02423d275a7316fecc4ca0f0836 09-Jun-2015 Nicolas Capens <capn@google.com> Support creating a Surface from a user pointer.

Bug 21716622

Change-Id: Ifa5940c17932066b3860ff148be8b6b2bec726c0
Reviewed-on: https://swiftshader-review.googlesource.com/3444
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
8059442dded9441b54cc764e0ccc3a0c83120fc3 09-Jun-2015 Nicolas Capens <capn@google.com> Add support for OpenGL ES 2.0 image formats to Surface.

Bug 21716622

Change-Id: Ie416118676c984ebdd2f153b35c6f60fa616e4c7
Reviewed-on: https://swiftshader-review.googlesource.com/3443
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
3f4392422c7c081a01ed11d84aa34b8dd09e648b 09-Jun-2015 Nicolas Capens <capn@google.com> Fix color component defaults.

Bug 21716622

Change-Id: I1e07ee9b8ccfd0bd34af9b1f1d76802f3398f7ca
Reviewed-on: https://swiftshader-review.googlesource.com/3442
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
d61d3a7f2cb9e41989d2df9d08131f2d0ca522aa 26-May-2015 Nicolas Capens <capn@google.com> Compute clear colors where they'll be used.

Change-Id: I54ee6018980088d8820e35483f4be7bbf974b7ef
Reviewed-on: https://swiftshader-review.googlesource.com/3260
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
5ba566b1c847859686b65fe7719e69cd368e35ba 25-May-2015 Nicolas Capens <capn@google.com> Implement R5G6B5 clear.

Bug 20891368

Change-Id: I5c283589c1fb08003194e668c66ade4d0fe36842
Reviewed-on: https://swiftshader-review.googlesource.com/3250
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
ef77ac101553752ee0b276a94ef63be24fe78f9c 29-Mar-2015 Nicolas Capens <capn@google.com> Enable using RGBA as internal formats.

Change-Id: Ied6d934f67c05c02bf75e99ab5e58bfd3b9070e6
Reviewed-on: https://swiftshader-review.googlesource.com/2755
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
2265824443967db3003a2a875f75d3ec6d8fad96 29-Nov-2014 Nicolas Capens <capn@google.com> Implement ETC1 compressed textures support.

Bug 18559323

Change-Id: Iafa75778601436364406256602455993eb062de8
Reviewed-on: https://swiftshader-review.googlesource.com/1510
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
/external/swiftshader/src/Renderer/Surface.cpp
d4ae863d01d5f448dbbba6be4ecc161971a2324f 06-May-2014 John Bauman <jbauman@google.com> Update to June 11 2013 code drop.

This should fix the hang bug we've been seeing.
/external/swiftshader/src/Renderer/Surface.cpp
66b8ab22586debccb1f787d4d52b7f042d4ddeb8 06-May-2014 John Bauman <jbauman@google.com> Add SwiftShader dump from Feb 6 2013
/external/swiftshader/src/Renderer/Surface.cpp
8a4f6fc48ae52c79f6d3478d0bd04285700e3fcd 06-May-2014 John Bauman <jbauman@google.com> Fix crashes in SwiftShader with PPAPI

SwiftShader had been crashing on certain websites with Flash. This change prevents that.
/external/swiftshader/src/Renderer/Surface.cpp
19bac1e08be200c31efd26f0f5fd144c9b3eefd3 06-May-2014 John Bauman <jbauman@google.com> Update SwiftShader to April code dump.

April code dump from Transgaming. Adds new shader compiler.
/external/swiftshader/src/Renderer/Surface.cpp
894018228b0e0bdbd7aa7e8f47d4a9458789ca82 06-May-2014 John Bauman <jbauman@google.com> Add SwiftShader source to repo

Oct 6 code drop from Transgaming
Review URL: https://chromereviews.googleplex.com/3846015
/external/swiftshader/src/Renderer/Surface.cpp