1. 06 Jun, 2019 3 commits
    • Fix image sampling with divergent LOD · 8ac0bd6c
      Nicolas Capens authored
      Currently our SamplerCore code performs sampling for four SIMD lanes
      simultaneously. With implicit LOD calculation for fragment shaders, all
      four pixels in a quad share the same LOD and thus sample from the same
      mipmap level. But for the vertex shader the LOD is always explicitly
      provided, and can vary significantly between completely unrelated
      vertices. Previously we only used the LOD of the first one in each group
      of four.
      
      As a workaround, process explicit-lod sampling instructions in a
      lane-by-lane manner.
      
      Bug: b/133868964
      Tests: dEQP-VK.glsl.texture_functions.*
      Change-Id: If4e0d3c04d29529300111d73801124080cb4b544
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/32488
      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 avatarAlexis Hétu <sugoi@google.com>
      Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
    • Add missing files to LLVM's Build.gn · 7e95471a
      Saman Sami authored
      MCWasmObjectTargetWriter and TargetIntrinsicInfo never appear in the
      file. ARMTargetStreamer is declared on all platforms so move it from
      the ARM-only target to the shared target.
      
      Bug: chromium:971333
      Change-Id: I04229323af68e5b4d24a1d5ad6524c96460108eb
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/32428Tested-by: 's avatarSaman Sami <samans@chromium.org>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
    • Better 32 bit Windows Fix · f9e9cf6e
      Alexis Hetu authored
      The initial issue that the workaround was fixing was that, on x86,
      there are various C calling conventions (__stdcall, __fastcall,
      __vectorcall) that mangle in the number of bytes used to pass the
      parameters. Both Clang and the Visual Studio compiler were crashing
      while attempting to calculate the number of bytes necessary so that
      it can mangle the name of the function. It needs the mangled name
      to emit deviceFunctionPointers, which is some large table of
      function pointers. The crashes happened because not all of the
      parameters of the function in question are complete, i.e. some of
      them are uninstantiated templates or forward declarations.
      
      The fix is then to include template instantiation directly into
      the VK_DEFINE_NON_DISPATCHABLE_HANDLE macro. Because template
      instantiation of an already specialized template causes a warning
      (treated as an error in Chromium), an extra layer of indirection
      was added to make sure we don't hit this issue.
      
      Bug b/129979580
      
      Change-Id: Id811b107be51f494f45fab2ff0cec18e7cfbafaf
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/32449
      Presubmit-Ready: Alexis Hétu <sugoi@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
  2. 05 Jun, 2019 1 commit
  3. 04 Jun, 2019 2 commits
  4. 03 Jun, 2019 6 commits
  5. 02 Jun, 2019 1 commit
    • Address cubemap faces as consecutive layers · bb575d48
      Nicolas Capens authored
      Vulkan cubemaps use six consecutive layers for the faces, so we can
      reuse the same addressing logic as for 2D array textures. Hence the
      3D lookup vector becomes a 2D coordinate plus layer coordinate after
      projection. The only difference is we don't have to clamp to the range
      of layers.
      
      This simplifies the sampled image descriptor since we only have to store
      a single pointer per mipmap level. We also avoid the per-lane lookup
      (gather) operation. YCbCr sampling was adjusted to not use the same
      array of buffer pointers.
      
      Also eliminate the unused lodOrBias parameter from computeLod*(). It's
      added afterwards.
      
      Bug: b/134164485
      Bug: b/129523279
      Change-Id: I5c349ff458aabb1d77e32104429b635d96237292
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31088Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
      Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
  6. 31 May, 2019 2 commits
    • BuiltInPointCoord implementation · 95b1db96
      Alexis Hetu authored
      BuiltInPointCoord is defined as:
      
      "The following formulas are used to evaluate s and t:
      
      s = 1/2 + (xp - xf) / size
      t = 1/2 + (yp - yf) / size
      
      where size is the point’s size; (xp,yp) is the location at which the
      point sprite coordinates are evaluated - this may be the framebuffer
      coordinates of the fragment center, or the location of a sample; and
      (xf,yf) is the exact, unrounded framebuffer coordinate of the vertex
      for the point."
      
      So it was implemented by writing (xf,yf) in SetupRoutine, where this
      information is present and using the fragment's x and y coordinates
      as (xp,yp), which passes the test.
      
      Tests: dEQP-VK.glsl.builtin_var.simple.pointcoord
      
      Change-Id: I9146349bcce0f7c31dd0464c0f210a7306d5d033
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31992
      Presubmit-Ready: Alexis Hétu <sugoi@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
      Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
    • 32 bit compilation fixes for Visual Studio · 5e3c9d53
      Alexis Hetu authored
      This cl fixes all issues related to building Vulkan using the x86 compiler in Visual Studio:
      - Added dummy function to prevent compiler crash in VkGetProcAddress.cpp
      - Added missing WIN32 check in SwiftShader's Vulkan unit tests
      - Removed alignment code which broke Win32 DLL. Removing all of it should work on all other
        platforms as well.
      
      Minor nit fix:
      - Renamed VkWrapper to VkNonDispatchableHandle, which is a more accurate name.
      
      Bug b/129979580
      
      Change-Id: Ib2bf305433e9aae71ff6f9d796fb86bc7ea733b0
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31609Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
      Presubmit-Ready: Alexis Hétu <sugoi@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
  7. 30 May, 2019 2 commits
  8. 29 May, 2019 11 commits
  9. 28 May, 2019 12 commits