1. 26 Feb, 2018 3 commits
    • Add debug macro for returning on assert. · 9e8bfcaf
      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: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
    • Fix assert while updating surface buffers. · ae7756e0
      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: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
    • Fix glCopyTexImage support for BGRA color buffers. · 680bcf50
      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: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
  2. 14 Feb, 2018 1 commit
  3. 13 Feb, 2018 1 commit
  4. 08 Feb, 2018 2 commits
  5. 07 Feb, 2018 6 commits
  6. 06 Feb, 2018 2 commits
  7. 05 Feb, 2018 7 commits
  8. 01 Feb, 2018 9 commits
  9. 31 Jan, 2018 1 commit
  10. 26 Jan, 2018 5 commits
  11. 25 Jan, 2018 2 commits
  12. 24 Jan, 2018 1 commit