Commit Graph

1843 Commits

Author SHA1 Message Date
Ryan Harrison 227568451b Add in --no-use flags for spvc features
BUG=dawn:344

Change-Id: Ifa9e1e3167ecfe7d38c16f393cec0443ea1589f2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16164
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-02-25 22:05:39 +00:00
Natasha Lee 17a8498982 ObjectStorage Allocate nullptr when id is 0
Bug: chromium:1052673
Change-Id: I16e39807a48f7a2c937b2a993f3a17cc8f58eac3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16161
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-02-25 19:20:15 +00:00
Corentin Wallez 73c58010c7 infra: Use macOS 10.15 and newer OSX SDK.
Bug: dawn:339
Change-Id: If25b3ace5ee6fe8d58054f9421a3417870dda750
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16200
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-25 17:12:27 +00:00
Austin Eng 6c1d646ee9 Change extern const DawnTestParam helpers to functions
If these extern variables are initialized after DAWN_INSTANTIATE_TEST,
they will be zero. Change them to be function calls instead.
Since they're function calls, fold in arguments from ForceToggles to
enable/disable toggles.

Bug: dawn:341
Change-Id: I1aeaa1e535a0a003977e8ce7ab3d5278c5d81281
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16162
Reviewed-by: Mark Henderson <mehe@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-02-25 16:23:17 +00:00
Corentin Wallez 5a921f8fad Roll third_party/swiftshader/ 8def9063c..bdfcfe9cf (11 commits)
https://swiftshader.googlesource.com/SwiftShader/+log/8def9063c4fd..bdfcfe9cfd2a

$ git log 8def9063c..bdfcfe9cf --date=short --no-merges --format='%ad %ae %s'
2020-02-24 bclayton Squashed 'third_party/SPIRV-Tools/' changes from 8aa423930..8910ea5f1
2020-02-22 thakis Fix Wrange-loop-analysis warnings in swiftshader.
2020-02-21 amaiorano Replace target_cpu with current_cpu in Build.gn files
2020-02-21 sugoi Revert "Subzero: add support for large stacks on Windows"
2020-02-19 amaiorano Subzero: add support for large stacks on Windows
2020-02-20 sugoi VK_EXT_shader_stencil_export support
2020-02-19 bclayton Remove rr::Thread
2020-02-20 capn Support JIT on a separate thread
2020-02-20 sugoi Revert "VK_EXT_shader_stencil_export support"
2020-02-13 sugoi VK_EXT_shader_stencil_export support
2020-02-14 sugoi Array length fix

Created with:
  roll-dep third_party/swiftshader

Bug:
TBR=rharrison@chromium.org
Change-Id: I7c09531a8f8d58504911b038755a6e0074ac4464

Change-Id: I47e7865cce3c1bf91f48b87aae012d6b89455bd1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-24 19:39:01 +00:00
Ryan Harrison aa5a53b2f0 Rolling 4 dependencies
Roll third_party/SPIRV-Tools/ 4a80497a8..8910ea5f1 (4 commits)

4a80497a88..8910ea5f1c

