1. 18 Sep, 2019 3 commits
  2. 17 Sep, 2019 1 commit
  3. 16 Sep, 2019 6 commits
  4. 13 Sep, 2019 3 commits
  5. 12 Sep, 2019 6 commits
    • [memfd] Create support class for Linux memfd-backed region. · c9fa9fe9
      David 'Digit' Turner authored
      This creates a new helper class to allocate memfd-backed shared
      memory regions with the Linux kernel. The feature has been
      supported since at least Linux 3.17, which is sufficient for
      a large number of desktop Linux and Android devices.
      
      However, only recent version of GLibc or the Android C library
      expose memfd_create(), so keep implementing it as a direct syscall.
      
      NOTE: There is a similar function named memfd_create() inside
            of src/Reactor/ExecutableMemory.cpp, but it is easier to
            keep them separate for now to avoid introducing subtle
            dependency issues in the CMakeLists.txt file.
      
      This will used in future CLs that implement Vulkan external
      semaphores and external memory on Linux and Android for SwiftShader.
      
      Bug: b/140419396
      
      Change-Id: I378c34760930d8fef7d0659128ededb5227c323f
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35128Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarDavid Turner <digit@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
    • Assert Reactor Float constants are finite · d94d6a3d
      Nicolas Capens authored
      C++11 does not have a way to write an infinite or NaN literal, nor does
      it allow division by zero as a constant expression. Thus we should not
      accept inf or NaN as a Reactor Float constant, as this would typically
      indicate a bug, and avoids undefined behavior.
      
      This also prevents the issue of the LLVM JIT only taking double values
      for constructing floating-point constants. During the conversion from
      single-precision to double, a signaling NaN can become a quiet NaN, thus
      altering its bit pattern. Hence this assert is also helpful for
      detecting cases where integers are being reinterpreted as float and then
      bitcast to integer again, which does not guarantee preserving the
      integer value.
      
      Should infinity and NaN constants be required, methods like infinity(),
      quiet_NaN(), and signaling_NaN() should be added to the Float class.
      
      For cases where binary float data must be preserved exactly, one can
      construct a Reactor Int value and bitcast as Float.
      
      Bug: b/140302841
      Change-Id: I72cf7e6fe82913cffcb1e0de282bc6839f65226d
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35868
      Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
    • Fix construction of SPIR-V constant float objects · baf328ab
      Nicolas Capens authored
      Constructing a constant SIMD::Float is not guaranteed to preserve the
      data's exact bit pattern, but SPIR-V provides 32-bit words representing
      "the bit pattern for the constant". Thus we must first construct an
      integer constant, and bitcast to float.
      
      Bug: b/140302841
      Change-Id: I1a84dab9d1adbdc15f8a3b2fc639c637d2841174
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36208
      Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
    • Fix passing sampler offset operands unchanged · a070dcf0
      Nicolas Capens authored
      All sampler operands are passed through an array of float values. Offset
      operands are integers, but we were retrieving them from the SPIR-V
      constant object interpreted as floating-point data, and then creating
      Float constants from them. This may alter their bit pattern,
      specifically values corresponding to sNaN may become qNaN.
      
      Instead create Reactor integer constants and bitcast them to Float.
      
      Bug: b/140302841
      Change-Id: I06aceb7b2a97d5f5ce9009f5ba97238602cdc126
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35910
      Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
    • Fix storing of non-float SPIR-V constants · dc550b2d
      Nicolas Capens authored
      Reactor Float scalar and vector constants may not fully preserve the
      bit pattern of the values they were constructed from. Specifically,
      signaling NaN values (sNaN) may become quiet NaN values (qNaN). Thus
      they should not be used for storing SPIR-V constant objects to memory.
      Interpret the data as integer instead. Note Object::constantValue is
      already a uint32_t array.
      
      Bug: b/140302841
      Change-Id: Ifd51eec9d2b7adab8fef5de74e2e30d080a28fd5
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35909
      Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
    • Fix non-float constant creation for ASM · b1d3bbfc
      Nicolas Capens authored
      Despite the name, PARAMETER_FLOAT4LITERAL is used for integer and
      Boolean constants in the ASM representation of GLSL compiled shaders.
      Reactor can turn sNaN values into qNan when constructing Float
      constants, and thus integers bitcast from a float which were initialized
      from a reinterpreted integer may not preserve its original bit pattern.
      
      Instead construct the Float register values from Reactor Ints which are
      bitcast to Float.
      
      Bug: b/140302841
      Change-Id: I4d915851c430dee4a752e06be0011c10d89fb79d
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35888
      Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
  6. 11 Sep, 2019 4 commits
  7. 09 Sep, 2019 2 commits
  8. 07 Sep, 2019 9 commits
  9. 06 Sep, 2019 3 commits
  10. 05 Sep, 2019 3 commits
    • Suppress 32-bit MSVC warning. · 5d0faf9b
      Jamie Madill authored
      ../../third_party/SwiftShader/src\Yarn/Pool.hpp(254): note: see reference to function template instantiation 'std::shared_ptr<yarn::BoundedPool<sw::DrawCall::BatchData,16,yarn::PoolPolicy::Preserve>::Storage> std::make_shared<yarn::BoundedPool<sw::DrawCall::BatchData,16,yarn::PoolPolicy::Preserve>::Storage,>(void)' being compiled
      C:\dev\depot_tools\win_toolchain\vs_files\418b3076791776573a815eb298c8aa590307af63\win_sdk\bin\..\..\VC\Tools\MSVC\14.16.27023\include\memory(1866): warning C4316: 'std::_Ref_count_obj<_Ty>': object allocated on the heap may not be aligned 16
              with
              [
                  _Ty=yarn::BoundedPool<sw::DrawCall::BatchData,16,yarn::PoolPolicy::Preserve>::Storage
              ]
      
      ../../third_party/SwiftShader/src/Vulkan/VkQueue.cpp(122): warning C4316: 'sw::Renderer': object allocated on the heap may not be aligned 16
      
      Bug: angleproject:3876
      Bug: b/140251624
      Bug: b/140575360
      Change-Id: I3016b8ba4e6557c9b7f1c27a387f03ff307e17de
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36048Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
      Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
    • Fix GN/Chromium build. · 9746f8bf
      Jamie Madill authored
      This fixes the GN header check with Yarn. Enables further ANGLE
      integration. Also fixes a number of MSVC build errors and changes
      the output name of the Vulkan ICD on Windows to "vk_swiftshader"
      so that it matches the .def file used in CMake.
      
      Bug: angleproject:3876
      Bug: b/140251624
      Change-Id: Ie23ba965a2ee7f8b678499db22d6614f0a6666fa
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36009Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
    • Initial drop of Marl @ d3b8558c · e9ba0a9d
      Ben Clayton authored
      Commands:
      git subtree add --prefix third_party/marl https://github.com/google/marl d3b8558ce8d2cf2cad1009a99aa3ff453b048639 --squash
      
      To update:
      git subtree pull --prefix third_party/SPIRV-Tools https://github.com/KhronosGroup/SPIRV-Tools <sha> --squash
      
      Bug: b/140546382
      Change-Id: If3471eb3897b128613c874a9260e0ac390d27cf1