This patch adds validation code for API side for readonly storage
buffer. It also adds unit tests for API validation.
BUG=dawn:180
Change-Id: I9a97c5f3aa23e720619d138ca55d7b17f08d64c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12620
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Roll third_party/SPIRV-Tools/ e8c3f9b0b..618ee5094 (15 commits)
e8c3f9b0b4..618ee50942
$ git log e8c3f9b0b..618ee5094 --date=short --no-merges --format='%ad %ae %s'
2019-10-30 dneto Fix some clang-tidy issues in graphics_robust_access_pass (#2998)
2019-10-30 stevenperron Add description of wrap-opkill. (#3000)
2019-10-30 kubak [opt] Do not compare optimized binary with an invalidated buffer (#2999)
2019-10-29 bclayton utils/vscode: Change assembly file ext to .spvasm (#2995)
2019-10-28 bclayton utils: Add a vscode extension for SPIR-V disassembly files (#2987)
2019-10-28 greg Add two new simplifications. (#2984)
2019-10-28 afdx spirv-fuzz: Transformation to extract from a composite object (#2991)
2019-10-27 afdx spirv-fuzz: rename class, and fix bug related to dominance (#2990)
2019-10-25 afdx spirv-fuzz: Rework management of data synonyms (#2989)
2019-10-25 afdx spirv-fuzz: add class to represent equivalence relation (#2988)
2019-10-23 stevenperron Update DEPS (#2986)
2019-10-22 afdx spirv-fuzz: fuzzer pass to adjust memory access operands (#2968)
2019-10-22 greg Instrument: Add missing def-use analysis. (#2985)
2019-10-22 afdx spirv-fuzz: add missing functionality for matrix composites (#2974)
2019-10-21 stevenperron Update CHANGES
Roll third_party/glslang/ 834ee546f..b131630e7 (16 commits)
834ee546f9..b131630e7c
$ git log 834ee546f..b131630e7 --date=short --no-merges --format='%ad %ae %s'
2019-10-24 greg Update spirv-tools known good.
2019-10-23 ehsannas Make buildbot licenses consistent with the rest of the code
2019-10-23 52076061+digit-google BUILD.gn: Fix fuchsia build (#1944)
2019-10-21 cepheus Web: Reclaim more space and make all work w/wo GLSLANG_WEB.
2019-10-18 cepheus Web: Add basic atomics for SSBOs.
2019-10-17 cepheus Web: Add SSBOs and a few other missing compute features.
2019-10-10 cepheus Web: Add compute stage.
2019-10-08 cepheus Web: Add separate texture/sampler, exclude *CubeArray*.
2019-10-22 47668180+tsuoranta Enable generation of compile_commands.json (#1938)
2019-10-21 dexcelstraun7 Fix the exports of glslang-default-resource-limits (#1942)
2019-10-18 ehsannas Run tests on Windows too.
2019-10-18 ehsannas Fix build scripts.
2019-10-18 ehsannas More cleanups for Windows.
2019-10-17 ehsannas Add Kokoro bots for building using Bazel.
2019-10-17 ehsannas Make it work on Windows.
2019-10-16 ehsannas Add Bazel build configuration files.
Roll third_party/shaderc/ c4835b852..0a260d789 (5 commits)
c4835b8523..0a260d789f
$ git log c4835b852..0a260d789 --date=short --no-merges --format='%ad %ae %s'
2019-10-30 rharrison Refactor file reading code into common utility method (#852)
2019-10-30 rharrison Rolling 5 dependencies & expectation files (#849)
2019-10-22 dneto Android.mk: Install all necessary headers (#846)
2019-10-22 9856269+sarahM0 spvc: add spvc parsing option to msl, glsl and vulkan compilers (#845)
2019-10-21 rharrison Rolling 4 dependencies, small script fix and updating expectation files (#844)
Roll third_party/spirv-cross/ ff1897ae0..00189b19a (90 commits)
ff1897ae0e..00189b19a5
$ git log ff1897ae0..00189b19a --date=short --no-merges --format='%ad %ae %s'
2019-10-29 post MSL: Add missing reference output.
2019-10-29 post Fix broken access tracking for OpFunctionCall results.
2019-10-28 post MSL: Avoid some fallthrough warnings.
2019-10-28 post Run format_all.sh.
2019-10-28 post MSL: Remove hacky workaround for patch constant passing.
2019-10-28 post MSL: Remove workaround for passing constant arrays to functions.
2019-10-28 post Remove another dead reference file.
2019-10-28 post Remove some more dead reference files.
2019-10-28 post Remove another dead reference file.
2019-10-28 post Remove dead reference file.
2019-10-28 post Hack some constants in UE4 tests.
2019-10-28 post MSL: Ensure stable output for access chain CFG workarounds.
2019-10-26 post MSL: Fix integer cast.
2019-10-26 post MSL: Declare arrays with proper type wrapper.
2019-10-26 post MSL: Deal with chained access chains for tessellation IO variables.
2019-10-26 post MSL: Declare struct type explicitly.
2019-10-26 post MSL: Fix array of array declaration.
2019-10-25 post MSL: Rewrite tessellation_access_chain.
2019-10-25 post MSL: Slight cleanup in emit_tessellation_access_chain.
2019-10-25 post MSL: Do not declare variables which will not be unflattened.
2019-10-25 post MSL: Report tess input array failures more accurately.
2019-10-25 post MSL: Revert hack with kBufferSizeBufferBinding
2019-10-25 post MSL: Remove stale code for TextureSwizzle.
2019-10-24 post GLSL: Minor nit, check flushed_phi_variables with count().
2019-10-24 post Clean up call to builtin_translates_to_nonarray.
2019-10-24 post Implement constant empty struct correctly on all backends.
2019-10-24 post MSL: Rewrite propagated depth comparison state handling.
2019-10-24 post MSL: Do read-only lookups of access_chain_children.
2019-10-24 post MSL: Remove stray allow_id_rewrite().
2019-10-24 post MSL: Do not declare array of UBO/SSBO as spvUnsafeArray<T>.
2019-10-24 bill.hollings MSL: Support option for treating 1D textures as 2D textures of height 1.
2019-10-24 bill.hollings MSL: Support option for treating 1D textures as 2D textures of height 1.
2019-10-24 post MSL: Enable proper value types for return and value-passing of arrays.
2019-10-24 post MSL: Be a little clearer how needs_base_vertex_idx is implemented.
2019-10-24 post MSL: Remove some dead code w.r.t. vertex/instance_idx.
2019-10-24 post MSL: Do not generate UnsafeArray<> for any array inside buffer objects.
2019-10-24 post MSL: Simplify framebuffer fetch implementation.
2019-10-24 post MSL: Fall back to GLSL path for non-invariant matrix multiply as well.
2019-10-24 post MSL: Fall back to GLSL path for non-invariant FP implementation.
2019-10-24 post MSL: Minor cleanups for texture atomic emulation.
2019-10-24 post MSL: Cleanup decoration forwarding for SampleMask.
2019-10-24 post MSL: Do not declare complex composite array in main for non-inlined.
2019-10-24 post Fix formatting in main.cpp.
2019-10-24 post Add new UE4 folders to CMake testing as well.
2019-10-23 lukas.hermanns Moved all UE4 test shaders into 'shaders-ue4/' folder.
2019-10-23 lukas.hermanns Removed 'argument_buffer_offset' and fixed packed matrix Metal output.
2019-10-22 lukas.hermanns Simplified overriding of 'access_chain_internal' function in CompilerMSL.
2019-10-21 lukas.hermanns Removed bounds checks in favor of SPIRV-Tools pass '--graphics-robust-access'
2019-10-09 lukas.hermanns Disabled spvUnsafeArray<> type for packed vectors and added test cases for those arrays.
2019-10-09 lukas.hermanns Added '--msl-invariant-float-math' option and new test case for it.
2019-09-27 lukas.hermanns Further updates for pull request #1162; also added two test cases for spvCubemapTo2DArrayFace function and added '--msl-framebuffer-fetch'/ '--msl-emulate-cube-array' compiler options.
2019-09-24 lukas.hermanns Update for pull request #1162 rev. 1
2019-09-23 lukas.hermanns Updates for pull request #1162
2019-09-19 lukas.hermanns Fixed false-positive optimization of builtin variables (may happen when 'spvOut' is emitted).
2019-09-18 lukas.hermanns Updated test shaders.
2019-09-18 lukas.hermanns Rearranged all 'UE Change' comments to match to project's coding style.
2019-09-17 lukas.hermanns Removed reference specifiers in 'spvFMul*' functions to avoid address specifiers.
2019-09-17 lukas.hermanns Updated reference Metal shaders.
2019-09-17 lukas.hermanns Avoid emitting 'spvUnsafeArray<>', 'spvFMul*', and 'spvFAdd' custom functions if they are not needed.
2019-09-17 lukas.hermanns Further adjustments to make Metal backend work again in UE4 on Mac.
2019-09-16 lukas.hermanns Renamed new test shaders to fit the naming convention in SPIRV-Cross.
2019-09-13 lukas.hermanns Added a new 'emulate_cube_array' option to SPIRV-Cross to cope with translating TextureCubeArray into texture2d_array for iOS where this type is not available. (Original Author: Mark Satterthwaite)
2019-09-13 lukas.hermanns Removed all '.DS_Store' files.
2019-09-13 lukas.hermanns Adjustments after rebase of ue4_dev branch.
2019-08-26 mark.satterthwaite OpImageTexelPointer needs to use an int coordinate type for GLSL, but not for MSL.
2019-08-26 mark.satterthwaite Remove obsolete memory barrier scope specification from Metal output, this API has been removed.
2019-08-14 mark.satterthwaite Add an option to SPIRV-Cross to enforce invariant floating point math to prevent different depth calculation between prepass & basepass when running on Metal 2.0 and earlier.
2019-08-14 mark.satterthwaite More fixes to handling packing & access elements in an array. Made in two parts. 1. Don't allow AccessChain operations to add duplicated swizzles when accessing packed arrays. 2. Only pack arrays when there is the proper amount of space between members in a struct, otherwise it will definitely be wrong.
2019-08-14 mark.satterthwaite Update the Metal shaders to account for changes in the shader compilation.
2019-08-14 mark.satterthwaite Fix texture swizzling.
2019-08-14 mark.satterthwaite The result of an AccessChain intrinsic in SPIRV can be referenced by multiple blocks but when they are loops that can result in compilation problems because the source variables might not be declared early enough. This forces us to hoist those variables high enough to make it work.
2019-08-14 mark.satterthwaite There are occasions where phi-variable copies are introduced for original variables which are fully declared, which coud result in the phi-variable never being declared and the shader not compiling, so declare the phi-variables when this happens. Change made in two parts. 1. Ensure that we declare phi-variable copies even if the original declaration isn't deferred. 2. Only flush phi variables once, avoids duplicate definitions.
2019-08-14 mark.satterthwaite When converting from HLSL the dxc SPIRV output often contains variables that are written through (e.g. a = b = c;) which seems to break the tracking of expressions in SPIRV-Cross, so don't reset everything once configured.
2019-08-14 mark.satterthwaite Provide the Metal bindings as part of the options structure as that is more convenient.
2019-08-14 mark.satterthwaite Slight modifications to IAB support for Metal output, so that the caller can specify an offset for the IAB start index, as for HLSL shaders UAVs need to occupy slots 0-7. The runtime support for SSBO robustness is also much simpler if the buffer size block is at index 0. Change made in two parts. 1. Allow the caller to specify the Metal translation should use argument buffers. 2. Move this to the front of IABs for convenience of the runtime.
2019-08-14 mark.satterthwaite Metal doesn't automatically enforce robust access to buffers unlike other APIs, so for storage-buffers, which become raw T* buffers in Metal, we need to fetch the buffer size and clamp the access to a valid index within the buffer ourselves. This is essential for shaders converted from HLSL which expects all resource access to be robust, though this implementation is technically different to the HLSL specification of return-0 for OOB reads, ignore OOB writes.
2019-08-14 mark.satterthwaite HLSL makes position calculations invariant by default to eliminate problems with depth-precision, Apple added a similar qualifier for Metal 2.1 that can and should be used in Vertex & Domain/TessEval shaders for the same effect.
2019-08-14 mark.satterthwaite When compiling from HLSL which pads and aligns float[]/float2[] within structures to float4[] we need to unpack the original type in Metal from the float4.
2019-08-14 mark.satterthwaite Fix conversion of the SampleMask intrinsic from SPIRV, where it is an array to Metal where it isn't.
2019-08-14 mark.satterthwaite Fixes to the generation of Metal tessellation shaders from SPIRV so that it works correctly in more complicated cases. First, when generating from HLSL before invoking the code that comes from the HLSL patch-function a control-flow and full memory-barrier are required to ensure that all the temporary values in thread-local storage for the patch are available. Second, the inputs to control and evaluation shaders must be properly forwarded from the global variables in SPIRV to the member variables in the relevant input structure. Finally when arrays of interpolators are used for input or output we need to add an extra level of array indirection because Metal works at a different granularity than SPIRV.
2019-08-14 mark.satterthwaite Work-around HLSL using zero-based InstanceID and VertexID variables, but SPIRV, like Metal, includes BaseInstance & BaseVertex. Until this can be fixed in DXC, which is really the proper place to solve this, we can decrement InstanceID & VertexID when the source is HLSL. Made in two parts. 1. Handle HLSL-style 0-based vertex/instance index. 2. We zero-base the InstanceID & VertexID variables for HLSL emulation elsewhere, so don't do it twice.
2019-08-14 mark.satterthwaite On iOS sub-passes can be implemented using the frame-buffer fetch API which is much more efficient than binding the textures. Change was made in three parts. 1. Use Metal's native frame-buffer fetch API for subpass inputs. 2. Make sure that frame-buffer-fetch is only available on iOS. 3. Default to using Metal's native frame-buffer fetch for subpass inputs on iOS.
2019-08-14 mark.satterthwaite SPIRV doesn't distinguish depth textures from regular textures, but Metal does, so if we've ever seen a depth comparison operation we must ensure that the texture is specified as a depth-texture.
2019-08-14 mark.satterthwaite Emulate texture atomics in Metal by binding the underlying buffer that backs the resource to a separate binding point and using that for Metal's atomic operations. This will work with texture_buffer and texture2d created from an MTLBuffer, so is perfect for emulating HLSL atomics on RWBuffer and sufficient, but not ideal, for RWTexture2D with some restrictions (limited format support and can't be used for render-targets).
2019-08-14 mark.satterthwaite Support Metal 2.1's texture_buffer type which is the equivalent to HLSL's Buffer/RWBuffer, so doesn't require modifying buffer sizes to match alignments.
2019-08-13 mark.satterthwaite In order to use Metal shader libraries properly you have to ensure that you have no duplicated global symbol names for different entities, otherwise 'metallib' won't be able to combine multiple shaders into a single library. This is broken into two parts. 1. Constant arrays of non-primitive types (i.e. matrices) won't link properly into Metal libraries. 2. Metal helper functions must be static force-inline otherwise they will cause problems when linked together in a single Metallib.
2019-08-13 mark.satterthwaite Rework the way arrays are handled in Metal to remove the array copies as they are unnecessary from Metal 1.2. There were cases where copies were not being inserted and others appeared unncessary, using the template type should allow the 'metal' compiler to do the best possible optimisation. The changes are broken into three stages. 1. Allow Metal to use the array<T> template to make arrays a value type. 2. Force the use of C style array declaration for some cases which cannot be wrapped with a template. 3. Threadgroup arrays can't have a wrapper type. 4. Tweak the code to use unsafe_array in a few more places so that we can handle passing arrays of resources into the shader and then through shaders into sub-functions. 5. Handle packed matrix types inside arrays within structs. 6. Make sure that builtin arguments still retain their array qualifiers when used in leaf functions. 7. Fix declaration of array-of-array constants for Metal so we can use the array<T> template.
2019-08-13 mark.satterthwaite UE4 shader reference for those shaders that will compile without the changes.
2019-08-13 mark.satterthwaite Port the UE4 spirv shaders to ASM shaders that can be used in the test-rig - this will help show why the changes are required.
2019-08-13 mark.satterthwaite Many interesting test cases for SPIRV-Cross taken from compiling UE4 shaders. These highlight the reasons for the various changes we've made.
Created with:
roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers
Change-Id: I2a8721a29f71e50b617792cb5c898452617ed362
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12940
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
We have already been validating the component type of a texture matches
the bind group layout. Here is another constraint introduced by
https://github.com/gpuweb/gpuweb/pull/384. For better code reuse,
conversion from wgpu::TextureComponentType to dawn_native::Format::Type
is factored out as a helper function.
Bug: dawn:202
Change-Id: I394497722b4043dc109eca60116224b7a617e02e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12860
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
These tests draw a simple triangle with many ways of encoding commands,
binding, and uploading data to the GPU. This tests the performance of Dawn's
validation, command recording, and submission by switching buffer
bindings, bind groups, and pipelines. Some test instantiations upload
per-draw data to test efficiency of resource transitions or pre-record
commands in a render bundle.
Change-Id: I9994cd96ef5988cca410462418792f28161c0526
Bug: dawn:208
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12460
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This CL reads trace events from the tests and computes the total
time of validation and command recording.
Bug: dawn:208
Change-Id: I551d1e30e60b7d1a839b4fb834ad3608c6cedf63
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12782
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This fixes bugs where we try to uncache objects that fail creation.
Bug: dawn:249
Change-Id: Ic60b3ce702dfdda18baa6d263911885a43d3cda7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12820
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Removes unbounded heap growth by capping the heap
size to 4MB and falling back to direct allocation for larger
requests.
BUG=dawn:239
Change-Id: I9ae660809e3c0c539fbcfbee4afcf6fb1f466355
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12720
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Change-Id: I6d029dcddcfb77bbf30daa331ab066b6c254ee89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12840
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Explicit enums are simpler to use in Dawn and allow only specific
categories which the perf tests understand.
Also adds trace events around command recording and validation on
all backends.
Bug: dawn:208
Change-Id: I7859ffd6668b20893780c6081bf2c9019a7115e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12781
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Previously, the trace event buffer was cleared after *all* tests
completed. In order to avoid allocating a ton of space to hold
traces, this patch factors the trace event recording so that the
buffer is processed and reset at the end of each test trial.
This patch also prepares for the future where trace events will be
processed at the end of each trial to compute additional metrics.
Bug: dawn:208
Change-Id: If2ed193ee47794c666df9f0b369ec1ce660b177f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12780
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This missing identifier is used to match async trace events. Its
absence broke async trace events since their Begin/End could not
be matched correctly.
Bug: dawn:208
Change-Id: I0671af8c3cbb8ff6220adcb8ed5621b831e383c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12760
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This makes the Vulkan backend use the BuddyMemoryAllocator to
sub-allocate small resources inside a larger VkDeviceMemory object.
Right now the heuristic to decide to do suballocation is naive and
should be improved.
BUG=dawn:27
Change-Id: Idcc7b6686c086633c85328a7afb91ee84abf7b8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12662
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This mostly makes the MemoryAllocator not owned by the
BuddyResourceAllocator so that we don't need an extra class for the
dependency injection in the Vulkan backend. (the container for the
BuddyMemoryAllocator can be it's MemoryAllocator at the same time).
Also renames methods of MemoryAllocator to be more explicit.
Also renames the constructor parameter of BuddyMemoryAllocator to be
(subjectively) closer to what the represent.
BUG=dawn:27
Change-Id: I37355ad5b3cded143956f0adc4742fa1b717e9bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12661
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This removes the duplication of the memory allocators in preparation for
using sub-allocation in the Vulkan backend too.
Also renames ResourceMemory to ResourceHeap and MemoryResourceAllocator
to ResourceMemoryAllocator, and fixes a number of unused includes.
BUG=dawn:27
Change-Id: I1a9e7d41e5efafa5192bda1d89dc06455fa2af40
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12660
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Austin added barriers for storage buffer in compute pipeline in
this patch (https://dawn-review.googlesource.com/c/dawn/+/12301).
This case now can work fine.
Bug: dawn:236
Change-Id: Id449ae5053f1f018ea95c271bff7e4ab2180a937
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12640
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Updates TextureD3D to use the allocation handle and
defaults to using MSAA heaps.
BUG=dawn:27
Change-Id: I2318bb8d068df86364cb2ebc433f4737e9e121aa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12580
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
This patch extends the BindGroupTracker in the D3D12 and Vulkan backends to
track bound storage buffers. We insert barriers between dispatches to properly
synchronize writes to storage buffers.
Bug: dawn:236
Change-Id: Iab3f964c345b64755557ab206e05a2ff7b0a3a1f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12301
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
webgpu.h is the "official" header for WebGPU in native and is being
developed in https://github.com/webgpu-native/webgpu-headers
dawn.h and dawncpp.h are changed to become webgpu.h and webgpu_cpp.h
respectively and use the new naming convention. New dawn.h and dawncpp.h
headers are created that just proxy the types, constants and functions
to their WebGPU counterpart.
Almost no naming change is done in Dawn in this commit, which help check
that the proxying headers work correctly. A couple changes were
necessary, in particular for tests of the internal of dawncpp.h, and a
workaround for a standard library bug for std::underlying_type was
removed because it is no longer needed and got in the way.
Finally since some templates were renamed to match the name of the file
they create instead of using the generic "api" name.
BUG=dawn:22
Change-Id: I12ee22d0b02ccb5b8a52ceccabb3e63ce74da007
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12480
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
11on12 has a bug where D3D12 resources used only for keyed
shared mutexes are not released until work is submitted to
the device context and flushed.
The most minimal work we can get away with is issuing a
TiledResourceBarrier.
ID3D11DeviceContext2 is available in Win8.1 and above.
This suffices for a D3D12 backend since both D3D12 and 11on12
first appeared in Windows 10.
Bug:dawn:217
Change-Id: I422eedf0de9c41777ab704f63520e2f2584f2afb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12520
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
This patch implements the serialization and deserialization of
DawnDeviceProperties in dawn_wire for the use of serializing this type
of object in Chromium.
BUG=chromium:996713
TEST=dawn_unittests
Change-Id: I1678627a017079540689d8529a1a7e1c975aae61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12240
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Parameter syncInterval of function Preset specifies how to synchronize
presentation of a frame. To turn off vsync in D3D12 backend,
set syncInterval to 0 which represents the presentation occurs
immediately.
BUG=dawn:237
Change-Id: Ic17f00bae5af9fd6bca4130d6e2282f3c34de4e6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12303
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
Dawn creates a keyed shared mutex for all wrapped resources and acquires
the mutex before the texture is used in an ExecuteCommandList call.
To coordinate with external clients, backend API has been extended
to allow clients to get and set the acquire key.
Pending and queue command lists have now been merged into one.
A future change will adjust GetPendingCommandContext to return a raw
command context without the need for error handling.
Bug:dawn:217
Change-Id: Ia96c449c305586407153f05ce75a40794b96027e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12220
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Roll third_party/SPIRV-Tools/ 253806adc..e3da3143b (14 commits)
253806adc4..e3da3143b2
$ git log 253806adc..e3da3143b --date=short --no-merges --format='%ad %ae %s'
2019-10-17 kubak Disallow use of OpCompositeExtract/OpCompositeInsert with no indices (#2980)
2019-10-17 rharrison Add fuzzer for spirv-dis call path (#2977)
2019-10-17 rharrison Check binary->code existence before destroying (#2979)
2019-10-17 akb825 Improved CMake install step. (#2963)
2019-10-16 kubak Support constant-folding UConvert and SConvert (#2960)
2019-10-16 rharrison Add fuzzer for spirv-as call path (#2976)
2019-10-15 afdx spirv-fuzz: Refactor 'copy object' and 'construct composite' transformations (#2966)
2019-10-15 dneto Update SPIR-V binary header test for SPIR-V 1.5 (#2967)
2019-10-14 afdx spirv-fuzz: Refactor 'split blocks' to identify instructions differently (#2961)
2019-10-11 alanbaker Validate that selections are structured (#2962)
2019-10-11 afdx spirv-fuzz: Rework id descriptors (#2959)
2019-10-11 afdx spirv-fuzz: Add fuzzer pass to add NoContraction decorations (#2950)
2019-10-11 afdx spirv-fuzz: Add fuzzer pass to change function controls (#2951)
2019-10-10 paulthomson reduce: add large tests and fix (#2947)
Roll third_party/glslang/ 4b97a1108..834ee546f (23 commits)
4b97a11081..834ee546f9
$ git log 4b97a1108..834ee546f --date=short --no-merges --format='%ad %ae %s'
2019-10-17 jbolz Only apply volatile semantics to atomics when using Vulkan Memory Model
2019-10-16 dsinclair Use commandline options instead of ENV variables
2019-10-16 rharrison Keep code style improvements
2019-10-16 dsinclair Indenting
2019-10-15 dsinclair Update CMakeLists.txt
2019-10-15 dsinclair Move TARGETDIR as well
2019-10-15 dsinclair Make runtests configurable.
2019-10-15 rharrison Fix config issues and revert previous fixes for semi-colon issues
2019-10-16 swda.durl Added an option to make pch enabled in Cmake
2019-10-15 wahlster find Python and add External subdir only if BUILD_EXTERNAL option was set (on by default) and /External dir exists
2019-10-14 cepheus GLSL/SPV: Pre SPIR-V 1.5, subgroupQuadBroadcast index must be constant
2019-10-12 geothrock remove redundant check
2019-10-12 Xottab-DUTY Fixed typo in README.md
2019-10-11 rharrison Forgot that GCC doesn't recognize this flag
2019-10-11 rharrison Remove unnecessary semi-colons and add warning about them
2019-10-10 cepheus Fix#1924: Promote SPV_EXT_physical_storage_buffer to KHR when required.
2019-10-10 greg Update spirv-tools known good.
2019-10-10 cepheus Fix#1924: Emit SPV_EXT_physical_storage_buffer, not the KHR form.
2019-09-04 lryer Fix code style issue and remove setXfbBufferStride new paramte
2019-09-02 lryer Adjusting code interface
2019-08-25 geothrock Add support for GL_ARB_explicit_uniform_location
2019-08-06 james.rumble Handle install vs build include directories
2019-08-06 james.rumble Export glslang targets on installation
Roll third_party/spirv-cross/ e5d3a6655..a92668bc1 (8 commits)
e5d3a6655e..a92668bc11
$ git log e5d3a6655..a92668bc1 --date=short --no-merges --format='%ad %ae %s'
2019-10-17 post Fix OpVectorExtractDynamic with spec constant op index.
2019-10-16 post Travis: Update PATH for Python3 on Windows.
2019-10-14 post MSL: Add opt-in support for huge IABs.
2019-10-14 post HLSL: Fix unrolled S/G LE/LT/GE/GT opcodes.
2019-10-14 post GLSL: Deal correctly with bitwidth on integer compares.
2019-10-14 post HLSL: Partially implement Unordered compare.
2019-10-14 post GLSL: Support unordered floating point compare.
2019-10-11 post MSL: Fix regression with OpCompositeConstruct from std140 float[].
Roll third_party/spirv-headers/ b252a5095..af64a9e82 (2 commits)
b252a50953..af64a9e826
$ git log b252a5095..af64a9e82 --date=short --no-merges --format='%ad %ae %s'
2019-10-15 cepheus Versioning: Complete the versioning change in recent commits.
2019-10-14 nicolai.haehnle buildHeaders: update version to SPIR-V 1.5
Created with:
roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers
Change-Id: I0396a3e0e20e7cfc74603ef60512c2c715eb2c70
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12440
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Trace data can be used to build additional metrics which measure
validation costs, GPU time, etc. It will also be helpful to store in
the test output for later analysis.
This CL also adds jsoncpp as a DEP so we can dump trace file json
output.
Bug: dawn:208
Change-Id: Ia6c05ca90aecae308ee6a4fd11e5f43bb03b1dc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12080
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
We now have a build step that ensures only the allowed generated file
directories are present so we don't need to remove the default includes
config anymore.
BUG=dawn:22
Change-Id: Id835d1bbb1f52a46ea6502f33b419e70207bba10
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12420
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
The current BufferUpload perf test calls WaitForGPU at the end of
every step to time how long the batch of uploads took. Future tests
will want to have multiple Steps or Frames in flight to mimic real
applications that use double or triple buffering. This patch removes
WaitForGPU and adds a |maxStepsInFlight| argument which a test can
set to configure how many steps can be running on the GPU.
For the BufferUpload tests, this is still 1.
Bug: dawn:208
Change-Id: I95ae12b2358e0283088205bd2ffd20532ea62871
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12302
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
An exported function of libdawn_native wasn't in libdawn_native_sources
instead of libdawn_native which made it not exported on Windows.
BUG=dawn:22
Change-Id: I824f1d4af18f8308b88e1650837cbe62374ace72
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
libdawn_native also requires the dawncpp headers. When we separated
libdawn_cpp from the dawn_headers, libdawn_native lost the cpp headers
and caused a compile failure. This patch separates the dawncpp headers
as a separate target so both libdawncpp and libdawn_native can depend
on them.
Bug: dawn:22
Change-Id: I4172f1654377afac8c4314123ee8b5b81dc7c928
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12300
Reviewed-by: David Turner <digit@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Added D3D12Error to check HRESULTS and return error messages
with the correct error names.
Remove ASSERT_SUCCESS from D3D12 backend and use
MaybeError and ResultError instead to handle errors.
Bug: dawn:19
Change-Id: Idf2f1987725e7e658bd29a9b13653125ab43c564
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12000
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Do explicit uint8_t -> float conversions (as was previously done for TextureVk).
Add a missing #include.
Change-Id: If7616ec00e2ea2cf55b9b0cc966b0436a5a21d9d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12280
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>