This patch adds the support of BC5 formats on D3D12 backend. On D3D12,
the "rowPitch" refers to the number of bytes in a row of blocks (which
covers up to 4 scanlines at once) for the textures in BC formats.
This patch also adds the related end2end tests for four typical cases of
B2T and T2B copies on D3D12:
(1) copyBytesPerRowPitch + byteOffsetPerRowPitch <= rowPitch and
texelOffset.y == 0
(2) copyBytesPerRowPitch + byteOffsetPerRowPitch <= rowPitch and
texelOffset.y > 0
(3) copyBytesPerRowPitch + byteOffsetPerRowPitch > rowPitch
(4) texelOffset.z > 0
BUG=dawn:42
TEST=dawn_end2end_tests
Change-Id: If27ab3e56596e25c1c5be787ca021c0748021a46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8541
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The root causes of these failures are as follows:
1. 'fragmentStoresAndAtomics' feature is not enabled when we create the Vulkan device.
2. The binding value of dynamic buffer offset end2end test not set correctly.
For failure reason 1, this patch enabled fragmentStoresAndAtomics.
For failure reason 2, this patch modify dawn validation logic in SetBindGroup to check
binding size and update binding size in dynamic buffer offset end2end test.
BUG=dawn:170
Change-Id: I46f12453d4c83d9d3c7de6e183442cf516335f2f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8320
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This patch implements RenderPassEncoder::SetViewport. It also adds
validation code, and validation tests as well.
BUG=dawn:53
TEST=dawn_unittests
Change-Id: Idc27f4098761a57fc10e53be82bd3c4b35b53cb4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8542
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Roll third_party/SPIRV-Tools/ 001e823b6..5a93e0739 (17 commits)
001e823b65..5a93e07392
$ git log 001e823b6..5a93e0739 --date=short --no-merges --format='%ad %ae %s'
2019-07-04 afdx Refactor reducer options (#2709)
2019-07-03 52076061+digit-google Fix BUILD.gn for Fuchsia platform build. (#2692)
2019-07-02 cmarcelo Validate that in OpenGL env block variables have Binding (#2685)
2019-06-28 51214578+jmacnak-nv Update type for loaded builtin GlobalInvocationID in pass instrumentation (#2705)
2019-06-26 afdx Warn when input facts are invalid. (#2699)
2019-06-26 afdx Got rid of redundant declaration. (#2698)
2019-06-26 afdx Disallow movement of unreachable blocks. (#2700)
2019-06-25 afdx Refactor fuzzer transformations (#2694)
2019-06-25 joseph.kucia Fix Component decoration validation for arrays (#2697)
2019-06-21 kpet Replace global static map with an array of pairs (#2691)
2019-06-21 joseph.kucia Basic validation for Component decorations (#2679)
2019-06-20 zoddicus Add infrastructure for maintaining and using DEPS (#2684)
2019-06-20 33432579+alan-baker Fix store to uniform Vulkan check (#2688)
2019-06-20 kpet Add all accepted target environments to the tools' help texts (#2687)
2019-06-19 afdx Represent uniform facts via descriptor set and binding. (#2681)
2019-06-19 zoddicus Roll external/spirv-headers/ 8b911bd2b..de99d4d83 (8 commits) (#2682)
2019-06-19 ehsannas Whitelist SPV_GOOGLE_user_type. (#2673)
Roll third_party/glslang/ f9d08a25f..4b4b41a63 (10 commits)
f9d08a25fb..4b4b41a634
$ git log f9d08a25f..4b4b41a63 --date=short --no-merges --format='%ad %ae %s'
2019-07-03 cepheus HLSL: Fix#1815: Don't constant fold spec-constant array indexing.
2019-07-02 jbolz update spirv-headers to pick up demote_to_helper_invocation
2019-07-02 cepheus Standalone: Fix#1814: Check that linkage was specified for reflection.
2019-07-02 cepheus Build: Tweak PR #1808 to avoid an implicit conversion warning.
2019-07-01 jbolz Implement GL_EXT_demote_to_helper_invocation
2019-06-25 syoussefi Remove __DATE__ and __TIME__ usage
2019-06-25 syoussefi Remove extraneous semicolons
2019-06-21 jbolz Add a bunch of missing cases to promoteConstantUnion. Use macros to expand all the cases more simply.
2019-06-21 jbolz Add test for constant type conversion
2019-06-21 digit BUILD.gn: Fix file for use with Fuchsia platform build.
Roll third_party/shaderc/ 3c76b8aa3..77d7b65ee (39 commits)
3c76b8aa36..77d7b65ee2
$ git log 3c76b8aa3..77d7b65ee --date=short --no-merges --format='%ad %ae %s'
2019-07-03 zoddicus Rolling 4 dependencies and updating known_failures (#754)
2019-07-02 dneto Add --target-spv option to set target SPIR-V version (#750)
2019-07-02 zoddicus Remove old logging infra from run_spirv_cross_tests.py (#749)
2019-06-28 zoddicus Enable implicit fallthrough warning and fix examples of (#747)
2019-06-28 zoddicus Rolling 2 dependencies (#748)
2019-06-26 zoddicus Rolling 4 dependencies and update known_failures (#745)
2019-06-26 zoddicus Catch low level exceptions instead of crash (#744)
2019-06-25 zoddicus Add jobs flag to spirv cross tests script (#743)
2019-06-25 zoddicus Extract common test environment bits out into a class (#738)
2019-06-25 52076061+digit-google Fix BUILD.gn for Chromium build. (#741)
2019-06-25 52076061+digit-google BUILD.gn fixes for Fuchsia. (#733)
2019-06-25 dneto Remove Appveyor artifacts link. (#739)
2019-06-24 zoddicus Remove SetShaderModel from API (#734)
2019-06-20 zoddicus Move script fixes from other SPIRV related repos (#732)
2019-06-19 zoddicus Import improvements to DEPS roll script (#729)
2019-06-19 dneto Update CHANGES (#730)
2019-06-19 dneto Add -fnan-clamp (#725)
2019-06-18 zoddicus Add script to generate manual roll patch (#727)
2019-06-18 zoddicus Rolling 4 dependencies (#728)
2019-06-17 google-shaderc-autoroll Roll third_party/glslang def9662348b0..9db72785beb3 (1 commits) (#721)
2019-06-17 google-shaderc-autoroll Roll third_party/spirv-cross 4104e363005a..146dc453bcec (2 commits) (#722)
2019-06-17 zoddicus Manually roll DEPS to get past test failure (#717)
2019-06-17 google-shaderc-autoroll Roll third_party/googletest fd20d1eccef6..176eccfb8f42 (1 commits) (#718)
2019-06-17 google-shaderc-autoroll Roll third_party/googletest e110929a7b49..fd20d1eccef6 (5 commits) (#715)
2019-06-15 google-shaderc-autoroll Roll third_party/re2 0c95bcce2f1f..848dfb7e1d7b (2 commits) (#712)
2019-06-14 google-shaderc-autoroll Roll third_party/googletest f7c178ecb33c..e110929a7b49 (2 commits) (#709)
2019-06-14 google-shaderc-autoroll Roll third_party/googletest 26afdba792e5..f7c178ecb33c (2 commits) (#707)
2019-06-14 google-shaderc-autoroll Roll third_party/spirv-cross 00a8539d1ddf..4104e363005a (3 commits) (#698)
2019-06-14 google-shaderc-autoroll Roll third_party/googletest af4c2cb098a3..26afdba792e5 (1 commits) (#703)
2019-06-13 dneto Update glslc tests for -finvert-y option (#704)
2019-06-13 andrejnau Pass InvertY to glslang (#695)
2019-06-13 google-shaderc-autoroll Roll third_party/googletest 89656ddbe62f..af4c2cb098a3 (2 commits) (#702)
2019-06-13 google-shaderc-autoroll Roll third_party/spirv-headers 9cf7c3a7d2d2..de99d4d834ae (1 commits) (#697)
2019-06-12 google-shaderc-autoroll Roll third_party/googletest 076b7f778883..89656ddbe62f (1 commits) (#694)
2019-06-12 google-shaderc-autoroll Roll third_party/spirv-cross fccf1d046204..00a8539d1ddf (1 commits) (#691)
2019-06-12 google-shaderc-autoroll Roll third_party/spirv-cross 5e9e8918f9a2..fccf1d046204 (1 commits) (#690)
2019-06-12 google-shaderc-autoroll Roll third_party/spirv-headers 9242862c84fe..9cf7c3a7d2d2 (1 commits) (#689)
2019-06-11 zoddicus Roll all DEPS to HEAD (#685)
2019-06-10 google-shaderc-autoroll Roll third_party/effcee 8f0a61dc95e0..b83b58d177b7 (2 commits) (#677)
Roll third_party/spirv-cross/ 05ea05509..c5904dd24 (31 commits)
05ea055096..c5904dd245
$ git log 05ea05509..c5904dd24 --date=short --no-merges --format='%ad %ae %s'
2019-07-03 post Don't use scalar dot().
2019-07-03 post MSL/HLSL: Support scalar reflect and refract.
2019-07-03 post Fix variable scope when an if or else block dominates a variable.
2019-05-31 cdavis MSL: Support SubgroupLocalInvocationId and SubgroupSize in all stages.
2019-07-01 post MSL/HLSL: Support OpOuterProduct.
2019-05-31 cdavis MSL: Support SPV_KHR_multiview.
2019-06-28 post Deal with scalar input values for distance/length/normalize.
2019-06-27 post Run format_all.sh.
2019-06-27 post HLSL: Does not support case-fallthrough.
2019-06-27 post Handle more cases with FP16 and texture sampling.
2019-06-26 post Add C API for get_declared_struct_member_size.
2019-06-26 post MSL: De-virtualize get_declared_struct_member_size.
2019-06-26 post MSL: Fix minor XCode /analyze warning.
2019-06-25 post Fix declaration of loop variables with a Phi helper copy.
2019-06-24 post MSL: Add support for SubgroupSize / SubgroupInvocationID in fragment.
2019-06-24 post MSL: Support custom bindings for argument buffer itself.
2019-06-24 post Workaround GCC 9 bug.
2019-06-21 post Run format_all.sh.
2019-06-21 post MSL: Actually return the autobinding value in C API.
2019-06-21 post Old MSVC does not like +[] constructs.
2019-06-21 post Deal with OpPhi and case fallthrough.
2019-06-21 post MSL: Add C API for querying automatic resource bindings.
2019-06-21 post MSL: Rewrite how resource indices are fallback-assigned.
2019-06-20 post Deal with switch block fallthrough more correctly ...
2019-06-20 post Rewrite how switch block case labels are emitted.
2019-06-19 post MSL: Error out on int64_t/uint64_t buffer members.
2019-06-11 post MSL: Support 64-bit integers.
2019-06-13 post MSL: Support PrimitiveID in fragment and barycentrics.
2019-06-13 post GLSL: Support NV barycentrics.
2019-06-12 post MSL: Support OpImageQueryLod.
2019-06-11 post MSL: Support MinLod operand.
Roll third_party/spirv-headers/ de99d4d83..29c11140b (2 commits)
de99d4d834..29c11140ba
$ git log de99d4d83..29c11140b --date=short --no-merges --format='%ad %ae %s'
2019-07-01 jbolz add SPV_EXT_demote_to_helper_invocation
2019-06-15 antiagainst Reserve ID 23 for MLIR SPIR-V Serializer
Created with:
roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers
Change-Id: Iab9ba95ad6c107a1aa49f7eefde0081347788db7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8580
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This patch supports BC5 formats on Vulkan backends and adds related
Dawn end2end tests.
For the textures with BC formats, they could have non-multiple-of-4
sizes on the non-zero mipmap levels in sampling, but we are still
required to provide texture data in complete 4x4 blocks in texture
copies because that is the size of which they are stored in GPU memory.
In this patch, we refer the term "physical memory size" as the memory
size of the texture subresource in GPU memory, and the term "virtual
memory size" as the size used in texture sampling. As Dawn requires
the Extent3D in texture copies must fit in the physical memory size,
while Vulkan requires it must fit in the virtual memory size, this
patch recalculates the imageExtent to ensure it always follow this
Vulkan validation rules.
For Dawn end2end tests, note that we use pure green and pure red for
the textures because BC5 does not support SRGB formats. Furthermore,
"CopyPartofTextureSubResourceIntoNonZeroMipmapLevel" is skipped in
this patch because there is an issue on the T2T copies from a region
within the virtual size of one texture to another one that exceeds
the virtual size of another texture in Vulkan SPEC.
BUG=dawn:42
TEST=dawn_end2end_tests
Change-Id: I17518cd335fb13125cb753bbf879bc06eb20e426
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8260
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This test is crashing on the bot upgrade to Ubuntu 19.04.
TBR=cwallez@chromium.org
Bug: chromium:980737
Change-Id: I3fe1860fb14ae41c19dae0b0a82db2410d505a96
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8540
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This prevents dirty textures to be used when memory is recycled while
destroying/creating new textures. If a texture is being used for the
first time and has not yet been initialized, it will be cleared
to zeros.
Bug: dawn:145
Change-Id: I1140ff0535241b247b855df2afefc01fbc003470
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8380
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Natasha Lee <natlee@microsoft.com>
mResourcePtr is not necessary because mResource already contains a
pointer to the resource
mResourcePtr is initialized in the constructor that takes an
ID3D12Resource but mResource is not. This causes memory corruption
when the caller releases the resource out from under the object.
Texture::DestroyImpl was releasing mResource but leaving mResourcePtr
pointing to freed memory
Bug: dawn:62
Change-Id: Ib68786fc041e57dbf184c09c9afe4b9d8fa3241f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8500
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This patch moves all the validations on imageHeight to one function so
that we no longer have two versions of ValidateImageHeight().
BUG=dawn:42
Change-Id: Ieadca2a1010b67252adb7e4f2452d9e53aebdf8b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8480
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This adds the formats to dawn.json, implements support in the Vulkan
backend and adds tests performing basic sampling checks for all formats.
The R8UnormSrgb and RG8UnormSrgb formats skipped because they are not
required in Vulkan (and RG8UnormSrgb is in fact not supported on the
machine used for developing this CL). A PR will be sent to the WebGPU
repo to remove the from the initial list of formats.
The RG11B10Float and RGB10A2Unorm formats of WebGPU are replaced with
B10GR11Float and A2RGB10Unorm that are the formats exposed by Vulkan. It
is likely that all APIs implement them with components stored in that
order.
Each format except depth-stencil ones is tested by uploading some
interesting texel data and checking that sampling from the texture
produces correct results. The goal is to make sure that backends don't
make a mistake in the giant switch statements. There was no effort made
to check the hardware implementation of the formats.
Tests will later be extended to cover rendering and clearing operations
as well as multisample resolve.
It isn't clear if depth-stencil format will support TRANSFER operations
in WebGPU so these are left untested for now.
BUG=dawn:128
Change-Id: I78ac5bf77b57398155551e6db3de50b478d69452
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8363
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Previously they would only run on Ubuntu 14.04 which has been removed
from the luci flex pool. Run on unspecified Ubuntu version so the
tryjobs start working again.
TBR=enga@chromium.org
BUG=
Change-Id: I32d584ae6ef90a5add926c3c6c60a1d45aed0d45
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8441
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Previously it would only return a boolean which made it difficult to
know why the validation is failing.
BUG=dawn:128
Change-Id: Id129a84f7777ba2efc5f12292aeccb83c076b9af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8362
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This will be used to test NaN is correctly sampled from float16
textures.
BUG=dawn:128
Change-Id: I6e3b79f438e9a48c3a167ab45baf9f9d019ce48b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8361
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This will be useful when we add all texture formats because there are
more than 50 of them and we want to make sure no two enum values
collide.
BUG=dawn:128
Change-Id: I928d3311ee3f6422ea503a3fa90c5e377fe5e03d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8360
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
The pending CopyFromStagingBuffer operation didn't keep a reference to
its Buffer causing a use-after free in some cases.
BUG=chromium:976573
Change-Id: Ib53c294874d175d2a21b65676fb71e62f42619b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8365
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Since SPIRV-Cross outputs HLSL shaders with RWByteAddressBuffer,
we must use D3D12_BUFFER_UAV_FLAG_RAW when making the
UNORDERED_ACCESS_VIEW_DESC. Using D3D12_BUFFER_UAV_FLAG_RAW requires
that we use DXGI_FORMAT_R32_TYPELESS as the format of the view.
DXGI_FORMAT_R32_TYPELESS requires that the element size be 4
byte aligned. Since binding.size and binding.offset are in bytes,
we need to divide by 4 to obtain the element size.
Bug: dawn:159
Change-Id: I52481aea1fe190d54286c099a68f3e21dbe05330
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8341
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The width and height of the mipmaps level > 0 weren't computed
correctly. Size of mip level of a texture should be greater than
0.
BUG=dawn:176
TEST=dawn_unittests --gtest_filter=CopyCommandTest*.CopyNonSquareTexture
Change-Id: I730aef3fd8c036567f824cd707d1ea1a69b132c0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8242
Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
The 3 tests run failed with Metal validation layer, which block end2end tests run with validation layer in CQ. Suppress temporarily while we're fixing.
BUG=dawn:139
Change-Id: I0b6c99ac731b90cd10b8b1f7bb5d3f5e1976fb07
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8241
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This prevents dirty textures to be used when memory is recycled while
destroying/creating new textures. If a texture is being used for the
first time and has not yet been initialized, it will be cleared
to zeros.
Bug: dawn:145
Change-Id: I8b9571c5a8fdd366717ffbd0fafca89b86653cea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8062
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This CL tries to make generator_lib.py easier to reuse in
other projects (e.g. non Dawn-related), by doing the following:
- Removing dawn-specific variables from the script and
replacing them by path-relative defaults, or through
additional command-line parameters (e.g. --root-dir can
now be used to pass the root source directory for Python
dependency computations).
- Move project-agnostic processing from dawn_generator
GN template into a new generator_lib:generator_lib_action
template. The new generator_lib.gni file does not
contain Dawn-specific settings and can be reused more
easily outside of Dawn.
+ Replace --extra-python-path with --jinja2-path to be
more explicit.
+ Add a few documentation comments in the Python scripts.
R=cwallez@chromium.org
Bug: NONE
Change-Id: I3e89f4bc32bdb6a019d251473222c6ce5cdc5f9f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8280
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
When pipeline topology is set to Point_List, PointSize must be written
in vertex shader for Vulkan backend.
BUG=dawn:146
Change-Id: Id5aac73bb7e60646503f1ea06c2aa0d39c8384b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7820
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Texture formats have plenty of properties we'd like to query on them
like their texel size, whether they are compressend or if they are depth
stencil. Instead of making switch statements for each of these
properties, we store them in a new `Format` structure. Textures compute
their format only onces and then pass a const reference to it on
GetFormat().
This is in preparation of adding all WebGPU texture formats.
BUG=dawn:128
Change-Id: Iad2831cf16f14e1a1bfce2c10b22527fc982d1aa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8166
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
In order to debug single frame applications such as unit tests with
with PIX, you need to call BeginCapture() at the start of your
application.
This change adds a begin-capture-on-startup flag to the Dawn test
environment. The flag, when set, will call BeginCapture() right after
the DXGI factory is created.
Bug: dawn:44
Change-Id: Ibb8f7b05707915510f9886524f0144c0576d2603
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8200
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Also ensure depth stencil texture is clear in begin render pass.
Bug: dawn:175, dawn:145
Change-Id: I19fc857dedf9f353a4834b8e1c9616d02c5a15ac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8140
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
The currently used method, SetShaderModel has been deprecated in
favour of SetHLSLShaderModel. This CL migrates Dawn, so that the
deprecated method can be removed from upstream.
BUG=chromium:976798
Change-Id: Id1e655b77291179dd6e15f1a85c8664f07cf8396
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8220
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Uses the functionality in depot_tools/roll-dep to generate a patch
rolling all of the shaderc dependencies in DEPS to
origin/master. Still will require manual testing to confirm this roll
is good.
Change-Id: Iadf6ee0f75ac84ce9bc7ec1ba82247dd96560088
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8180
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Roll third_party/SPIRV-Tools/ 0125b28ed..001e823b6 (24 commits)
0125b28ed4..001e823b65
$ git log 0125b28ed..001e823b6 --date=short --no-merges --format='%ad %ae %s'
2019-06-18 afdx Add fuzzer pass to obfuscate constants. (#2671)
2019-06-17 33432579+alan-baker Handle volatile memory semantics in upgrade (#2674)
2019-06-17 33432579+alan-baker Validate Volatile memory semantics bit (#2672)
2019-06-17 33432579+alan-baker Disallow stores to UBOs (#2651)
2019-06-17 dneto Another fix uint -> uint32_t (#2676)
2019-06-15 33432579+alan-baker Validate variable initializer type (#2668)
2019-06-14 dneto Fix uint -> uint32_t in fuzz.cpp (#2675)
2019-06-13 afdx Add replayer tool for spirv-fuzz. (#2664)
2019-06-13 33432579+alan-baker Add validation for Subgroup builtins (#2637)
2019-06-11 afdx Add constant == uniform facts. (#2660)
2019-06-07 stevenperron Cast __LINE__ to size_t (#2661)
2019-06-06 afdx Add transformation to replace a boolean constant with a numeric comparison (#2659)
2019-06-06 dgkoch Add builtin validation for SPV_NV_shader_sm_builtins (#2656)
2019-06-06 greg Instrument: Fix code for version 2 output format. (#2655)
2019-06-05 afdx Fix bug in 'split blocks', and add tests for fuzzer. (#2658)
2019-06-05 dneto Optimizer: Handle array type with OpSpecConstantOp length (#2652)
2019-06-05 afdx Add fuzzer pass to add dead breaks. (#2654)
2019-06-04 afdx Add fuzzer pass that adds useful constructs to a module (#2647)
2019-06-03 jbolz Add validation for SPV_EXT_fragment_shader_interlock (#2650)
2019-05-31 zoddicus Remove asserts from GetUnderlyingType (#2646)
2019-05-31 dsinclair Close opened file handles. (#2644)
2019-05-31 kevin.petit Validate OpenCL rules for ImageRead and OpImageSampleExplicitLod (#2643)
2019-05-31 afdx Add spirv-fuzz pass to permute blocks. (#2642)
2019-05-29 pierremoreau Linker: Better type comparison for OpTypeArray and OpTypeForwardPointer (#2580)
Roll third_party/glslang/ f88e5824d..f9d08a25f (44 commits)
f88e5824d2..f9d08a25fb
$ git log f88e5824d..f9d08a25f --date=short --no-merges --format='%ad %ae %s'
2019-06-18 cepheus Bump revision.
2019-06-17 cepheus AST/SPV: Fix#930: translate uvec4 <-> uint64 for SubgroupGeMask et. al.
2019-06-18 cepheus Bump revision.
2019-06-17 cepheus SPV: Add a switch for favoring non-NaN operands in min, max, and clamp.
2019-06-17 cepheus Bump revision.
2019-06-17 siglesias Delete duplicated gl_SubGroupSizeARB builtin treatment
2019-06-12 siglesias Add missing GL_ARB_shader_ballot builtins to Geometry and Tessellation shaders
2019-06-14 jbolz Add gl_SemanticsVolatile to GL_KHR_memory_scope_semantics, and make volatile-qualified atomics generate MemorySemanticsVolatile when using the Vulkan memory model
2019-06-13 alanbaker Update test expectations for new SPIRV-Tools
2019-06-13 alanbaker Update known good SPIRV-Tools
2019-06-04 dkoch Add support for GL_NV_shader_sm_builtins
2019-06-08 cepheus GLSL: Revert f6873f7 to fix#1764.
2019-06-07 jbolz Use spvValidatorOptionsSetBeforeHlslLegalization for pre-legalized HLSL
2019-06-06 greg Uppdate spirv-tools known-good
2019-06-05 dsinclair Remove unused parameter
2019-06-04 jbolz Add missing NV_EXTENSIONS ifdef
2019-06-03 jbolz Support GL_ARB_fragment_shader_interlock
2019-05-27 dkoch Fix subgroup support for ray tracing
2019-05-30 dkoch Add AST tests for ray tracing shaders
2019-05-30 dkoch Add AST tests for mesh and task shaders
2019-05-30 dkoch Add more subgroup testing
2019-05-30 jbolz Allow runtime-sized arrays of acceleration structures
2019-05-28 dkoch Fix include guard for GL_EXT_multiview
2019-05-28 dkoch Return consistent names from CapabilityString
2019-05-23 mattparks5855 Fixed .dll install on MSVC.
2019-05-17 thomasanderson Remove non-source sources from binary targets
2019-05-16 syoussefi Build.gn: allow optimization in glslang lib and standalone
2019-05-16 dneto Update SPIRV-Tools, SPIRV-Headers
2019-05-10 cepheus Build: Fix 3 warnings.
2019-05-10 cepheus Bump version and revision.
2019-05-09 cepheus SPV 1.4: Move to 1.4 validation, removing all 1.4 validation failures.
2019-03-31 cepheus SPV 1.4: Emit SignExtend and ZeroExtend for integer image reads/writes.
2019-02-07 cepheus SPV 1.4: Lookup tables: Use variable initializer and NonWritable...
2019-01-15 cepheus SPV 1.4: Add support for OpCopyLogical, careful of Boolean differences.
2019-01-12 cepheus SPV 1.4: Implement the 5 new loop controls.
2019-01-10 cepheus SPV 1.4: Use OpSelect for trivial typed non-scalar/vector expressions.
2019-01-04 cepheus SPV 1.4: Add testing infrastructure for SPV 1.4 tests.
2019-01-04 cepheus SPV 1.4: Generate all globals on OpEntryPoint interface list.
2019-05-09 cepheus SPV: Move to the SPIR-V 1.4 header.
2019-05-09 cepheus Latest known-good SPIRV-Tools: WARNING: Needs python 3.x.
2019-05-09 cepheus Bump revision.
2019-05-08 jbolz For nonuniformEXT constructor, make a copy of the node to decorate
2019-03-08 jbolz Add support for GL_EXT_buffer_reference2
2019-02-17 jbolz Add Float16/Int8/Int16 capabilities for private variables and function parameters
Roll third_party/spirv-cross/ fce83b7e8..05ea05509 (46 commits)
fce83b7e8b..05ea055096
$ git log fce83b7e8..05ea05509 --date=short --no-merges --format='%ad %ae %s'
2019-06-18 post Make sure args.msl22 is set in test_shaders.py.
2019-06-18 post MSL: Fix path check in test_shaders.py.
2019-06-17 post MSL: Conditionally validate MSL 2.2 shaders.
2019-06-14 post MSL: New SDK errors out on cull distance.
2019-06-13 post MSL: Fix regression with Private parameter declaration.
2019-06-12 post MSL: Support stencil export.
2019-06-12 post GLSL: Support GL_ARB_shader_stencil_export.
2019-06-11 post MSL: Support Invariant qualifier on position.
2019-06-12 post Add MSL 2.2 path in test_shaders.py.
2019-06-10 post Expand constexpr sampler sanity check.
2019-06-10 post MSL: Support remapping constexpr samplers by set/binding.
2019-06-10 post Employ heuristics to figure out how to emit SSBO/UAV reflection names.
2019-06-06 post Deal with nested loops.
2019-06-06 post Use the existing loop dominator when doing loop variable preservation.
2019-06-06 post Rewrite how loop dominators are propagated.
2019-06-06 post Deal with case where a variable is dominated by inner part of a loop.
2019-06-05 pmours Fix storage packing qualifiers missing on "shaderRecordNV" buffers
2019-06-05 pmours Add test for callable data
2019-06-05 pmours Fix callable data variables
2019-06-03 pmours Add support for "shaderRecordNV" qualifier
2019-06-05 post Deal with case where a block is somehow emitted in a duplicated fashion.
2019-06-02 post Fix erronous default for emit_line_directives.
2019-05-31 post MSL: Fix declaration of unused input variables.
2019-05-28 post Fixup OpLine parsing comments.
2019-05-28 post Support emitting OpLine directive.
2019-05-28 post GLSL: Support std430 in UBOs with scalar layout.
2019-05-27 post Run format_all.sh.
2019-05-27 post MSL: Use correct address space when passing array-of-buffers.
2019-05-27 post OpArrayLength must trigger active variables.
2019-05-27 post MSL: Implement OpArrayLength.
2019-05-24 post Add Git/timestamp --revision support.
2019-05-23 post MSL: Add test case for complex type alias.
2019-05-23 post MSL: Fix struct declaration order with complex type aliases.
2019-05-18 post Fix formatting, update C ABI version.
2019-05-09 post MSL: Support argument buffers and image swizzling.
2019-05-08 stuart.carnie Add get_member_name and active_buffer_ranges to C APIs
2019-05-17 amerkoleci Fix spvc_type_get_vector_size C function.
2019-05-16 cdavis Remove fallback for OpGroupNonUniformElect.
2019-05-15 cdavis MSL: Add support for subgroup operations.
2019-05-14 post Only deploy on new tags.
2019-05-14 post Add setup for Github releases via Travis.
2019-05-14 post Validate that C ABI in CMakeLists.txt matches code.
2019-05-14 post Run format_all.sh.
2019-05-11 laszlo.agocs GLSL: Add option to disable buffer blocks regardless of version
2019-05-13 post Fix nonuniform test for MSL.
2019-05-13 post HLSL/MSL: Deal correctly with nonuniformEXT qualifier.
Roll third_party/spirv-headers/ c4f8f6579..de99d4d83 (17 commits)
c4f8f65792..de99d4d834
$ git log c4f8f6579..de99d4d83 --date=short --no-merges --format='%ad %ae %s'
2019-06-12 dneto Add Volatile to Memory Semantics, for SPV_KHR_vulkan_memory_model
2019-06-10 ehsannas Add grammar and symbols for UserTypeGOOGLE extension to unified1.
2019-06-07 cepheus Add missing "version" : "None" to a bunch of reserved enumerants.
2019-06-07 cepheus Add more detail about reserving tokens to the README.
2019-06-07 cepheus Restore numerical order in enumerants.
2019-06-02 jbolz Add SPV_EXT_fragment_shader_interlock
2019-05-17 dkoch Add support for SPV_NV_sm_shader_builtins
2019-05-31 cepheus OpenCL ext. inst. header: Support C in addition to C++.
2019-05-27 michael.kinsner Proposed LoopControl bitfield allocation mechanism in spir-v.xml
2019-05-23 victor Reserve token range for Codeplay
2019-05-18 mchiasson Update CMakeLists.txt
2019-05-16 jbolz Update HasResultAndType code generation to skip duplicate enum values. There weren't any until SPIR-V 1.4 release, now there are two.
2019-05-16 mchiasson updated as per code review
2019-05-12 alan Compare enum names rather than values to determine last element
2019-05-11 mchiasson cmake development configuration package Fixes#104
2019-05-09 rex.xu Enable Groups capability by the extension SPV_AMD_shader_ballot
2019-04-30 ian.d.romanick Add INTEL_shader_integer_functions2
Created with:
roll-dep third_party/SPIRV-Tools third_party/glslang third_party/spirv-cross third_party/spirv-headers
Change-Id: Ie30848dc4e2d6932dc86d42c632537a19828329a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8181
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This patch adds the validation on the texture copies with BC formats.
1. BufferCopyView.offset in B2T and T2B copies must be a multiple of the
compressed texel block size in bytes.
2. BufferCopyView.rowPitch in B2T and T2B copies refers to the number of
bytes from the start of one row of blocks to the start of the next
row of blocks.
3. BufferCopyView.imageHeight must be a multiple of the compressed texel
block height (4 for BC formats).
4. All members in TextureCopyView.origin must be a multiple of the
corresponding dimensions of the compressed texel block (4x4x1 for BC
formats).
5. All the mumbers in 'copySize' must be a multiple of the corresponding
dimensions of the compressed texel block (4x4x1 for BC formats)
because D3D12 requires the width and height of a texture in BC
formats must be multiples of 4.
6. Compute the texture size in non-zero mipmap levels with paddings for
textures in BC formats when necessary.
BUG=dawn:42
TEST=dawn_unittests
Change-Id: Iac8d6c93ab8b37bb46becffd4175339722ab6016
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7860
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This completely removes the dependency on glad by generating the GL
headers from gl.xml directly.
This requires adding khrplatform.h so all Khronos dependencies are
gathered in third_party/khronos.
Also removes a stray CMakeLists.txt that was still hanging out.
BUG=dawn:165
Change-Id: Ia64bc51bc8b18c6b48613918e2f309f7405ecb3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8163
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This move all the OpenGL-specific code for swapchain handling in a new
NativeSwapChainImpl in the OpenGL backend so no code outside of
dawn_native needs OpenGL.
BUG=dawn:165
Change-Id: I3c0c1055e3215a59fdc8e9550baf30762a7014b5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8161
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
When transitioning from the COMMON state, an explicit ResourceBarrier
call is unnecessary and can be handled implicitly by the driver. This
acts as an optimization because no synchronization waits are required
when transitioning from the COMMON state.
Bug: dawn:167
Change-Id: Ifd45236dc51c339de8b9945e6f4e2a00934f3676
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7920
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The generated OpenGLFunctionsBase code uses the MemoryBarrier identifier
which is a macro defined in windows.h. Undefined it in
windows_with_undefs.
BUG=dawn:165
Change-Id: I6fcfef8fa14074e946d6c13536c1ae33b38c2ac2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8160
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This makes the OpenGL entry points loaded at Adapter creation from the
getProcAddress passed in the DiscoveryOptions and update all GL calls in
the backend to go through the new OpenGLFunctions object.
A code generator is added that generates the function loader and list of
GL procs from Khronos' gl.xml file but we can't get rid of glad yet
because it is used to have the PROC typedefs and enum values.
BUG=dawn:165
Change-Id: I2a583d79752f55877fa4190846f5be16cf91651a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7983
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This patch adds VK_IMAGE_USAGE_TRANSFER_DST_BIT usage when creating
Vulkan images because when we do resource initialization with
vkCmdClearColorImage() and vkCmdClearDepthStencilImage(), the image must
have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
according to Vulkan SPEC.
BUG=dawn:171
TEST=dawn_end2end_tests
Change-Id: Iaba6c04c6942354cc6be502eeee04457d3f43ba7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8100
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This is necessary because we currently use GLAD to generate all the
OpenGL enums and proc typedef that we use.
BUG=dawn:165
Change-Id: Ie1b88fd676421703e9af63dafe6dee168c600d4d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7982
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Gather device info at device initialization rather than adapter initialization.
BUG=dawn:144
Change-Id: I07e114731a37f3738daa585afa99675f2fd36289
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7700
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This patch fixes a bug in the computation of texture copy buffer size.
As the 'width' and 'height' in copy commands are all in pixels, while
the buffer size is counted in bytes, we shoud first convert 'width' into
bytes before calculating the buffer size.
BUG=dawn:42
TEST=dawn_unittests
Change-Id: Iebd5ed07a54eea762f4a653e295ecacb845ba32f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7940
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
We need a negative number in a buffer of uint32_t, to test negative
baseVertex. MSVC requires an explicit cast here.
Bug: dawn:172
Change-Id: Iea6c609f11054ba02e5c041fff89def0557c8091
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8060
Commit-Queue: Idan Raiter <idanr@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This prevents dirty textures to be used when memory is recycled
while destroying/creating textures. If a texture is not cleared at load,
it will be cleared to 0 before it is used.
Bug: dawn:145
Change-Id: Ia3f02427478fb48649089829186ccb377caa1912
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6960
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This merges all the files for main.py together again except
generator_lib.py because there doesn't seeem to be a good way to
separate the pure dawn.json generators and the dawn wire generator.
Also updates the GN templates to make it easier to define new generators
based on generator_lib, and move the Jinja2 template "stdlib" to
generator_lib.py
BUG=dawn:165
Change-Id: I1b5b2ef0a59cb142e214f3af9a58048a88ae949a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7880
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
We need a 32-bit Dawn CQ builders to catch build breakages on those
platforms.
Bug: dawn:168
Change-Id: Iafc1af9002992fbf16c9ca996fd578dc21aa516d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8040
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>