$ git log 4a80497a8..8910ea5f1 --date=short --no-merges --format='%ad %ae %s'
2020-02-23 nicolasweber Fix Wrange-loop-analysis warnings in SPIRV-Tools. (#3201)
2020-02-21 geofflang Add missing dependencies when generating spvtools_core_tables (#3199)
2020-02-21 afdx Brief guide to writing a spirv-fuzz fuzzer pass (#3190)
2020-02-21 47594367+rg3igalia Fix ignored const qualifier warning in static_cast (#3197)

Roll third_party/glslang/ c12493ff6..07e1a0a67 (1 commit)

c12493ff69..07e1a0a67a

$ git log c12493ff6..07e1a0a67 --date=short --no-merges --format='%ad %ae %s'
2020-02-22 rex.xu Fix an issue of SPV generation for imageAtomicStore.

Roll third_party/shaderc/ 738f1655a..1059f43a3 (1 commit)

$ git log 738f1655a..1059f43a3 --date=short --no-merges --format='%ad %ae %s'
2020-02-21 rharrison Rolling 6 dependencies and update expectations (#987)

Roll third_party/spirv-cross/ f19fdb94d..c5f7b5575 (5 commits)

f19fdb94d7..c5f7b55756

$ git log f19fdb94d..c5f7b5575 --date=short --no-merges --format='%ad %ae %s'
2020-02-24 post MSL: Add C API for force native arrays.
2020-02-24 post MSL: Add native array test for composite array initialization.
2020-02-24 post MSL: Reintroduce workaround for constant arrays being passed by value.
2020-02-24 post MSL: Reinstate workaround for returning arrays.
2020-02-24 post MSL: Add a workaround path to force native arrays for everything.

Created with:
  roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers

Change-Id: Ic9f459c21a9656093b5ec27e19f0744182734c7c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16120
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-02-24 19:25:38 +00:00
Corentin Wallez 1249ada986 Vulkan: Load promoted extensions or core entrypoint as needed
Previously we would always assume that if the driver supported a Vulkan
version it would also support extensions that were promoted in that
version. This is not a spec requirement, so instead try to load the core
entrypoints, and only if the version is not available, load the
extension entrypoints.

Also renames VulkanFunction members that are from promoted extension to
not have a vendor prefix.

Also tag the promoted extensions that are the same in a core version as
available when that core version is available. This simplifies checking
for features in the Vulkan backend.

Bug:
Change-Id: I0817c01b8838ba26070858abb0cbed030e3291df
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16040
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: David Turner <digit@google.com>
2020-02-24 15:08:18 +00:00
Corentin Wallez 33466973bc CMake: Add support for the D3D12 backend
Bug: dawn:333
Change-Id: I61defcd7d5a66fc728c92d1e702ed09b5c84968f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16000
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-24 13:27:28 +00:00
Austin Eng bc34d908f6 Update Vulkan headers to 1.1.125
TBR=cwallez@chromium.org
Bug: none
Change-Id: I5e63c46fabf4ba983ab375159dd63b93b0b629d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16061
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-02-21 18:34:44 +00:00
Ryan Harrison fab2158070 Rolling 5 dependencies
Roll third_party/SPIRV-Tools/ a9624b4d5..4a80497a8 (18 commits)

a9624b4d5d..4a80497a88

$ git log a9624b4d5..4a80497a8 --date=short --no-merges --format='%ad %ae %s'
2020-02-20 stevenperron Make spvOpcodeString part of the public API (#3174)
2020-02-20 danyspin97 Fix static libraries linking order (#3189)
2020-02-18 bclayton vscode: Add missing fields to schema.Opcode (#3169)
2020-02-18 siglesias spirv-val: Add support for SPV_AMD_shader_image_load_store_lod (#3186)
2020-02-14 afdx spirvfuzz: Fix type-related bug, change undef to zero, and add assert (#3188)
2020-02-11 afdx spirv-fuzz: Fuzzer pass that adds access chains (#3182)
2020-02-10 afdx spirv-fuzz: Fuzzer pass to add function calls (#3178)
2020-02-10 afdx spirv-fuzz: Ensure that donated variables are always initialized (#3181)
2020-02-06 afdx spirv-fuzz: Add fuzzer passes to add loads/stores (#3176)
2020-02-05 afdx spirv-fuzz: Fuzzer passes to add local and global variables (#3175)
2020-02-04 bclayton utils/vscode: LSP - Support OpExtInst (#3140)
2020-02-04 kubak Fix typos in opt's help. Update environment version. (#3170)
2020-02-04 stevenperron Start SPIRV-Tools v2020.2
2020-02-04 stevenperron Finalize SPIRV-Tools v2020.1
2020-02-04 stevenperron Update CHANGES
2020-02-04 afdx spirv-fuzz: Fuzzer pass to add composite types (#3171)
2020-02-04 afdx Update script that checks copyright years. (#3173)
2020-02-04 afdx spirv-fuzz: Disallow copying of null and undefined pointers (#3172)

Roll third_party/glslang/ 5e86b28ff..c12493ff6 (10 commits)

5e86b28ffb..c12493ff69

$ git log 5e86b28ff..c12493ff6 --date=short --no-merges --format='%ad %ae %s'
2020-02-17 siglesias SPV_AMD_shader_image_load_store_lod is now validated by spirv-tools
2020-02-19 lryer Fix iomapper issue
2020-02-11 cepheus Fix part of #2070: Correctly handle promotion for <unary-op>(int).
2020-02-18 swda.durl Add an option to make RTTI enabled
2020-02-06 kainino Split "is emscripten" config from "enable glslang.js"
2020-02-06 dneto Avoid enum-compare warning
2020-02-06 rex.xu Fix a parser error of GL_KHR_memory_scope_semantics
2020-01-23 kainino glslang.js: Make the SPIR-V target version configurable (1.0 ~ 1.5)
2020-02-02 timo.suoranta Fix memory corruption in TGlslIoMapper
2019-12-23 laddoc Add constant expression with mod

Roll third_party/shaderc/ 6d9f753c1..738f1655a (4 commits)

$ git log 6d9f753c1..738f1655a --date=short --no-merges --format='%ad %ae %s'
2020-02-10 rharrison Add newline to logging messages to make them readable (#985)
2020-02-06 rharrison Reduce amount of duplicated code in API implementations (#984)
2020-02-05 rharrison Add in support for spvc logging to the terminal (#981)
2020-02-05 rharrison Rolling 4 dependencies and updated expectations (#983)

Roll third_party/spirv-cross/ 6b2add8e2..f19fdb94d (4 commits)

6b2add8e2c..f19fdb94d7

$ git log 6b2add8e2..f19fdb94d --date=short --no-merges --format='%ad %ae %s'
2020-02-19 dsinclair Roll GLSLang, SPIRV-Tools and SPIRV-Headers
2020-02-14 post Reject SPIR-V modules with garbage ID bound.
2020-02-08 post HLSL: Declare undef variables as static.
2020-02-06 post Remove old memory_scope flag from iOS barriers.

Roll third_party/spirv-headers/ dc77030ac..5dbc1c321 (1 commit)

dc77030acc..5dbc1c3218

$ git log dc77030ac..5dbc1c321 --date=short --no-merges --format='%ad %ae %s'
2020-02-07 michael.kinsner Allocate three bits for upcoming Intel extension

Created with:
  roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers

Change-Id: Iad3d5f0634b56124985298fc9fe045b2c2c3986b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16080
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-02-21 17:01:54 +00:00
Brian Ho f949a10e51 Reland "Create VulkanImageWrappingTests for dma-buf images"
This relands commit 0bbfec1f7f which
was reverted in 21e5074dcd.

The original CL broke the Chromium roll because drm/drm_fourcc.h
could not be found. Still not sure why this is the case since it
seems to be present on all of my CrOS test machines, but at the end
of the day, I realized that I don't even need this header in the
first place.

This CL removes the header and relands the rest of the original CL.

Bug: chromium:996470
Change-Id: I77d6b1692094b7798f3c5d9c2b50219e674c8a8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16060
Commit-Queue: Brian Ho <hob@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-02-20 19:19:13 +00:00
Corentin Wallez b330ea6b49 Roll third_party/swiftshader/ e7ce4e539..8def9063c (283 commits)
https://swiftshader.googlesource.com/SwiftShader/+log/e7ce4e53915d..8def9063c4fd

$ git log e7ce4e539..8def9063c --date=short --no-merges --format='%ad %ae %s'
2020-02-18 cwallez Only call updateBorders on ranges that can be cubemaps.
2020-01-27 capn Fix sRGB conversion precision issues
2020-02-17 amaiorano Cache callstack results to avoid expensive lookup
2020-02-14 amaiorano Subzero: add REACTOR_EMIT_PRINT_LOCATION support
2020-02-13 bclayton third_party: Add shell script that updates marl.
2020-02-13 amaiorano Implement rr::Print support for Subzero
2020-02-14 amaiorano Subzero: fix another load from constant data
2020-02-15 swiftshader.regress Regres: Update test lists @ 348f07b4
2020-02-14 amaiorano Fix unit test when ENABLE_RR_EMIT_PRINT_LOCATION is defined
2020-01-08 jonahr Implement HostMappedForeignMemory DeviceMemory
2020-02-13 bclayton Squashed 'third_party/marl/' changes from 246091e81..a047dd0bb
2020-02-10 bclayton third_party/marl: Add mips64 support to BUILD.gn
2020-02-13 swiftshader.regress Regres: Update test lists @ ac4e1d23
2020-02-12 amaiorano Kokoro: build and run rr::Print unit tests
2020-02-11 amaiorano Fix rr::Print and add unit tests
2020-02-11 gmouse Add missed symbol __aeabi_idivmod for Android.
2020-02-12 swiftshader.regress Regres: Update test lists @ 6cbb02e0
2020-02-07 bclayton CMakeLists: Drop the explicit include path to marl
2020-02-11 bclayton Bulk clang format
2020-02-08 bclayton Change SpirvShaderInstructions.inc extension to .inl
2020-02-09 jiaxun.yang Fix MIPS build cflags
2020-02-10 bclayton Don't use std::initializer_list for array views.
2020-02-10 sugoi Support for VK_KHR_separate_depth_stencil_layouts
2020-02-07 sugoi Support for VK_KHR_create_renderpass2
2020-02-11 bclayton Revert "Add missed symbol __aeabi_idivmod for Android."
2020-02-10 gmouse Add missed symbol __aeabi_idivmod for Android.
2020-02-10 bclayton Debug: Rename levels.
2020-02-09 bclayton Squashed 'third_party/marl/' changes from 14e4d862a..246091e81
2020-02-08 bclayton Fix Android build: Add missing .cpp to Android.bp
2020-02-07 amaiorano Subzero: fix cosh/sinh deqp failures
2020-02-07 amaiorano ReactorUnitTests: fix clang-format messing up test suites
2020-02-07 bclayton Reactor: Copy System/Debug code to Reactor copy
2020-02-03 bclayton SpirvShaderDebugger: Ignore non-statements
2020-02-07 bclayton Debug: Control logging level using a compile time knob
2020-02-07 bclayton Fix chromium build.
2020-02-07 bclayton Debugging: Merge VkDebug into System/Debug
2020-02-07 bclayton VkDebug: Android - log messages to logcat.
2020-02-06 bclayton ReactorBenchmarks: Sweep coroutine perf.
2020-02-05 bclayton vscode: Add third_party/benchmark to include dirs
2020-02-05 amaiorano Fix MSAN LLVM jit false positives
2020-02-04 bclayton Disable new gcc 9 warning [init-list-lifetime]
2020-02-03 bclayton Shader: Add missing switch cases to operationString
2020-02-03 bclayton OpenGL: Fix switch with only a default case.
2020-02-04 amaiorano Regres: fix no env-vars for deqp on Windows
2020-02-03 lfy android: avoid exporting normal Vulkan APIs
2020-01-30 capn Split JIT creation from LLVMReactor.cpp into LLVMJIT.cpp
2020-01-31 bclayton CMake: Add build rules for google benchmark.
2020-01-31 bclayton Add google benchmark submodule to third_party.
2020-01-30 capn Fix use after free
2020-01-30 capn Have Kokoro accept imports from Piper
(...)
2019-12-03 bclayton Vulkan: Tidy VkCommandBuffer.cpp
2019-12-06 bclayton Reactor: Rename Blend() to Shuffle()
2019-12-06 swiftshader.regress Regres: Update test lists @ b9f03f47
2019-12-05 bclayton Reactor: Switch swizzles over to 16-bit hex codes
2019-12-04 digit [vulkan] Add VK_SUBGROUP_FEATURE_ARITHMETIC_BIT support
2019-08-12 bclayton Vulkan: Optimize shaderClipDistance and shaderCullDistance
2019-08-09 bclayton Vulkan: Implement shaderClipDistance and shaderCullDistance
2019-12-04 paulthomson Regres: support GCOV_PREFIX for collecting coverage
2019-12-04 chrisforbes Regres: update testlists for recent deqp roll
2019-12-04 chrisforbes Regres: Adjust exit code handling
2019-11-22 digit [vulkan] Clarify configuration macros for external memory and semaphores.
2019-12-03 amaiorano ReactorUnitTests: add unit tests for intrinsics
2019-11-29 amaiorano SubzeroReactor: implement most missing intrinsics
2019-11-29 amaiorano SubzeroReactor: add stubbed coroutine support
2019-11-28 amaiorano Subzero: fix assert for sqrt of vector float types
2019-11-28 amaiorano Subzero: hack fix for assert(Dest->hasReg())
2019-11-28 amaiorano SubzeroReactor: fix assertion !isVectorType(Ty)
2019-11-28 amaiorano Subzero: fix assert when dumping unnamed constant
2019-12-04 chrisforbes Regres: roll deqp forward to current tip of 1.1.6
2019-12-04 sugoi Enable the fullDrawIndexUint32 feature
2019-12-04 swiftshader.regress Regres: Update test lists @ bbd0694f
2019-12-03 bclayton VulkanUnitTests: Fix bad comment on assembly.
2019-11-27 chrisforbes Remove Common/Types.hpp include from SpirvShader
2019-11-27 chrisforbes Regres: Add pending deqp change to fix bad graphicsfuzz tests
2019-12-02 srisser Make Vk::Stringify return std::string
2019-11-20 bclayton VkPipeline: Replace spirv-opt list with RegisterPerformancePasses()
2019-11-28 paulthomson Regres: refactor for use as a library
2019-11-29 swiftshader.regress Regres: Update test lists @ fb7ca1d5
2019-11-28 bclayton SpirvShaderEnumNames: Use spirv-tools' spvOpcodeString()
2019-11-28 bclayton Rename SpirvShader_dbg.cpp -> SpirvShaderEnumNames.cpp
2019-11-28 bclayton SpirvShader: Remove now unused includes
2019-11-28 bclayton SpirvShader: Move arithmetic ops to new cpp file
2019-11-28 bclayton SpirvShader: Move image handling to new cpp file
2019-11-28 bclayton SpirvShader: Move spec ops to new cpp file
2019-11-28 bclayton SpirvShader: Move group ops to new cpp file
2019-11-28 bclayton SpirvShader: Move memory ops to new cpp file
2019-11-28 bclayton SpirvShader: Move control flow handling to new cpp file
2019-11-28 bclayton SpirvShader: Move GLSLstd450 handling to new cpp file
2019-11-28 bclayton Pipeline: Move utility functions to ShaderCore
2019-11-28 jmadill Fix ICD generation (again).
2019-11-28 bclayton Regres: Use android.googlesource.com for dEQP
2019-11-27 sugoi Support multisampled Bresenham lines
2019-11-26 sugoi Support sample image instruction operand
2019-11-27 jmadill Fix ICD build when using multiple toolchains.
2019-11-26 chrisforbes gles: Only clamp default block uniform indexes
2019-11-26 bclayton Reactor: Work around new MSVC brokenness.
2019-11-26 swiftshader.regress Regres: Update test lists @ f2637d0d
2019-11-25 jonahr Present should return OUT_OF_DATE if the window size outdated
2019-11-18 bclayton Squashed 'third_party/SPIRV-Tools/' changes from 65e362b7a..c3f22f7cb
2019-11-18 bclayton Squashed 'third_party/SPIRV-Headers/' changes from e4322e3be..af64a9e82

Created with:
  roll-dep third_party/swiftshader

Bug: dawn:283

Change-Id: Ieed0e7438e3edaf4766d413ce0719065f8a005d8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16002
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-19 13:29:11 +00:00
Corentin Wallez 21e5074dcd Revert "Create VulkanImageWrappingTests for dma-buf images"
This reverts commit 0bbfec1f7f.

Reason for revert: Makes the roll into Chromium fail with the following:

    [314/21578] CXX obj/third_party/dawn/dawn_white_box_tests_sources/VulkanImageWrappingTestsDmaBuf.o
    FAILED: obj/third_party/dawn/dawn_white_box_tests_sources/VulkanImageWrappingTestsDmaBuf.o
    ../../build/toolchain/clang_code_coverage_wrapper.py --target-os=chromeos --files-to-instrument=../....(too long)
    ../../third_party/dawn/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp:28:10: fatal error: 'drm/drm_fourcc.h' file not found
    #include <drm/drm_fourcc.h>
    ^~~~~~~~~~~~~~~~~~
    1 error generated.

Original change's description:
> Create VulkanImageWrappingTests for dma-buf images
> 
> This CL branches the existing VulkanImageWrappingTests to separate
> tests for OpaqueFD-backed amd DmaBuf-backed external images. On
> Chrome OS of Dawn, we no longer interop using opaque FDs, so these
> tests were failing in the end2end test suite.
> 
> The new VulkanImageWrappingTestsDmaBuf tests are essentially 1:1
> mappings of their counterparts in the Opaque FD version. The only
> difference is that we allocate memory directly on the device using
> GBM instead of creating a VkImage (which will likely call some GBM
> methods under the hood) and then extracting the FD using a Vulkan
> extension. We then communicate this to Dawn via the DmaBuf
> ExternalImageDescriptor.
> 
> Also, this fixes VulkanImageWrappingUsageTests::LargeImage on AMD
> devices (assuming the extension is implemented) as we can now
> specify DRM modifiers.
> 
> Bug: chromium:996470
> Change-Id: I2b3c57d7f5ff14131d415e99a09d32d2f16b3e54
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15800
> Commit-Queue: Brian Ho <hob@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>

TBR=cwallez@chromium.org,enga@chromium.org,hob@chromium.org

Change-Id: Idb45586c608ce20432142834a4f14d42c76d3b3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:996470
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16001
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-19 12:35:51 +00:00
Brian Ho 0bbfec1f7f Create VulkanImageWrappingTests for dma-buf images
This CL branches the existing VulkanImageWrappingTests to separate
tests for OpaqueFD-backed amd DmaBuf-backed external images. On
Chrome OS of Dawn, we no longer interop using opaque FDs, so these
tests were failing in the end2end test suite.

The new VulkanImageWrappingTestsDmaBuf tests are essentially 1:1
mappings of their counterparts in the Opaque FD version. The only
difference is that we allocate memory directly on the device using
GBM instead of creating a VkImage (which will likely call some GBM
methods under the hood) and then extracting the FD using a Vulkan
extension. We then communicate this to Dawn via the DmaBuf
ExternalImageDescriptor.

Also, this fixes VulkanImageWrappingUsageTests::LargeImage on AMD
devices (assuming the extension is implemented) as we can now
specify DRM modifiers.

Bug: chromium:996470
Change-Id: I2b3c57d7f5ff14131d415e99a09d32d2f16b3e54
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15800
Commit-Queue: Brian Ho <hob@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-02-18 20:57:36 +00:00
Austin Eng 0aa86a7ae8 Validate that sampler compare function requires iOS GPU family 3v1
Bug: b/149025333
Change-Id: I8683188c6189a9390ac6568e4ab5434a6c1a99f9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15942
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-02-18 17:16:47 +00:00
Corentin Wallez e51f8dd09a Fix compilation with stdlibc++ (instead of libc++)
Also fixes some warnings when compiling with GCC

Bug: dawn:333
Change-Id: Ib597bb3b950476279a1e20e3556765ec9f1db697
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15960
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-02-18 02:44:05 +00:00
Corentin Wallez d353ca0881 CMake: Add support for the Vulkan backend
Bug: dawn:333
Change-Id: Id509e5f06862d6fee517ef47c40418077ccf4759
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15941
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-02-18 02:12:35 +00:00
Corentin Wallez 215b5370bc CMake: Add support for the OpenGL backend
Bug: dawn:333
Change-Id: Ic5386dc2fda3ba21f1437ee0b2c3f508ffb9dff7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15940
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-02-15 00:39:13 +00:00
Corentin Wallez 71b3dd56da Fix clean CMake builds
Headers only INTERFACE library with generated headers don't work in CMake
because the GENERATED property is local to a directory. Instead we make a
STATIC library with a Dummy cpp file.

INTERFACE libraries can only have INTERFACE sources so the sources get added
to the dependant's list of sources. If these dependents are in another
directory, they don't see the GENERATED property and fail to configure
because the file doesn't exist on disk.

Use this trick for both dawn_headers and dawncpp_headers that are header
only libraries with generated headers.

Bug: dawn:333
Change-Id: Ib0d6dcc5f351a638d1c5360214c0ce14a28fee3e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15921
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-14 19:09:33 +00:00
Natasha Lee 2fd6181929 Handle Device Lost for SwapChain
Bug: dawn:68
Change-Id: I16e00bb2e203e71fd0840b71bc027e6fbea4e52c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15723
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Natasha Lee <natlee@microsoft.com>
2020-02-11 21:30:25 +00:00
Corentin Wallez 713d9cbf93 webgpu.h: Fix WGPU_WHOLE_SIZE causing linking errors.
The symbol was not marked as static and would cause linking errors
because it would be defined in multiple translation units. Replace it
with a more traditional C-style #define.

Bug:
Change-Id: I19151884b7e8e171f829ffa47b1d119aff12ff99
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15740
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-10 20:25:36 +00:00
Corentin Wallez fb01a6024e Add missed file for the CMake build.
Bug: dawn:333
Change-Id: Ie966ec61f05c788bdb89a732bafe7f12c16e52cd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15860
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-07 23:46:30 +00:00
Ryan Harrison 6f3e8d8f0f Add flag to use spvc parser in tests
This also changes the name to be consistent with the option being set
in the spvc API.

BUG=dawn:335

Change-Id: I6f7431095493874e1fef0856e563f7f1225cfc21
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15780
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-02-07 16:30:27 +00:00
Ryan Harrison 28e054e8cb Turn off spvc being used by default
There appears to be issues with the CTS + spvc that are preventing
chromium to roll, so I am reverting spvc by default, until the CTS
issues are resolved.

BUG=dawn:337

Change-Id: I171ee5325b9afbf5d240a469009433105caf6ddb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15840
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-02-07 16:00:27 +00:00
Ryan Harrison 7f380d3d40 Turn on using spvc by default
BUG=dawn:291

Change-Id: I9ebf34388abc6f5ff443a430f5bd79507c095520
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15463
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-02-06 17:26:46 +00:00
Natasha Lee c30635174e Handle Device Lost for Fence and Queue::Signal
Bug: dawn:68
Change-Id: I5391d55f85fba7dce28b1df5bb06c2d9217dc72a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15420
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-06 00:56:35 +00:00
Corentin Wallez 7fe6efba4a Add initial CMakeLists.txt files
Adds CMake support for:
 - Generating the Dawn headers and C++ wrappers
 - libdawn_wire
 - libdawn_native with the Metal backend for now
 - All the examples.

Bug: dawn:333

Change-Id: I6ffbe090b0bd21d6a805c03a507ad51fda0275ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15720
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2020-02-05 17:16:05 +00:00
Kai Ninomiya 47b15048a1 Revert "Use libshaderc_spvc as a source_set, so complete_static_lib applies properly"
This reverts commit 97c3be2699.

Reason for revert: Breaks linking on MSVC

Original change's description:
> Use libshaderc_spvc as a source_set, so complete_static_lib applies properly
> 
> Brings the list of dependencies for a standalone Dawn app down from:
> 
>   obj/libdawn_native.a
>   obj/libdawn_utils.a
>   obj/src/dawn/libdawn_proc.a
>   obj/third_party/shaderc/libshaderc_spvc/spvc.o
>   obj/third_party/shaderc/libshaderc_spvc/spvc_private.o
>   obj/third_party/shaderc/libshaderc_spvc/spvcir_pass.o
>   obj/third_party/SPIRV-Tools/libspvtools_opt.a
> 
> to
> 
>   obj/libdawn_native.a
>   obj/src/dawn/libdawn_proc.a
> 
> Bug: dawn:327
> Change-Id: I74654b304a9cb5f2aff19e72aa6a8bf1eb708c15
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15481
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
> Commit-Queue: Kai Ninomiya <kainino@chromium.org>

TBR=kainino@chromium.org,rharrison@chromium.org

Change-Id: Ib6d17eccebf371b71e74f1857b50bb3cfd67595a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:327
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15722
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-02-04 02:48:43 +00:00
Bryan Bernhart 525ef86c2e Vulkan: attempt sub-allocation before direct allocation.
Falling-back to direct allocation ensures allocation failure returns OOM.
If no OOM, the resource could be left then used while in an invalid state.

BUG=chromium:1045811,chromium:1047220,chromium:1047048

Change-Id: I927962b1dc6a7422a7d6eac114d82f28a42794a2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15600
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-02-03 19:17:34 +00:00
Kai Ninomiya 97c3be2699 Use libshaderc_spvc as a source_set, so complete_static_lib applies properly
Brings the list of dependencies for a standalone Dawn app down from:

  obj/libdawn_native.a
  obj/libdawn_utils.a
  obj/src/dawn/libdawn_proc.a
  obj/third_party/shaderc/libshaderc_spvc/spvc.o
  obj/third_party/shaderc/libshaderc_spvc/spvc_private.o
  obj/third_party/shaderc/libshaderc_spvc/spvcir_pass.o
  obj/third_party/SPIRV-Tools/libspvtools_opt.a

to

  obj/libdawn_native.a
  obj/src/dawn/libdawn_proc.a

Bug: dawn:327
Change-Id: I74654b304a9cb5f2aff19e72aa6a8bf1eb708c15
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15481
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-02-03 18:55:44 +00:00
Ryan Harrison 176ff4b190 Rolling 4 dependencies
Roll third_party/SPIRV-Tools/ 1b3441036..a9624b4d5 (8 commits)

1b3441036a..a9624b4d5d

$ git log 1b3441036..a9624b4d5 --date=short --no-merges --format='%ad %ae %s'
2020-02-03 dnovillo Handle TimeAMD in AmdExtensionToKhrPass. (#3168)
2020-02-03 stevenperron Update CHANGES
2020-02-03 arseny.kapoulkine Implement constant folding for many transcendentals (#3166)
2020-01-30 afdx Fix typo in comment. (#3163)
2020-01-30 afdx spirv-fuzz: Arbitrary variable facts (#3165)
2020-01-29 afdx spirv-fuzz: Add outlining test (#3164)
2020-01-29 afdx spirv-fuzz: Make functions "livesafe" during donation (#3146)
2020-01-28 stevenperron Dead branch elim fix (#3160)

Roll third_party/glslang/ 07a55839e..5e86b28ff (2 commits)

07a55839ee..5e86b28ffb

$ git log 07a55839e..5e86b28ff --date=short --no-merges --format='%ad %ae %s'
2020-01-29 jbolz Use NOT ... VERSION_LESS instead of VERSION_GREATER_EQUAL
2020-01-28 jordan.l.justen standalone: Fix --help

Roll third_party/shaderc/ 0681dd61d..6d9f753c1 (5 commits)

0681dd61d3..6d9f753c1d

$ git log 0681dd61d..6d9f753c1 --date=short --no-merges --format='%ad %ae %s'
2020-01-30 rharrison Add documentation for Vulkan 1.2 and SPIR-V 1.5 (#980)
2020-01-30 dneto Better help for glslc -S (#978)
2020-01-29 rharrison Add back in deprecated APIs (#977)
2020-01-28 kainino1 Make a source_set for libshaderc_spvc (#976)
2020-01-27 rharrison Rolling 5 dependencies and updating expectations (#975)

Roll third_party/spirv-cross/ 68bf0f824..6b2add8e2 (4 commits)

68bf0f824c..6b2add8e2c

$ git log 68bf0f824..6b2add8e2 --date=short --no-merges --format='%ad %ae %s'
2020-02-03 post Use GNUInstallDirs for include path as well.
2020-02-01 orbea cmake: Don't hardcode the pkg-config file.
2020-02-01 orbea cmake: Use GNUInstallDirs.
2020-02-01 post CMake: Avoid warning when parent project uses VERSION in project().

Created with:
  roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers

Change-Id: If0ccbe8201ad572ce0bf8e29bb5520d995182645
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15700
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-02-03 18:31:52 +00:00
Corentin Wallez 43a0a815b8 Fix examples running with the wire.
The SampleUtils uses CreateSwapChain with a nullptr surface. This is
currently valid with implementation-based swapchains so the argument
should be tagged as optional.

Bug: dawn:269
Change-Id: Ic00d5a67fb038d2771174bb36f99b66b84f1a252
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15680
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-03 08:56:04 +00:00
Natasha Lee 2dd9ed0776 Handle Device Lost for Command Encoder Finish
Bug: dawn:68
Change-Id: I3449cdd9e69f3ae44a30f113fd88bd2fce2c94d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15602
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-01-31 19:26:49 +00:00
Kai Ninomiya f44a809f9a Remove VK_DEFINE_NON_DISPATCHABLE_HANDLE magic, use explicit VkHandle wrapper
Overriding VK_DEFINE_NON_DISPATCHABLE_HANDLE changes the function
signatures of Vulkan functions, changing their ABI and making us
incompatible with real drivers. This removes that magic, and replaces it
with an explicit wrapper, VkHandle, which has much of the same
functionality as the original VkNonDispatchableHandle.

It adds definitions for dawn_native::vulkan::VkBuffer et al, which
shadow the native ::VkBuffer et al. This retains type safety throughout
the Vulkan backend without changing every single usage.

Notably, the following things had to change:
- An explicit conversion from VkBuffer* to ::VkBuffer* is needed for
  arrays. This is implemented as a reinterpret_cast, which is still
  safe as the new VkHandle still has the same memory layout properties
  as VkNonDispatchableHandle did.
- When pointing to a VkHandle as an output pointer, it's now necessary
  to explicitly get the native ::VkBuffer (via operator*) and point to
  it.

Previously reviewed on:
https://dawn-review.googlesource.com/c/dawn/+/15580

Bug: chromium:1046362
Change-Id: I7d34ec38a805025f92165ea9a7ee07ae5c182076
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15641
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-01-31 04:04:16 +00:00
Austin Eng 0a239045e3 [docs] Add documentation for Dawn's testing infrastructure
Bug: dawn:23
TBR: cwallez@chromium.org
Change-Id: I67a1794bfc959f76fd16f5b249364a02274e73e7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15601
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-01-31 03:28:56 +00:00
Kai Ninomiya f28d0ae614 Revert "Remove VK_DEFINE_NON_DISPATCHABLE_HANDLE magic, use explicit VkHandle wrapper"
This reverts commit 4e17d5c248.

Reason for revert: broken on chromeos

Original change's description:
> Remove VK_DEFINE_NON_DISPATCHABLE_HANDLE magic, use explicit VkHandle wrapper
> 
> Overriding VK_DEFINE_NON_DISPATCHABLE_HANDLE changes the function
> signatures of Vulkan functions, changing their ABI and making us
> incompatible with real drivers. This removes that magic, and replaces it
> with an explicit wrapper, VkHandle, which has much of the same
> functionality as the original VkNonDispatchableHandle.
> 
> It adds definitions for dawn_native::vulkan::VkBuffer et al, which
> shadow the native ::VkBuffer et al. This retains type safety throughout
> the Vulkan backend without changing every single usage.
> 
> Notably, the following things had to change:
> - An explicit conversion from VkBuffer* to ::VkBuffer* is needed for
>   arrays. This is implemented as a reinterpret_cast, which is still
>   safe as the new VkHandle still has the same memory layout properties
>   as VkNonDispatchableHandle did.
> - When pointing to a VkHandle as an output pointer, it's now necessary
>   to explicitly get the native ::VkBuffer (via operator*) and point to it.
> 
> Bug: chromium:1046362
> Change-Id: I9c5691b6e295aca1b46d4e3d0203956e4d570285
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15580
> Reviewed-by: Austin Eng <enga@chromium.org>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Kai Ninomiya <kainino@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org

Change-Id: I500df2e34fd0f245ad04c517ff028ddd7bb5a2bf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1046362
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15620
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-01-31 02:09:06 +00:00
Kai Ninomiya 4e17d5c248 Remove VK_DEFINE_NON_DISPATCHABLE_HANDLE magic, use explicit VkHandle wrapper
Overriding VK_DEFINE_NON_DISPATCHABLE_HANDLE changes the function
signatures of Vulkan functions, changing their ABI and making us
incompatible with real drivers. This removes that magic, and replaces it
with an explicit wrapper, VkHandle, which has much of the same
functionality as the original VkNonDispatchableHandle.

It adds definitions for dawn_native::vulkan::VkBuffer et al, which
shadow the native ::VkBuffer et al. This retains type safety throughout
the Vulkan backend without changing every single usage.

Notably, the following things had to change:
- An explicit conversion from VkBuffer* to ::VkBuffer* is needed for
  arrays. This is implemented as a reinterpret_cast, which is still
  safe as the new VkHandle still has the same memory layout properties
  as VkNonDispatchableHandle did.
- When pointing to a VkHandle as an output pointer, it's now necessary
  to explicitly get the native ::VkBuffer (via operator*) and point to it.

Bug: chromium:1046362
Change-Id: I9c5691b6e295aca1b46d4e3d0203956e4d570285
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15580
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-01-31 01:30:56 +00:00
Ryan Harrison 1edaa1d1e1 Use the spvc translated version of the Vulkan shader
BUG=dawn:325

Change-Id: I66bed7fec65cadecc956878bf11fc204b66ad195
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15500
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-01-30 18:50:49 +00:00
Reid Kleckner 48e7da791f Use dict.items() instead of dict.iteritems() for py3 compat
iteritems() went away in Python 3.

R=kainino@chromium.org

Bug: 941669
Change-Id: I0c107aaa35bb1df7c126485c33c3d15cb77f03fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15560
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-01-30 01:25:08 +00:00
Mark Henderson 7d56022a64 Make Vulkan's surface config available before the swap chain is actually created/
Change-Id: I9da1c9f513d26aa95b40f97908bfc3a54c843053
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15541
Commit-Queue: Mark Henderson <mehe@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-01-29 23:11:17 +00:00
Kai Ninomiya 7b6246a2ad Generators for Emscripten
api_struct_info.json:
//* This generator is used to produce part of Emscripten's struct_info.json,
//* which is a list of struct fields that it uses to generate field offset
//* information for its own code generators.
//* https://github.com/emscripten-core/emscripten/blob/master/src/struct_info.json

library_webgpu_enum_tables.js:
//* This generator is used to produce the number-to-string mappings for
//* Emscripten's library_webgpu.js.
//* https://github.com/emscripten-core/emscripten/blob/master/src/library_webgpu.js

Change-Id: I4704509737cde4685a093eb484dd977e5a106d19
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15240
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-01-28 23:54:38 +00:00
Natasha Lee 74f5054ec9 Handle Device Lost for Buffer
Bug: dawn:68, chromium:1042998, chromium:1043468
Change-Id: I4faa46b0d2e8f814b9d353a75489d3c8ca0b2e89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15340
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Natasha Lee <natlee@microsoft.com>
2020-01-28 22:18:58 +00:00
Ryan Harrison f329c78b6c Rolling 5 dependencies
Roll third_party/SPIRV-Tools/ 323a81fc5..1b3441036 (9 commits)

323a81fc5e..1b3441036a

$ git log 323a81fc5..1b3441036 --date=short --no-merges --format='%ad %ae %s'
2020-01-24 syoussefi Fix chromium build (#3152)
2020-01-24 dneto Clarify mapping of target env to SPIR-V version (#3150)
2020-01-24 greg Use dummy switch instead of dummy loop in MergeReturn pass. (#3151)
2020-01-23 alanbaker Fix structured exit validation (#3141)
2020-01-23 dneto Add spvParseVulkanEnv (#3142)
2020-01-23 jaebaek Handle conflict between debug info and existing validation rule (#3104)
2020-01-23 syoussefi Use spirv-headers' BUILD.gn (#3148)
2020-01-23 syoussefi Roll external/spirv-headers/ af64a9e82..dc77030ac (4 commits) (#3147)
2020-01-21 afdx spirv-fuzz: Refactoring and type-related fixes (#3144)

Roll third_party/glslang/ b0ada8035..07a55839e (15 commits)

b0ada80356..07a55839ee

$ git log b0ada8035..07a55839e --date=short --no-merges --format='%ad %ae %s'
2020-01-27 rharrison Use correct enum type in case statement
2020-01-27 cepheus Build: Fix more build warnings caused by PR #2038.
2020-01-26 cepheus Build warning: Fix #2062, missing enum value in a switch.
2020-01-08 sk Public: replaced tabs with spaces
2020-01-08 sk CInterface: replaced tabs with spaces
2019-12-30 sk CInterface: added static asserts to compare C/C++ enums
2019-12-30 sk Added LAST_ELEMENT_MARKER for every enum used in the C interface
2019-12-26 sk CInterface: replaced SH_ prefix with GLSLANG_
2019-12-25 sk CInterface: added glslang_program_SPIRV_get_ptr()
2019-12-25 sk CInterface: added files to CMakeLists.txt
2019-12-25 sk CInterface: added _BIT suffix to glslang_messages_t and glslang_reflection_options_t, fixed const-correctness
2019-12-25 sk CInterface: reformatted according to .clang-format rules
2019-12-24 sk Added original glslang_c_interface implementation by Viktor Latypov
2019-12-24 laddoc Add Tess machine dependent built-in variables initialization for GLES 3.2
2019-10-18 timo.suoranta Fixes for gcc 9 / -Werror=deprecated-copy

Roll third_party/shaderc/ a4f9acedf..0681dd61d (2 commits)

a4f9acedf3..0681dd61d3

$ git log a4f9acedf..0681dd61d --date=short --no-merges --format='%ad %ae %s'
2020-01-27 rharrison Remove deprecated APIs (#974)
2020-01-24 dneto Handle new Glslang profile enum in switch (#973)

Roll third_party/spirv-cross/ f9818f080..68bf0f824 (6 commits)

f9818f0804..68bf0f824c

$ git log f9818f080..68bf0f824 --date=short --no-merges --format='%ad %ae %s'
2020-01-27 post Compile fix on older compilers.
2020-01-27 post GLSL: Support GL_ARB_enchanced_layouts for XFB.
2020-01-25 cdavis MSL: Move inline uniform blocks to the end of the argument buffer.
2019-12-16 cdavis MSL: Support inline uniform blocks in argument buffers.
2020-01-23 post Make SmallVector noexcept.
2020-01-22 42098783+barath121 Typo at line 324

Roll third_party/spirv-headers/ 204cd131c..dc77030ac (2 commits)

204cd131c4..dc77030acc

$ git log 204cd131c..dc77030ac --date=short --no-merges --format='%ad %ae %s'
2020-01-20 dneto Fix the license to match LICENSE
2020-01-20 syoussefi Add BUILD.gn

Created with:
  roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers

Change-Id: I696c1facf47a03e03e09c72c4d44449a37c1b971
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15480
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-01-27 19:55:23 +00:00
Corentin Wallez d26ee85fba Implement the webgpu.h swapchains in the frontend and Null backend.
The state-tracking of the webgpu.h swapchain is a bit complicated
because contrary to implementation-based swapchains, they have more
guarantees and a "replacing mechanism". For example instead of hoping
the implementation-based swapchain resize automatically, the
surface-based swapchain needs to be replaced by a new swapchain and
invalidated.

This mechanism of invalidation also needs to be triggered when the last
reference to the surface is lost because we don't want to risk the
application destroying the window from under us.

Adds tests for all the cases of invalidation I could think of apart from
device loss.

Bug: dawn:269

Change-Id: Id515dbb640e13c6e30bb1f1e93b8e54f1e2bba4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15400
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-01-25 10:05:40 +00:00
Austin Eng 0df4753ba6 Vulkan: Fix crashes on Device destruction if Device::Initialize fails
If Device creation fails, several things are just partially initialized
and the destroy sequence crashes dereferencing null data.

This commit marks the Vulkan device as lost until after it is created.
This avoids parts of the destroy sequence which are unecessary since
the Device was never successfully created and no commands are in flight.

Bug: chromium:1043095
Change-Id: I8e121709fa19b215e118a615b639380d1db1f3f2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15460
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-01-25 09:35:50 +00:00
Corentin Wallez 13e2e139a5 Update WGPUChainedStruct usage to match webgpu.h
In the webgpu-headers PR it was decided that in the C header
WGPUChainedStruct would be included as a member instead of members being
inlined.

See https://github.com/webgpu-native/webgpu-headers/pull/30

Bug: dawn:160
Change-Id: I8caf91f3106578077c80778621a632411da44423
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15441
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-01-25 09:30:40 +00:00
Austin Eng eb1ca45df7 Fix Vulkan fuzzer on mac_libfuzzer_chrome_asan
This commit fixes two problems:
1) It includes testing/libfuzzer/libfuzzer_exports.h which exports
   the LLVMFuzzerInitialize symbol. On Mac, not doing so causes it
   to be removed by the linker.
2) It makes it so that dawn_use_swiftshader is enabled by default
   when fuzzing, and enabling swiftshader also enables the Vulkan
   backend.

Bug: chromium:1042426
Change-Id: Ic0ae0d59c91476b0079148f33a4b1ebd1cc6743c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15462
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-01-25 02:14:39 +00:00
Ryan Harrison 1d036f7766 Removing deprecated spvc API usages
Roll third_party/shaderc/ c6a2ef12d..a4f9acedf (5 commits)

c6a2ef12df..a4f9acedf3

$ git log c6a2ef12d..a4f9acedf --date=short --no-merges --format='%ad %ae %s'
2020-01-23 rharrison Big cleanup to normalize API behaviour (#967)
2020-01-22 rharrison Start v2020.0 (#970)
2020-01-22 rharrison Fix the version string (#971)
2020-01-22 rharrison Finalize v2019.1 (#969)
2020-01-20 rharrison Rolling 3 dependencies and updating expectations (#966)

Created with:
  roll-dep third_party/shaderc

BUG=dawn:324

Change-Id: I3c3900dcccc317054f035e21a6863f068ce417c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15421
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-01-24 16:16:59 +00:00
Corentin Wallez fa06dd0b62 Fix Vulkan Swiftshader build on macOS
There was a typo in macro name used to do platform detection.

Bug:

Change-Id: I81958419b4283d1d0498f5edc48efc385a648e09
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15440
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-01-24 15:36:59 +00:00
Corentin Wallez d87e676845 Add the webgpu.h swapchain creation path
This commit changes wgpu::Device::CreateSwapChain to take an additional
wgpu::Surface argument. Passing nullptr is enough to stay on the
previous swapchain implementation, until the new one is ready.

In order to support both the "old" implementation-based swapchains and
the "new" surface-based swapchains. SwapChainBase is now split into
three abstract classes:

 - SwapChainBase that has a virtual method for each of the
wgpu::SwapChain methods.
 - OldSwapChainBase that corresponds to the implementation-based
swapchains.
 - NewSwapChainBase that will contain the surface-based swapchain
implementation and will eventually just be renamed to SwapChainBase.

The interaction of the surface-based swapchains with the Surface objects
aren't implemented yet, neither are the swapchain methods. Only creation
works.

Validation tests for surface-based swapchain creation are added in the
end2end test target because they need to create OS windows.

Bug: dawn:269

Change-Id: I7e07d6c666479867b9a16d7b1b8c181d5dbd69a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15281
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-01-23 17:20:38 +00:00