Commit Graph

2078 Commits

Author SHA1 Message Date
Austin Eng 2550e96724 Fix OpenGL over-eager lazy zero initialization for textures
Bug: dawn:145, dawn:348
Change-Id: I3b6e7b148a171bdcb50bcb825858cbf967c64c87
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16983
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-03-17 01:51:56 +00:00
Austin Eng 1cad258869 Fix Vulkan over-eager lazy zero initialization for textures
Bug: dawn:145, dawn:348
Change-Id: I10f7bcd324799b783d8dfdc8aaae52033236b695
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16981
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-03-17 01:14:36 +00:00
Ryan Harrison 93f88af15b Rolling 5 dependencies
Roll third_party/SPIRV-Tools/ 4c027048d..25ede1ced (8 commits)

4c027048d8..25ede1ced6

$ git log 4c027048d..25ede1ced --date=short --no-merges --format='%ad %ae %s'
2020-03-16 jmadill Roll external/spirv-headers/ 30ef660ce..a17e17e36 (1 commit) (#3230)
2020-03-13 vasniktel Update dependencies (#3228)
2020-03-12 greg Instrument: Debug Printf support (#3215)
2020-03-12 vasniktel spirv-fuzz: Support OpPhi when adding dead break and continue (#3225)
2020-03-12 afdx spirv-fuzz: Fix vector width issue in 'add equation instructions' pass (#3223)
2020-03-09 jbolz Allow sampledimage types as operand of OpCopyObject (#3222)
2020-03-09 vasniktel spirv-fuzz: Remove duplicated functionality (#3220)
2020-03-09 andreperezmaselco.developer spirv-fuzz: Allow OpPhi operand to be replaced with a composite synonym (#3221)

Roll third_party/glslang/ f333272eb..4b2483ee8 (7 commits)

f333272eb5..4b2483ee88

$ git log f333272eb..4b2483ee8 --date=short --no-merges --format='%ad %ae %s'
2020-03-16 mbechard Fix #2005. Allow multiple compilation units to declare identical push_constant blocks (#2123)
2020-03-11 laddoc Add flag to check whether offset is implicit or explicit (#2031)
2020-03-11 rharrison Use strcmp for all of the extended instruction set checks in the disassembler (#2107)
2020-03-10 jbolz EXT_debug_printf - make escape sequences better match C/C++
2020-03-09 jbolz disable escape sequences for #line and #error
2020-03-09 jbolz Decorate accesschain operand for nonuniform UBO loads
2020-03-09 jbolz Allow nonuniformEXT() on sampler types.

Roll third_party/shaderc/ 14f128e8d..a7657e4fa (2 commits)

14f128e8dc..a7657e4fa2

$ git log 14f128e8d..a7657e4fa --date=short --no-merges --format='%ad %ae %s'
2020-03-13 rharrison Rolling 2 dependencies (#999)
2020-03-12 rharrison Rolling 5 dependencies and updating expectations (#997)

Roll third_party/spirv-cross/ 7d42fd7f7..65aa0c35d (1 commit)

7d42fd7f7b..65aa0c35d6

$ git log 7d42fd7f7..65aa0c35d --date=short --no-merges --format='%ad %ae %s'
2020-03-10 post include/spirv_cross: Fix typo.

Roll third_party/spirv-headers/ d9ce9ca52..a17e17e36 (2 commits)

d9ce9ca52f..a17e17e36d

$ git log d9ce9ca52..a17e17e36 --date=short --no-merges --format='%ad %ae %s'
2020-03-13 jmadill Add missing header to BUILD.gn.
2020-03-09 stevenperron Export NonSemanticDebugPrintf.h in bazel build

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

Change-Id: Ie5906a75f3599673698846bb0f465432990f40f1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17080
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-03-16 18:38:16 +00:00
Austin Eng c7e16e351f Fix D3D12 over-eager lazy zero initialization for textures
Bug: dawn:145, dawn:348
Change-Id: Iafa1644424e67020b004765a0c9ccff2e077ead3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16980
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-03-16 17:48:26 +00:00
Nico Weber 022952303c Suppress two -Wunreachable-code warnings.
Bug: chromium:346399
Change-Id: Ieb76cf99022230dcfb0bc6b17f95ea544040a796
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17040
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-03-16 10:59:56 +00:00
Jiawei Shao 1a56ce54e0 Validate creating bind group layout with storage textures
This patch adds the validation on the creation of the bind group
layout with read-only storage texture, write-only storage texture
and read-write storage texture. Currently read-write storage textures
are not supported in any shader stages.

This patch also fixes chromium:1061156.

BUG=chromium:1061156, dawn:267
TEST=dawn_unittests, dawn_end2end_tests

Change-Id: Ib42678719df48565a46e39f21c34ec640960dcdc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16920
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-03-16 10:53:36 +00:00
Austin Eng 463c394905 Slab-allocate OpenGL bind groups
Now that all backends use slab-allocated bind groups, this patch also
moves the BindGroup implementation with owned-data into the Null backend.

Bug: dawn:340
Change-Id: I08a952075b382008fb82f1fbab3f779cc05bc2a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16747
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-03-13 23:51:50 +00:00
Austin Eng ae96f04c0a Slab-allocate frontend D3D12 bind groups
Bug: dawn:340
Change-Id: Ie613a1b8e445a385c10eb377983440ace9ad3f4a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16746
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-03-13 23:34:40 +00:00
Austin Eng 79230bf213 Slab-allocate frontend Vulkan bind groups
Bug: dawn:340
Change-Id: I3ef0b8a0585fac93ffb77d4642d13c14afbae177
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16745
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-03-13 23:10:00 +00:00
Austin Eng 459c2f930f Slab-allocate Metal bind groups
Bug: dawn:340
Change-Id: I6185e41d9c71c49953a4de91e5f3042968679fd6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15862
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-03-13 22:50:00 +00:00
Brandon Jones 0338b7ae19 Residency 3: Track Resource Heap Usages
Track what heaps are required to be resident upon command list
submission.

Bug: dawn:193
Change-Id: Icefe5aed047140f401d51018937c5364b3ed7c4f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16382
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-03-12 13:23:22 +00:00
Jiawei Shao 421684f943 Support Storage Textures as Valid Binding Types
This patch adds the basic validation of read-only storage texture,
write-only storage texture and read-write storage texture as new
binding types with no bind group layout provided in the creation of
pipeline state objects.

- Read-only storage textures can be used in vertex, fragment and
  compute shaders.
- Write-only storage textures can only be used in compute shaders
  due to the limitation on Metal.
- Read-write storage textures are not allowed now and they are
  reserved to be supported as an extension in the future.

BUG=dawn:267
TEST=dawn_unittests

Change-Id: Iffc432f29a855b85d59451cb3c50269e03b84627
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16661
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-03-11 01:28:48 +00:00
Bryan Bernhart 52d0627d56 D3D12: Pool-allocate shader-visible descriptor heaps.
Rather than destory GPU descriptor heaps upon being switched out,
heaps are stored in a list where they can be re-used once the GPU
is no longer using them.

BUG=dawn:155

Change-Id: I2074573e354f114c45afe9895e8515980d325852
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16282
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2020-03-09 22:56:59 +00:00
Brandon Jones f3bb4f4f32 Residency 2: Create a d3d12::Heap During Direct Allocations
When creating a directly allocated resource in D3D12, also create a
dawn_native::d3d12::Heap to represent that allocation alongside the
ResourceHeapAllocation. This matches D3D12's allocation model when using
CreateCommittedResource and makes residency management much easier.

Bug: dawn:193
Change-Id: I2280863dcfca57bad72962a2b097f8f2d4cc7dad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16381
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-03-09 15:53:19 +00:00
Ryan Harrison be6cd51888 Rolling 5 dependencies
Roll third_party/SPIRV-Tools/ e1688b60c..4c027048d (6 commits)

e1688b60ca..4c027048d8

$ git log e1688b60c..4c027048d --date=short --no-merges --format='%ad %ae %s'
2020-03-08 andreperezmaselco.developer spirv-fuzz: Add toggle access chain instruction transformation (#3211)
2020-03-08 vasniktel spirv-fuzz: Add fuzzer pass to permute function parameters (#3212)
2020-03-06 afdx spirv-fuzz: Use better function name (#3207)
2020-03-05 afdx spirv-fuzz: Add swap commutable operands transformation (#3205)
2020-03-04 afdx spirv-fuzz: Fuzzer pass to add equation instructions (#3202)
2020-03-04 andreperezmaselco.developer Refactor FuzzerPass::ApplyTransformation code duplication. (#3206)

Roll third_party/glslang/ 56364b6b6..f333272eb (11 commits)

56364b6b60..f333272eb5

$ git log 56364b6b6..f333272eb --date=short --no-merges --format='%ad %ae %s'
2020-03-06 kainino Fix typo in Web CMakeLists
2020-03-06 foo.travis add missing string.h header for resource_limits_c.cpp
2020-03-06 foo.travis add c wrapper for standalone ResourceLimits and remove that dependency from glslang_c_interface
2020-03-05 foo.travis add stdbool.h to properly support bool type
2020-03-05 foo.travis add c interface support for TBuiltInResource and glslang::DefaultTBuiltInResource
2019-05-31 jbolz GL_EXT_debug_printf implementation
2020-03-04 s.fricke Add Android build instructions to README
2020-03-04 johnkslang Improve formatting.
2020-03-04 johnkslang Add "news" section and component status.
2020-03-03 cepheus Fix long lines in the SPIR-V generator, retrigger bots.
2020-03-03 cepheus Fix #1843: Handle built-in function output parameters to a swizzled arg

Roll third_party/shaderc/ 1059f43a3..14f128e8d (3 commits)

$ git log 1059f43a3..14f128e8d --date=short --no-merges --format='%ad %ae %s'
2020-03-04 rharrison Remove deprecated methods no longer used by Dawn (#993)
2020-03-03 dneto Get spirv.hpp from SPIRV-Headers, not Glslang (#992)
2020-03-02 rharrison Rolling 6 dependencies and updating expectations (#990)

Roll third_party/spirv-cross/ 9deb6ffbb..7d42fd7f7 (5 commits)

9deb6ffbba..7d42fd7f7b

$ git log 9deb6ffbb..7d42fd7f7 --date=short --no-merges --format='%ad %ae %s'
2020-03-05 post HLSL: Do not emit globallycoherent for SRV ByteAddressBuffer.
2020-03-04 post Add test for disable-storage-image-qualifier-deduction.
2020-03-04 post HLSL: Add option to always treat SSBO as UAV, even with readonly.
2020-03-04 post Add option to disable storage image qualifier deduction.
2020-03-04 post Remove old hack which forces NonWritable/NonReadable.

Roll third_party/spirv-headers/ 0a7fc4525..d9ce9ca52 (2 commits)

0a7fc45259..d9ce9ca52f

$ git log 0a7fc4525..d9ce9ca52 --date=short --no-merges --format='%ad %ae %s'
2020-03-02 jbolz Add NonSemantic.DebugPrintf JSON/header
2020-03-02 jbolz Fix max enum value

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

Change-Id: I540abd66fa09c216866521adeba7d352d57f6848
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16663
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-03-09 15:52:39 +00:00
Jiawei Shao 532be50b76 Check bindingType with shader stage when creating default pipeline layout
This patch intends to fix a crash issue when creating a rendering
pipeline with storage buffer declared in vertex shader and pipeline
layout is not set.

Without this patch, in PipelineLayoutBase::CreateDefault() the
bindingSlot.visibility is always set to Fragment and Compute when it is
a storage buffer, therefore a crash happens at the failure of the
assertion modules->IsCompatibleWithPipelineLayout() when the storage
buffer is actually declared in the vertex shader.

BUG=dawn:276
TEST=dawn_unittests

Change-Id: I56876a97d53ead5ed226dc1b9bbed1a77156b2b2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16564
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-03-09 00:45:18 +00:00
Natasha Lee 7d20b44501 Respect external clear status for Textures
Use ExternalImageDescriptor->isCleared to set the clear status of
subresources so it can be correctly lazy cleared when used.

Also remove old Wrap path that uses regular texture descriptors
since we have moved to use ExternalImageDescriptor.

Bug: chromium:1036080
Change-Id: Icb605dbf3cf3f0dc8a30287e8b9b8d9134805112
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16320
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-03-06 19:05:15 +00:00
Corentin Wallez 2538aaf304 Roll third_party/swiftshader/ bdfcfe9cf..51b2800bb (23 commits)
https://swiftshader.googlesource.com/SwiftShader/+log/bdfcfe9cfd2a..51b2800bb317

$ git log bdfcfe9cf..51b2800bb --date=short --no-merges --format='%ad %ae %s'
2020-01-30 capn Support launching PowerVR samples from Visual Studio using SwiftShader
2020-03-04 amaiorano Subzero: implement Short4::Short4(RValue<Float4)
2020-02-28 amaiorano Subzero: don't assert about lack of atomic load/store on x86
2020-03-04 amaiorano Fix Regres regression post CMake var renaming
2020-03-03 amaiorano Subzero: fix regression in Optimizer
2020-03-03 jrprice Use LINK_FLAGS for -BSymbolic in CMake build
2020-03-03 capn Fix ASTC support for GN build
2020-03-02 swiftshader.regress Regres: Update test lists @ 416d3745
2020-03-01 capn Enable ASTC on supported builds only
2020-02-27 jmadill PipelineCache: Handle nullptr mismatch of specialization info.
2020-02-24 sugoi Implement ASTC support
2020-02-27 jonahr Add missing attribute to eglGetConfigAttrib
2020-02-27 jmadill Add codereview.settings.
2020-02-26 amaiorano Subzero: add support for variadic calls (System V)
2020-02-26 jmadill Fix comparison of specialization constant keys.
2020-02-25 amaiorano Subzero: add support for large stacks on Windows
2020-02-25 capn Build with -Bsymbolic to prevent symbol preemption
2020-02-25 capn Fix ANGLE standalone build
2020-02-25 capn Fix Android build after SPIRV-Tools update
2020-02-19 srisser Log instead of warn of unsupported extensions
2020-02-25 swiftshader.regress Regres: Update test lists @ e162b023
2020-02-24 capn Add SPIRV-Tools headers dependency
2020-02-24 capn Add SPIR-Tools include headers path for src/Pipeline

TBR=enga@chromium.org

Created with:
  roll-dep third_party/swiftshader

Change-Id: I3843e5b647a4ffd36c66896d9f262118f459a107
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16523
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-03-06 13:43:40 +00:00
Corentin Wallez e3f3e9a80d Revert "Vulkan: Report and enable subgroup size control device extension."
This reverts commit 4ae315b0d1.

Reason for revert: crbug.com/1059205

Bug: chromium:1059205

Original change's description:
> Vulkan: Report and enable subgroup size control device extension.
> 
> Certain Vulkan ICDs (Intel ones notably) will compile SPIR-V
> shaders with an liberal, compiler-selected, subgroup size (i.e.
> either 8, 16 or 32). For more context, see [1].
> 
> This can be a problem for compute, when one shader stores data
> in device memory using a subgroup-size dependent layout, to be
> consumed by a another shader. Problems arise when the compiler
> decides to compile both shaders with different subgroup sizes.
> 
> To work-around this, the VK_EXT_subgroup_size_control device
> extension was introduced recently: it allows the device to
> report the min/max subgroup sizes it provides, and allows
> the Vulkan program to control the subgroup size precisely
> if it wants to.
> 
> This patch adds support to the Vulkan backend to report and
> enable the extension if it is available. Note that:
> 
> - The corresponding VkStructureType enum values and
>   struct types are not rolled to the third-party Vulkan
>   headers used by Dawn yet, so vulkan_platform.h has been
>   modified to define them if necessary. This can be
>   removed in the future when the Vulkan-Headers are
>   updated in a different patch.
> 
> - This modifies VulkanDeviceInfo::GatherDeviceInfo() to
>   use VkGetPhysicalDevice{Properties2,Features2} if the
>   VK_KHR_get_device_properties2 instance extension is
>   available. Otherwise, the Vulkan 1.0 APIs
>   VkGetPhysicalDevice{Properties,Features} are used instead
>   (and it is assumed that no subgroup size control is
>   possible).
> 
> - This changes the definition of VulkanDeviceKnobs to
>   make room for the required pNext-linked chains of
>   extensions.
> 
> - A helper class, PNextChainBuilder is also provided in
>   UtilsVulkan.h to make it easy to build pNext-linked
>   extension struct chains at runtime, as required when
>   probing device propertires/features, or when
>   creating a new VkDevice handle.
> 
> Apart from that, there is no change in behaviour in this CL.
> I.e. a later CL might force a specific subgroup size for
> consistency, or introduce a new API to let Dawn clients
> select a fixed subgroup size.
> 
> [1] https://bugs.freedesktop.org/show_bug.cgi?id=108875
> 
> Change-Id: I524af6ff3479f25b0a8bb139a062fe632c826893
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16020
> Reviewed-by: Austin Eng <enga@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>

TBR=cwallez@google.com,cwallez@chromium.org,enga@chromium.org,enga@google.com,david.turner.dev@gmail.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I893d771d7effdf83685dda3edac8a08f98d2f6e5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16522
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-03-06 13:27:10 +00:00
Corentin Wallez 36f0388f79 Revert "Vulkan: Enforce fixed subgroup size for compute shaders."
This reverts commit 56f1678437.

Reason for revert: crbug.com/1059205
Bug: chromium:1059205

Original change's description:
> Vulkan: Enforce fixed subgroup size for compute shaders.
>
> This CL ensures that, on architectures with a varying subgroup size,
> compute shaders are always compiled with a fixed subgroup size to
> avoid consistency issues when one shader writes data in a subgroup-size
> dependent layout to GPU memory, to be read by another shader in a
> future dispatch.
>
> At the moment, only Intel ICDs are known to implement this [1],
> and the code uses a heuristics to chose the size of 16, which seems to
> be the sweet spot according to Intel engineers.
>
> + Update the PNextChainBuilder class to deal with the fact that
>   VkComputePipelineCreateInfo::pNext is defined as a const void*,
>   which created compiler errors in the previous implementation.
>
> [1] https://bugs.freedesktop.org/show_bug.cgi?id=108875
>
> Change-Id: I332faa53b9f854a8abe43a7271f30d8c5deb2142
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16021
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

TBR=cwallez@google.com,cwallez@chromium.org,enga@chromium.org,enga@google.com,david.turner.dev@gmail.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I922eccc310505da4b4a9fc853335733ca4900fc8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16521
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-03-06 13:03:00 +00:00
Corentin Wallez ddc5cacc27 GN: Use the hermetic XCode if available.
This matches Chromium's logic and make it less likely to break developer
workflow in the subsequent roll of Chromium's buildtools.

Bug: dawn:339
Change-Id: Ic42553827be125985a3d16b4f5d003b6662ead39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16520
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-03-06 12:25:20 +00:00
Natasha Lee 1d54767364 Query if Texture subresource has been initialized
Bug: chromium:1036080
Change-Id: Ieb4c7012ae2d7d7b863c999756930b0ce45c06cb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16422
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Natasha Lee <natlee@microsoft.com>
2020-03-05 17:07:16 +00:00
David Turner 56f1678437 Vulkan: Enforce fixed subgroup size for compute shaders.
This CL ensures that, on architectures with a varying subgroup size,
compute shaders are always compiled with a fixed subgroup size to
avoid consistency issues when one shader writes data in a subgroup-size
dependent layout to GPU memory, to be read by another shader in a
future dispatch.

At the moment, only Intel ICDs are known to implement this [1],
and the code uses a heuristics to chose the size of 16, which seems to
be the sweet spot according to Intel engineers.

+ Update the PNextChainBuilder class to deal with the fact that
  VkComputePipelineCreateInfo::pNext is defined as a const void*,
  which created compiler errors in the previous implementation.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=108875

Change-Id: I332faa53b9f854a8abe43a7271f30d8c5deb2142
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16021
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-03-05 10:47:05 +00:00
David Turner 4ae315b0d1 Vulkan: Report and enable subgroup size control device extension.
Certain Vulkan ICDs (Intel ones notably) will compile SPIR-V
shaders with an liberal, compiler-selected, subgroup size (i.e.
either 8, 16 or 32). For more context, see [1].

This can be a problem for compute, when one shader stores data
in device memory using a subgroup-size dependent layout, to be
consumed by a another shader. Problems arise when the compiler
decides to compile both shaders with different subgroup sizes.

To work-around this, the VK_EXT_subgroup_size_control device
extension was introduced recently: it allows the device to
report the min/max subgroup sizes it provides, and allows
the Vulkan program to control the subgroup size precisely
if it wants to.

This patch adds support to the Vulkan backend to report and
enable the extension if it is available. Note that:

- The corresponding VkStructureType enum values and
  struct types are not rolled to the third-party Vulkan
  headers used by Dawn yet, so vulkan_platform.h has been
  modified to define them if necessary. This can be
  removed in the future when the Vulkan-Headers are
  updated in a different patch.

- This modifies VulkanDeviceInfo::GatherDeviceInfo() to
  use VkGetPhysicalDevice{Properties2,Features2} if the
  VK_KHR_get_device_properties2 instance extension is
  available. Otherwise, the Vulkan 1.0 APIs
  VkGetPhysicalDevice{Properties,Features} are used instead
  (and it is assumed that no subgroup size control is
  possible).

- This changes the definition of VulkanDeviceKnobs to
  make room for the required pNext-linked chains of
  extensions.

- A helper class, PNextChainBuilder is also provided in
  UtilsVulkan.h to make it easy to build pNext-linked
  extension struct chains at runtime, as required when
  probing device propertires/features, or when
  creating a new VkDevice handle.

Apart from that, there is no change in behaviour in this CL.
I.e. a later CL might force a specific subgroup size for
consistency, or introduce a new API to let Dawn clients
select a fixed subgroup size.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=108875

Change-Id: I524af6ff3479f25b0a8bb139a062fe632c826893
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16020
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-03-05 10:34:25 +00:00
Brandon Jones 2de34c1791 Residency 1: Add Chromium's LinkedList to /common/
A Chromium's LinkedList class to Dawn. Implementation and header are
a direct copy/paste. This is to be used to implement an LRU Cache
for the ResidencyManager class.

Bug: dawn:193
Change-Id: I7cb02649590be4db0fe54c9d80557ac49efc34de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16380
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-03-05 09:54:06 +00:00
Austin Eng e5534c4419 Add SlabAllocator and tests
Bug: dawn:340
Change-Id: I6fa1948261e8e6f91324464dade3e9954bd833e5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15861
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-03-04 17:48:24 +00:00
Corentin Wallez 35645a601a Roll Dawn's copy of the Vulkan headers.
Bug: None
TBR=enga@chromium.org
Change-Id: I5c5ff19601b6506c9e2ff7b852a4b97b3eb5d70f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: David Turner <digit@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-03-04 12:23:54 +00:00
Bryan Bernhart 9b5ecdf536 D3D12: Remove extra pre-pass used for RTV/DSV allocation.
Instead of tracking RTV/DSVs before the start of the pass to allocate
memory for CPU descriptors, allocate them at the start of the pass,
removing the need to loop through the entire command buffer each
Submit().

BUG=dawn:256

Change-Id: I72faff8951095c6a45207bfe5b12936715c58abf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16261
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-03-03 19:28:03 +00:00
Natasha Lee 6f92b9160b Also use ExternalImageDescriptor in D3D12 and Metal Backends
Bug: chromium:1036080
Change-Id: I358b0441c168ca075b09ab028c2f6d9df2a44d59
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16240
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Natasha Lee <natlee@microsoft.com>
2020-03-02 22:27:46 +00:00
Ryan Harrison cb90835dd9 Rolling 4 dependencies
Roll third_party/SPIRV-Tools/ 8910ea5f1..e1688b60c (4 commits)

8910ea5f1c..e1688b60ca

$ git log 8910ea5f1..e1688b60c --date=short --no-merges --format='%ad %ae %s'
2020-02-28 dneto Avoid use of Python distutils.dir_util (#3203)
2020-02-28 rharrison Adding WebGPU specific Workgroup scope rule (#3204)
2020-02-25 jaebaek Add validation rules for OpenCL.DebugInfo.100 extension (#3133)
2020-02-25 geofflang Combine extinst-name and extinst-output-base into one arg. (#3200)

Roll third_party/glslang/ 07e1a0a67..56364b6b6 (6 commits)

07e1a0a67a..56364b6b60

$ git log 07e1a0a67..56364b6b6 --date=short --no-merges --format='%ad %ae %s'
2020-03-01 cepheus Copyright update, mostly to trigger bots again.
2020-03-01 cepheus Fix #2095: correct the indentation.
2020-02-28 cepheus Fix #1461: set the SPIRV-Tools' optimizer's target environment.
2020-02-28 cepheus Fix #2091, remove incorrect assert for division by 0.0.
2020-02-28 wangli28 Add vcpkg installation instructions
2020-02-28 sk Fix for #2075: removed DefaultTBuiltInResource from glslang_c_interface.cpp

Roll third_party/spirv-cross/ c5f7b5575..9deb6ffbb (1 commit)

c5f7b55756..9deb6ffbba

$ git log c5f7b5575..9deb6ffbb --date=short --no-merges --format='%ad %ae %s'
2020-03-02 post Add -V alias for --vulkan-semantics.

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

5dbc1c3218..0a7fc45259

$ git log 5dbc1c321..0a7fc4525 --date=short --no-merges --format='%ad %ae %s'
2020-02-26 dneto Add grammars, C header, and header generator for vendor and KHR extended instruction sets (#143)

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

Change-Id: I20d05fbd4e1ce6a9ffb5bbed091524830aea68de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16280
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-03-02 19:12:46 +00:00
Austin Eng 3ded65e807 Default initialize all descriptors
Some dawn_unittests crash on some configurations because the
uninitialized |label| member crashed string serialization.
Default initialize all descriptors to avoid this problem.

Bug: none
Change-Id: I6ea1851ebb6f54690a28ba396e0beaa85d8670cc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16260
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-02-28 22:29:15 +00:00
Austin Eng e299afa9ec Support CPU adapters in dawn_end2end_tests
This is so we can run the end2end_tests using Swiftshader. We still
prefer the discrete, then integrated GPUs so that normal testing uses
the real GPU.

Bug: dawn:283
Change-Id: I17a1ffd8aa88ddeaafa019feb67deeb25cdd2da0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16220
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Mark Henderson <mehe@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-02-27 17:47:19 +00:00
Bryan Bernhart 0363c3e46d D3D12: Allocate GPU bind groups at draw/dispatch.
Instead of counting descriptors to be allocated for the entire command
buffer in a pre-pass, the bindgroup state tracker is used to allocate
only dirty bindgroups upon recording draw/dispatch. If the heap has no
more room and must be changed, bindgroups will be re-created according
to the BGL.

A future change will address the CPU descriptors and removal of the
pre-pass.

BUG=dawn:256,dawn:307

Change-Id: I6603de17cfda713bd4512c46e1c93618ca01bb7b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13400
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-02-27 01:14:22 +00:00
Austin Eng a9d7d47842 Add Toggles to disable base vertex and base instance rendering
These are not supported on some older OpenGL, OpenGL ES, and iOS
devices.

Bug: dawn:343
Change-Id: I70def749ae57fcfe2895f8556674dd241941d3d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16163
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-26 08:24:20 +00:00
Austin Eng 2f0f850da8 Add Toggle to disable sampler compare function on Metal.
This Toggle is set if MTLFeatureSet_iOS_GPUFamily3_v1 is not supported.

Bug: dawn:342
Change-Id: Ia5f43e87fdd2c13eaffe9557cb0ce9a06dec3b29
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16180
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-26 08:06:00 +00:00
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