diff --git a/Cargo.lock b/Cargo.lock index 65dece41cf3b..f17deffbdc92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5598,7 +5598,6 @@ dependencies = [ "log", "parking_lot", "peek-poke 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ron", "serde", "smallvec", "vec_map", diff --git a/dom/webgpu/ipc/PWebGPU.ipdl b/dom/webgpu/ipc/PWebGPU.ipdl index 5e4902e5a431..d1bc215f7a7b 100644 --- a/dom/webgpu/ipc/PWebGPU.ipdl +++ b/dom/webgpu/ipc/PWebGPU.ipdl @@ -14,13 +14,13 @@ using SerialPipelineLayoutDescriptor from "mozilla/webgpu/WebGPUTypes.h"; using SerialBindGroupDescriptor from "mozilla/webgpu/WebGPUTypes.h"; using SerialComputePipelineDescriptor from "mozilla/webgpu/WebGPUTypes.h"; using SerialRenderPipelineDescriptor from "mozilla/webgpu/WebGPUTypes.h"; +using SerialTextureDescriptor from "mozilla/webgpu/WebGPUTypes.h"; using dom::GPURequestAdapterOptions from "mozilla/dom/WebGPUBinding.h"; using dom::GPUDeviceDescriptor from "mozilla/dom/WebGPUBinding.h"; +using dom::GPUBufferDescriptor from "mozilla/dom/WebGPUBinding.h"; using dom::GPUCommandEncoderDescriptor from "mozilla/dom/WebGPUBinding.h"; using dom::GPUCommandBufferDescriptor from "mozilla/dom/WebGPUBinding.h"; using dom::GPUPipelineLayoutDescriptor from "mozilla/dom/WebGPUBinding.h"; -using webgpu::ffi::WGPUBufferDescriptor from "mozilla/webgpu/ffi/wgpu.h"; -using webgpu::ffi::WGPUTextureDescriptor from "mozilla/webgpu/ffi/wgpu.h"; using webgpu::ffi::WGPUSamplerDescriptor from "mozilla/webgpu/ffi/wgpu.h"; using webgpu::ffi::WGPUTextureViewDescriptor from "mozilla/webgpu/ffi/wgpu.h"; using webgpu::ffi::WGPUBufferCopyView from "mozilla/webgpu/ffi/wgpu.h"; @@ -46,16 +46,16 @@ parent: async InstanceRequestAdapter(GPURequestAdapterOptions options, RawId[] ids) returns (RawId adapterId); async AdapterRequestDevice(RawId selfId, GPUDeviceDescriptor desc, RawId newId); async AdapterDestroy(RawId selfId); - async DeviceCreateBuffer(RawId selfId, WGPUBufferDescriptor desc, nsCString label, RawId newId); + async DeviceCreateBuffer(RawId selfId, GPUBufferDescriptor desc, RawId newId); async DeviceDestroy(RawId selfId); async DeviceUnmapBuffer(RawId selfId, RawId bufferId, Shmem shmem, bool flush); async BufferMapRead(RawId selfId, Shmem shmem) returns (Shmem sm); async BufferDestroy(RawId selfId); - async DeviceCreateTexture(RawId selfId, WGPUTextureDescriptor desc, nsCString label, RawId newId); - async TextureCreateView(RawId selfId, WGPUTextureViewDescriptor desc, nsCString label, RawId newId); + async DeviceCreateTexture(RawId selfId, SerialTextureDescriptor desc, RawId newId); + async TextureCreateView(RawId selfId, WGPUTextureViewDescriptor desc, RawId newId); async TextureDestroy(RawId selfId); async TextureViewDestroy(RawId selfId); - async DeviceCreateSampler(RawId selfId, WGPUSamplerDescriptor desc, nsCString label, RawId newId); + async DeviceCreateSampler(RawId selfId, WGPUSamplerDescriptor desc, RawId newId); async SamplerDestroy(RawId selfId); async DeviceCreateCommandEncoder(RawId selfId, GPUCommandEncoderDescriptor desc, RawId newId); async CommandEncoderCopyBufferToBuffer(RawId selfId, RawId sourceId, BufferAddress sourceOffset, RawId destinationId, BufferAddress destinationOffset, BufferAddress size); diff --git a/dom/webgpu/ipc/WebGPUChild.cpp b/dom/webgpu/ipc/WebGPUChild.cpp index 67a2168b9004..097c8a92cd29 100644 --- a/dom/webgpu/ipc/WebGPUChild.cpp +++ b/dom/webgpu/ipc/WebGPUChild.cpp @@ -73,12 +73,8 @@ Maybe WebGPUChild::AdapterRequestDevice( RawId WebGPUChild::DeviceCreateBuffer(RawId aSelfId, const dom::GPUBufferDescriptor& aDesc) { - ffi::WGPUBufferDescriptor desc = {}; - desc.size = aDesc.mSize; - desc.usage = aDesc.mUsage; - RawId id = ffi::wgpu_client_make_buffer_id(mClient, aSelfId); - if (!SendDeviceCreateBuffer(aSelfId, desc, nsCString(), id)) { + if (!SendDeviceCreateBuffer(aSelfId, aDesc, id)) { MOZ_CRASH("IPC failure"); } return id; @@ -119,28 +115,28 @@ UniquePtr WebGPUChild::GetDefaultViewDescriptor( RawId WebGPUChild::DeviceCreateTexture(RawId aSelfId, const dom::GPUTextureDescriptor& aDesc) { - ffi::WGPUTextureDescriptor desc = {}; + SerialTextureDescriptor desc = {}; if (aDesc.mSize.IsUnsignedLongSequence()) { const auto& seq = aDesc.mSize.GetAsUnsignedLongSequence(); - desc.size.width = seq.Length() > 0 ? seq[0] : 1; - desc.size.height = seq.Length() > 1 ? seq[1] : 1; - desc.size.depth = seq.Length() > 2 ? seq[2] : 1; + desc.mSize.width = seq.Length() > 0 ? seq[0] : 1; + desc.mSize.height = seq.Length() > 1 ? seq[1] : 1; + desc.mSize.depth = seq.Length() > 2 ? seq[2] : 1; } else if (aDesc.mSize.IsGPUExtent3DDict()) { const auto& dict = aDesc.mSize.GetAsGPUExtent3DDict(); - desc.size.width = dict.mWidth; - desc.size.height = dict.mHeight; - desc.size.depth = dict.mDepth; + desc.mSize.width = dict.mWidth; + desc.mSize.height = dict.mHeight; + desc.mSize.depth = dict.mDepth; } else { MOZ_CRASH("Unexpected union"); } - desc.mip_level_count = aDesc.mMipLevelCount; - desc.sample_count = aDesc.mSampleCount; - desc.dimension = ffi::WGPUTextureDimension(aDesc.mDimension); - desc.format = ffi::WGPUTextureFormat(aDesc.mFormat); - desc.usage = aDesc.mUsage; + desc.mMipLevelCount = aDesc.mMipLevelCount; + desc.mSampleCount = aDesc.mSampleCount; + desc.mDimension = ffi::WGPUTextureDimension(aDesc.mDimension); + desc.mFormat = ffi::WGPUTextureFormat(aDesc.mFormat); + desc.mUsage = aDesc.mUsage; RawId id = ffi::wgpu_client_make_texture_id(mClient, aSelfId); - if (!SendDeviceCreateTexture(aSelfId, desc, nsCString(), id)) { + if (!SendDeviceCreateTexture(aSelfId, desc, id)) { MOZ_CRASH("IPC failure"); } return id; @@ -169,7 +165,7 @@ RawId WebGPUChild::TextureCreateView( : aDefaultViewDesc.array_layer_count - aDesc.mBaseArrayLayer; RawId id = ffi::wgpu_client_make_texture_view_id(mClient, aSelfId); - if (!SendTextureCreateView(aSelfId, desc, nsCString(), id)) { + if (!SendTextureCreateView(aSelfId, desc, id)) { MOZ_CRASH("IPC failure"); } return id; @@ -193,7 +189,7 @@ RawId WebGPUChild::DeviceCreateSampler(RawId aSelfId, } RawId id = ffi::wgpu_client_make_sampler_id(mClient, aSelfId); - if (!SendDeviceCreateSampler(aSelfId, desc, nsCString(), id)) { + if (!SendDeviceCreateSampler(aSelfId, desc, id)) { MOZ_CRASH("IPC failure"); } return id; @@ -240,7 +236,7 @@ RawId WebGPUChild::DeviceCreateBindGroupLayout( : ffi::WGPUTextureFormat(0); entries.AppendElement(e); } - SerialBindGroupLayoutDescriptor desc = {nsCString(), std::move(entries)}; + SerialBindGroupLayoutDescriptor desc = {std::move(entries)}; if (!SendDeviceCreateBindGroupLayout(aSelfId, desc, id)) { MOZ_CRASH("IPC failure"); } diff --git a/dom/webgpu/ipc/WebGPUParent.cpp b/dom/webgpu/ipc/WebGPUParent.cpp index bfa7a9b256d3..ad6c35a604fc 100644 --- a/dom/webgpu/ipc/WebGPUParent.cpp +++ b/dom/webgpu/ipc/WebGPUParent.cpp @@ -179,6 +179,7 @@ ipc::IPCResult WebGPUParent::RecvAdapterRequestDevice( desc.limits.max_bind_groups = aDesc.mLimits.WasPassed() ? aDesc.mLimits.Value().mMaxBindGroups : WGPUDEFAULT_BIND_GROUPS; + Unused << aDesc; // no useful fields // TODO: fill up the descriptor ffi::wgpu_server_adapter_request_device(mContext, aSelfId, &desc, aNewId); return IPC_OK(); @@ -195,12 +196,10 @@ ipc::IPCResult WebGPUParent::RecvDeviceDestroy(RawId aSelfId) { } ipc::IPCResult WebGPUParent::RecvDeviceCreateBuffer( - RawId aSelfId, const ffi::WGPUBufferDescriptor& aDesc, - const nsCString& aLabel, RawId aNewId) { - ffi::WGPUBufferDescriptor desc = aDesc; - if (!aLabel.IsEmpty()) { - desc.label = aLabel.Data(); - } + RawId aSelfId, const dom::GPUBufferDescriptor& aDesc, RawId aNewId) { + ffi::WGPUBufferDescriptor desc = {}; + desc.usage = aDesc.mUsage; + desc.size = aDesc.mSize; ffi::wgpu_server_device_create_buffer(mContext, aSelfId, &desc, aNewId); return IPC_OK(); } @@ -253,23 +252,20 @@ ipc::IPCResult WebGPUParent::RecvBufferDestroy(RawId aSelfId) { } ipc::IPCResult WebGPUParent::RecvDeviceCreateTexture( - RawId aSelfId, const ffi::WGPUTextureDescriptor& aDesc, - const nsCString& aLabel, RawId aNewId) { - ffi::WGPUTextureDescriptor desc = aDesc; - if (!aLabel.IsEmpty()) { - desc.label = aLabel.Data(); - } + RawId aSelfId, const SerialTextureDescriptor& aDesc, RawId aNewId) { + ffi::WGPUTextureDescriptor desc = {}; + desc.size = aDesc.mSize; + desc.mip_level_count = aDesc.mMipLevelCount; + desc.sample_count = aDesc.mSampleCount; + desc.dimension = aDesc.mDimension; + desc.format = aDesc.mFormat; + desc.usage = aDesc.mUsage; ffi::wgpu_server_device_create_texture(mContext, aSelfId, &desc, aNewId); return IPC_OK(); } ipc::IPCResult WebGPUParent::RecvTextureCreateView( - RawId aSelfId, const ffi::WGPUTextureViewDescriptor& aDesc, - const nsCString& aLabel, RawId aNewId) { - ffi::WGPUTextureViewDescriptor desc = aDesc; - if (!aLabel.IsEmpty()) { - desc.label = aLabel.Data(); - } + RawId aSelfId, const ffi::WGPUTextureViewDescriptor& aDesc, RawId aNewId) { ffi::wgpu_server_texture_create_view(mContext, aSelfId, &aDesc, aNewId); return IPC_OK(); } @@ -285,12 +281,7 @@ ipc::IPCResult WebGPUParent::RecvTextureViewDestroy(RawId aSelfId) { } ipc::IPCResult WebGPUParent::RecvDeviceCreateSampler( - RawId aSelfId, const ffi::WGPUSamplerDescriptor& aDesc, - const nsCString& aLabel, RawId aNewId) { - ffi::WGPUSamplerDescriptor desc = aDesc; - if (!aLabel.IsEmpty()) { - desc.label = aLabel.Data(); - } + RawId aSelfId, const ffi::WGPUSamplerDescriptor& aDesc, RawId aNewId) { ffi::wgpu_server_device_create_sampler(mContext, aSelfId, &aDesc, aNewId); return IPC_OK(); } diff --git a/dom/webgpu/ipc/WebGPUParent.h b/dom/webgpu/ipc/WebGPUParent.h index fa8cb869d761..389732f17969 100644 --- a/dom/webgpu/ipc/WebGPUParent.h +++ b/dom/webgpu/ipc/WebGPUParent.h @@ -31,24 +31,22 @@ class WebGPUParent final : public PWebGPUParent { ipc::IPCResult RecvAdapterDestroy(RawId aSelfId); ipc::IPCResult RecvDeviceDestroy(RawId aSelfId); ipc::IPCResult RecvDeviceCreateBuffer(RawId aSelfId, - const ffi::WGPUBufferDescriptor& aDesc, - const nsCString& aLabel, RawId aNewId); + const dom::GPUBufferDescriptor& aDesc, + RawId aNewId); ipc::IPCResult RecvDeviceUnmapBuffer(RawId aSelfId, RawId aBufferId, Shmem&& aShmem, bool aFlush); ipc::IPCResult RecvBufferMapRead(RawId aSelfId, Shmem&& aShmem, BufferMapReadResolver&& aResolver); ipc::IPCResult RecvBufferDestroy(RawId aSelfId); - ipc::IPCResult RecvDeviceCreateTexture( - RawId aSelfId, const ffi::WGPUTextureDescriptor& aDesc, - const nsCString& aLabel, RawId aNewId); + ipc::IPCResult RecvDeviceCreateTexture(RawId aSelfId, + const SerialTextureDescriptor& aDesc, + RawId aNewId); ipc::IPCResult RecvTextureCreateView( - RawId aSelfId, const ffi::WGPUTextureViewDescriptor& aDesc, - const nsCString& aLabel, RawId aNewId); + RawId aSelfId, const ffi::WGPUTextureViewDescriptor& aDesc, RawId aNewId); ipc::IPCResult RecvTextureDestroy(RawId aSelfId); ipc::IPCResult RecvTextureViewDestroy(RawId aSelfId); ipc::IPCResult RecvDeviceCreateSampler( - RawId aSelfId, const ffi::WGPUSamplerDescriptor& aDesc, - const nsCString& aLabel, RawId aNewId); + RawId aSelfId, const ffi::WGPUSamplerDescriptor& aDesc, RawId aNewId); ipc::IPCResult RecvSamplerDestroy(RawId aSelfId); ipc::IPCResult RecvDeviceCreateCommandEncoder( RawId aSelfId, const dom::GPUCommandEncoderDescriptor& aDesc, diff --git a/dom/webgpu/ipc/WebGPUSerialize.h b/dom/webgpu/ipc/WebGPUSerialize.h index 6d0cd864556e..6b0acd8b6870 100644 --- a/dom/webgpu/ipc/WebGPUSerialize.h +++ b/dom/webgpu/ipc/WebGPUSerialize.h @@ -13,27 +13,6 @@ namespace IPC { -// Special handling of the raw strings serialization. -// We are carrying the strings through IPC separately from the containing -// structs. So this implementation always reads nullptr for the char pointer. -template <> -struct ParamTraits { - typedef mozilla::webgpu::ffi::WGPURawString paramType; - - static void Write(Message* aMsg, const paramType& aParam) { - mozilla::Unused << aMsg; - mozilla::Unused << aParam; - } - - static bool Read(const Message* aMsg, PickleIterator* aIter, - paramType* aResult) { - mozilla::Unused << aMsg; - mozilla::Unused << aIter; - *aResult = nullptr; - return true; - } -}; - #define DEFINE_IPC_SERIALIZER_ENUM_GUARD(something, guard) \ template <> \ struct ParamTraits \ @@ -76,13 +55,11 @@ DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::dom::GPUExtensions, DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::dom::GPULimits, mMaxBindGroups); DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::dom::GPUDeviceDescriptor, mExtensions, mLimits); -DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::webgpu::ffi::WGPUBufferDescriptor, - label, size, usage); -DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::webgpu::ffi::WGPUTextureDescriptor, - label, size, mip_level_count, sample_count, - dimension, format, usage); +DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::dom::GPUBufferDescriptor, mSize, + mUsage); + DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::webgpu::ffi::WGPUSamplerDescriptor, - label, address_mode_u, address_mode_v, + address_mode_u, address_mode_v, address_mode_w, mag_filter, min_filter, mipmap_filter, lod_min_clamp, lod_max_clamp, compare); @@ -90,8 +67,8 @@ DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::webgpu::ffi::WGPUExtent3d, width, height, depth); DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::webgpu::ffi::WGPUOrigin3d, x, y, z); DEFINE_IPC_SERIALIZER_WITH_FIELDS( - mozilla::webgpu::ffi::WGPUTextureViewDescriptor, label, format, dimension, - aspect, base_mip_level, level_count, base_array_layer, array_layer_count); + mozilla::webgpu::ffi::WGPUTextureViewDescriptor, format, dimension, aspect, + base_mip_level, level_count, base_array_layer, array_layer_count); DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::webgpu::ffi::WGPUBlendDescriptor, src_factor, dst_factor, operation); DEFINE_IPC_SERIALIZER_WITH_FIELDS( @@ -122,14 +99,14 @@ DEFINE_IPC_SERIALIZER_WITH_FIELDS( multisampled, has_dynamic_offset, view_dimension, texture_component_type, storage_texture_format); DEFINE_IPC_SERIALIZER_WITH_FIELDS( - mozilla::webgpu::SerialBindGroupLayoutDescriptor, mLabel, mEntries); + mozilla::webgpu::SerialBindGroupLayoutDescriptor, mEntries); DEFINE_IPC_SERIALIZER_WITH_FIELDS( mozilla::webgpu::SerialPipelineLayoutDescriptor, mBindGroupLayouts); DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::webgpu::SerialBindGroupEntry, mBinding, mType, mValue, mBufferOffset, mBufferSize); DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::webgpu::SerialBindGroupDescriptor, - mLabel, mLayout, mEntries); + mLayout, mEntries); DEFINE_IPC_SERIALIZER_WITH_FIELDS( mozilla::webgpu::SerialProgrammableStageDescriptor, mModule, mEntryPoint); @@ -145,6 +122,10 @@ DEFINE_IPC_SERIALIZER_WITH_FIELDS( mFragmentStage, mPrimitiveTopology, mRasterizationState, mColorStates, mDepthStencilState, mVertexState, mSampleCount, mSampleMask, mAlphaToCoverageEnabled); +DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::webgpu::SerialTextureDescriptor, + mLabel, mSize, mArrayLayerCount, + mMipLevelCount, mSampleCount, mDimension, + mFormat, mUsage); #undef DEFINE_IPC_SERIALIZER_FFI_ENUM #undef DEFINE_IPC_SERIALIZER_DOM_ENUM diff --git a/dom/webgpu/ipc/WebGPUTypes.h b/dom/webgpu/ipc/WebGPUTypes.h index de00f5e91746..06118d8959be 100644 --- a/dom/webgpu/ipc/WebGPUTypes.h +++ b/dom/webgpu/ipc/WebGPUTypes.h @@ -18,7 +18,6 @@ typedef uint64_t RawId; typedef uint64_t BufferAddress; struct SerialBindGroupLayoutDescriptor { - nsCString mLabel; nsTArray mEntries; }; @@ -42,7 +41,6 @@ struct SerialBindGroupEntry { }; struct SerialBindGroupDescriptor { - nsCString mLabel; RawId mLayout; nsTArray mEntries; }; @@ -82,6 +80,17 @@ struct SerialRenderPipelineDescriptor { bool mAlphaToCoverageEnabled; }; +struct SerialTextureDescriptor { + nsString mLabel; + struct ffi::WGPUExtent3d mSize; + uint32_t mArrayLayerCount; + uint32_t mMipLevelCount; + uint32_t mSampleCount; + enum ffi::WGPUTextureDimension mDimension; + enum ffi::WGPUTextureFormat mFormat; + ffi::WGPUTextureUsage mUsage; +}; + } // namespace webgpu } // namespace mozilla diff --git a/gfx/wgpu/.github/workflows/ci.yml b/gfx/wgpu/.github/workflows/ci.yml index a4405eba3c20..41363271a99c 100644 --- a/gfx/wgpu/.github/workflows/ci.yml +++ b/gfx/wgpu/.github/workflows/ci.yml @@ -2,107 +2,64 @@ name: CI on: push: - branches-ignore: [staging.tmp] + branches-ignore: [ staging.tmp ] pull_request: - branches-ignore: [staging.tmp] + branches-ignore: [ staging.tmp ] jobs: - ios_build: - name: iOS Stable - runs-on: macos-10.15 - env: - TARGET: aarch64-apple-ios - steps: - - uses: actions/checkout@v2 - - run: rustup component add clippy - - run: rustup target add ${{ env.TARGET }} - - run: cargo clippy --target ${{ env.TARGET }} - - android_build: - name: Android Stable - runs-on: ubuntu-18.04 - env: - TARGET: aarch64-linux-android - steps: - - uses: actions/checkout@v2 - - name: Install NDK - run: | - curl -LO https://dl.google.com/android/repository/android-ndk-r21b-linux-x86_64.zip - unzip -qq android-ndk-r21b-linux-x86_64.zip -d $GITHUB_WORKSPACE - export NDK_HOME_BIN=$GITHUB_WORKSPACE/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin - ln -s $NDK_HOME_BIN/aarch64-linux-android21-clang $NDK_HOME_BIN/aarch64-linux-android-clang - echo "::add-path::$NDK_HOME_BIN" - - run: rustup component add clippy - - run: rustup target add ${{ env.TARGET }} - - run: cargo clippy --target ${{ env.TARGET }} - - name: Additional core features - run: cargo check --manifest-path wgpu-core/Cargo.toml --features trace --target ${{ env.TARGET }} - build: name: ${{ matrix.name }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - name: - [ - MacOS Stable, - MacOS Nightly, - Ubuntu Stable, - Ubuntu Nightly, - Windows Stable, - Windows Nightly, - ] + name: [ + iOS Stable, + MacOS Stable, + MacOS Nightly, + Ubuntu Stable, + Ubuntu Nightly, + Windows Stable, + Windows Nightly, + ] include: + - os: macos-10.15 + name: iOS Stable + channel: stable + build_command: rustup target add aarch64-apple-ios; cargo clippy --target aarch64-apple-ios - os: macos-10.15 name: MacOS Stable channel: stable build_command: cargo clippy - additional_core_features: trace - additional_player_features: winit - os: macos-10.15 name: MacOS Nightly channel: nightly build_command: cargo test - additional_core_features: - additional_player_features: - os: ubuntu-18.04 name: Ubuntu Stable channel: stable build_command: cargo clippy - additional_core_features: trace,replay - additional_player_features: - os: ubuntu-18.04 name: Ubuntu Nightly channel: nightly build_command: cargo test - additional_core_features: - additional_player_features: winit - os: windows-2019 name: Windows Stable channel: stable build_command: rustup default stable-msvc; cargo clippy - additional_core_features: trace - additional_player_features: renderdoc - os: windows-2019 name: Windows Nightly channel: nightly build_command: rustup default nightly-msvc; cargo test - additional_core_features: - additional_player_features: steps: - - uses: actions/checkout@v2 - - if: matrix.channel == 'nightly' - name: Install latest nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - - if: matrix.channel == 'stable' - run: rustup component add clippy - - name: cargo clippy/test - run: ${{ matrix.build_command }} - - if: matrix.additional_core_features != '' - run: cargo check --manifest-path wgpu-core/Cargo.toml --features ${{ matrix.additional_core_features }} - - if: matrix.additional_player_features != '' - run: cargo check --manifest-path player/Cargo.toml --features ${{ matrix.additional_player_features }} + - uses: actions/checkout@v2 + - if: matrix.channel == 'nightly' + name: Install latest nightly + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - if: contains(matrix.build_command, 'clippy') + run: rustup component add clippy + - name: cargo clippy/test + run: ${{ matrix.build_command }} diff --git a/gfx/wgpu/.gitignore b/gfx/wgpu/.gitignore index 0dd6fef44392..70f37a548cd2 100644 --- a/gfx/wgpu/.gitignore +++ b/gfx/wgpu/.gitignore @@ -1,3 +1,4 @@ +Cargo.lock /target **/*.rs.bk #Cargo.lock diff --git a/gfx/wgpu/Cargo.lock b/gfx/wgpu/Cargo.lock deleted file mode 100644 index d04cccf3677d..000000000000 --- a/gfx/wgpu/Cargo.lock +++ /dev/null @@ -1,1466 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "aho-corasick" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" -dependencies = [ - "memchr", -] - -[[package]] -name = "andrew" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" -dependencies = [ - "bitflags", - "line_drawing", - "rusttype 0.7.9", - "walkdir", - "xdg", - "xml-rs", -] - -[[package]] -name = "android_glue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" - -[[package]] -name = "approx" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -dependencies = [ - "num-traits", -] - -[[package]] -name = "arrayvec" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" - -[[package]] -name = "ash" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69daec0742947f33a85931fa3cb0ce5f07929159dcbd1f0cbb5b2912e2978509" -dependencies = [ - "libloading 0.5.2", -] - -[[package]] -name = "atom" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi 0.3.8", -] - -[[package]] -name = "autocfg" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" - -[[package]] -name = "base64" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -dependencies = [ - "byteorder", -] - -[[package]] -name = "battery" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36a698e449024a5d18994a815998bf5e2e4bc1883e35a7d7ba95b6b69ee45907" -dependencies = [ - "cfg-if", - "core-foundation 0.6.4", - "lazycell", - "libc", - "mach", - "nix 0.15.0", - "num-traits", - "uom", - "winapi 0.3.8", -] - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - -[[package]] -name = "bumpalo" -version = "3.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ae9db68ad7fac5fe51304d20f016c911539251075a214f8e663babefa35187" - -[[package]] -name = "byteorder" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" - -[[package]] -name = "calloop" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aa2097be53a00de9e8fc349fea6d76221f398f5c4fa550d420669906962d160" -dependencies = [ - "mio", - "mio-extras", - "nix 0.14.1", -] - -[[package]] -name = "cc" -version = "1.0.52" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - -[[package]] -name = "cocoa" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29f7768b2d1be17b96158e3285951d366b40211320fb30826a76cb7a0da6400" -dependencies = [ - "bitflags", - "block", - "core-foundation 0.6.4", - "core-graphics 0.17.3", - "foreign-types", - "libc", - "objc", -] - -[[package]] -name = "cocoa" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4736c86d51bd878b474400d9ec888156f4037015f5d09794fab9f26eab1ad4" -dependencies = [ - "bitflags", - "block", - "core-foundation 0.7.0", - "core-graphics 0.19.0", - "foreign-types", - "libc", - "objc", -] - -[[package]] -name = "copyless" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff9c56c9fb2a49c05ef0e431485a22400af20d33226dc0764d891d09e724127" - -[[package]] -name = "core-foundation" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" -dependencies = [ - "core-foundation-sys 0.6.2", - "libc", -] - -[[package]] -name = "core-foundation" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" -dependencies = [ - "core-foundation-sys 0.7.0", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" - -[[package]] -name = "core-foundation-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" - -[[package]] -name = "core-graphics" -version = "0.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" -dependencies = [ - "bitflags", - "core-foundation 0.6.4", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e78b2e0aaf43f08e7ae0d6bc96895ef72ff0921c7d4ff4762201b2dba376dd" -dependencies = [ - "bitflags", - "core-foundation 0.7.0", - "foreign-types", - "libc", -] - -[[package]] -name = "core-video-sys" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dc065219542086f72d1e9f7aadbbab0989e980263695d129d502082d063a9d0" -dependencies = [ - "cfg-if", - "core-foundation-sys 0.6.2", - "core-graphics 0.17.3", - "libc", - "objc", -] - -[[package]] -name = "d3d12" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7ed48e89905e5e146bcc1951cc3facb9e44aea9adf5dc01078cda1bd24b662" -dependencies = [ - "bitflags", - "libloading 0.5.2", - "winapi 0.3.8", -] - -[[package]] -name = "dispatch" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" - -[[package]] -name = "dlib" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" -dependencies = [ - "libloading 0.5.2", -] - -[[package]] -name = "downcast-rs" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" - -[[package]] -name = "env_logger" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "float-cmp" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "499a1bfa03d254b047e7e5c1fc8dd23a8cf6b344a8eb7e622ae4bc76bfac8e68" -dependencies = [ - "num-traits", -] - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "gfx-auxil" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b46e6f0031330a0be08d17820f2dcaaa91cb36710a97a9500cb4f1c36e785c8" -dependencies = [ - "fxhash", - "gfx-hal", - "spirv_cross", -] - -[[package]] -name = "gfx-backend-dx11" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b148219292624126f78245e50a9720d95ea149a415ce8ce73ab7014205301b88" -dependencies = [ - "bitflags", - "gfx-auxil", - "gfx-hal", - "libloading 0.5.2", - "log", - "parking_lot", - "range-alloc", - "raw-window-handle", - "smallvec", - "spirv_cross", - "winapi 0.3.8", - "wio", -] - -[[package]] -name = "gfx-backend-dx12" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e526746379e974501551b08958947e67a81b5ea8cdc717a000cdd72577da05" -dependencies = [ - "bitflags", - "d3d12", - "gfx-auxil", - "gfx-hal", - "log", - "range-alloc", - "raw-window-handle", - "smallvec", - "spirv_cross", - "winapi 0.3.8", -] - -[[package]] -name = "gfx-backend-empty" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67bd2d7bc022b257ddbdabc5fa3b10c29c292372c3409f2b6a6e3f4e11cdb85" -dependencies = [ - "gfx-hal", - "raw-window-handle", -] - -[[package]] -name = "gfx-backend-metal" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe128c29675b5afc8acdda1dfe096d6abd5e3528059ab0b98bda8215d8beed9" -dependencies = [ - "arrayvec", - "bitflags", - "block", - "cocoa 0.20.0", - "copyless", - "core-graphics 0.19.0", - "foreign-types", - "gfx-auxil", - "gfx-hal", - "lazy_static", - "log", - "metal", - "objc", - "parking_lot", - "range-alloc", - "raw-window-handle", - "smallvec", - "spirv_cross", - "storage-map", -] - -[[package]] -name = "gfx-backend-vulkan" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ff36feae801fa23d29acd74082603a0145a697a23595757dd4e78828ab33da" -dependencies = [ - "arrayvec", - "ash", - "byteorder", - "core-graphics 0.19.0", - "gfx-hal", - "lazy_static", - "log", - "objc", - "raw-window-handle", - "smallvec", - "winapi 0.3.8", - "x11", -] - -[[package]] -name = "gfx-descriptor" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf35f5d66d1bc56e63e68d7528441453f25992bd954b84309d23c659df2c5da" -dependencies = [ - "fxhash", - "gfx-hal", - "log", -] - -[[package]] -name = "gfx-hal" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc96180204064c9493e0fe4a9efeb721e0ac59fe8e1906d0c659142a93114fb1" -dependencies = [ - "bitflags", - "raw-window-handle", -] - -[[package]] -name = "gfx-memory" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2eed6cda674d9cd4d92229102dbd544292124533d236904f987e9afab456137" -dependencies = [ - "fxhash", - "gfx-hal", - "hibitset", - "log", - "slab", -] - -[[package]] -name = "hermit-abi" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61565ff7aaace3525556587bd2dc31d4a07071957be715e63ce7b1eccf51a8f4" -dependencies = [ - "libc", -] - -[[package]] -name = "hibitset" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a1bb8316a44459a7d14253c4d28dd7395cbd23cc04a68c46e851b8e46d64b1" -dependencies = [ - "atom", -] - -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] - -[[package]] -name = "instant" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7152d2aed88aa566e7a342250f21ba2222c1ae230ad577499dbfa3c18475b80" - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a27d435371a2fa5b6d2b028a74bbdb1234f308da363226a2854ca3ff8ba7055" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" - -[[package]] -name = "libc" -version = "0.2.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" - -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi 0.3.8", -] - -[[package]] -name = "libloading" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c4f51b790f5bdb65acb4cc94bb81d7b2ee60348a5431ac1467d390b017600b0" -dependencies = [ - "winapi 0.3.8", -] - -[[package]] -name = "line_drawing" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" -dependencies = [ - "num-traits", -] - -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "mach" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" -dependencies = [ - "libc", -] - -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - -[[package]] -name = "memchr" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" - -[[package]] -name = "memmap" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" -dependencies = [ - "libc", - "winapi 0.3.8", -] - -[[package]] -name = "metal" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e198a0ee42bdbe9ef2c09d0b9426f3b2b47d90d93a4a9b0395c4cea605e92dc0" -dependencies = [ - "bitflags", - "block", - "cocoa 0.20.0", - "core-graphics 0.19.0", - "foreign-types", - "log", - "objc", -] - -[[package]] -name = "mio" -version = "0.6.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" -dependencies = [ - "cfg-if", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "net2" -version = "0.2.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" -dependencies = [ - "cfg-if", - "libc", - "winapi 0.3.8", -] - -[[package]] -name = "nix" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" -dependencies = [ - "bitflags", - "cc", - "cfg-if", - "libc", - "void", -] - -[[package]] -name = "nix" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229" -dependencies = [ - "bitflags", - "cc", - "cfg-if", - "libc", - "void", -] - -[[package]] -name = "num-traits" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" -dependencies = [ - "autocfg", -] - -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", - "objc_exception", -] - -[[package]] -name = "objc_exception" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" -dependencies = [ - "cc", -] - -[[package]] -name = "once_cell" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b" - -[[package]] -name = "ordered-float" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" -dependencies = [ - "num-traits", -] - -[[package]] -name = "parking_lot" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" -dependencies = [ - "cfg-if", - "cloudabi", - "libc", - "redox_syscall", - "smallvec", - "winapi 0.3.8", -] - -[[package]] -name = "peek-poke" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93fd6a575ebf1ac2668d08443c97a22872cfb463fd8b7ddd141e9f6be59af2f" -dependencies = [ - "peek-poke-derive", -] - -[[package]] -name = "peek-poke-derive" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb44a25c5bba983be0fc8592dfaf3e6d0935ce8be0c6b15b2a39507af34a926" -dependencies = [ - "proc-macro2 1.0.10", - "quote 1.0.3", - "syn", - "synstructure", - "unicode-xid 0.2.0", -] - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "pkg-config" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" - -[[package]] -name = "player" -version = "0.1.0" -dependencies = [ - "env_logger", - "log", - "raw-window-handle", - "renderdoc", - "ron", - "wgpu-core", - "wgpu-types", - "winit", -] - -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - -[[package]] -name = "proc-macro2" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" -dependencies = [ - "unicode-xid 0.2.0", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - -[[package]] -name = "quote" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" -dependencies = [ - "proc-macro2 1.0.10", -] - -[[package]] -name = "range-alloc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5927936723a9e8b715d37d7e4b390455087c4bdf25b9f702309460577b14f9" - -[[package]] -name = "raw-window-handle" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" -dependencies = [ - "libc", -] - -[[package]] -name = "redox_syscall" -version = "0.1.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" - -[[package]] -name = "regex" -version = "1.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", - "thread_local", -] - -[[package]] -name = "regex-syntax" -version = "0.6.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" - -[[package]] -name = "renderdoc" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e8488c98756911664c8cc7b86284c320b6a6357d95908458136d7ebe9280c" -dependencies = [ - "bitflags", - "float-cmp", - "libloading 0.6.1", - "once_cell", - "renderdoc-sys", - "winapi 0.3.8", - "wio", -] - -[[package]] -name = "renderdoc-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60d4a9058849c3e765fe2fa68b72c1416b1766f27eac3c52d7bac8712ea0d390" - -[[package]] -name = "ron" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" -dependencies = [ - "base64", - "bitflags", - "serde", -] - -[[package]] -name = "rusttype" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" -dependencies = [ - "rusttype 0.8.3", -] - -[[package]] -name = "rusttype" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f61411055101f7b60ecf1041d87fb74205fb20b0c7a723f07ef39174cf6b4c0" -dependencies = [ - "approx", - "ordered-float", - "stb_truetype", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "serde" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" -dependencies = [ - "proc-macro2 1.0.10", - "quote 1.0.3", - "syn", -] - -[[package]] -name = "slab" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" - -[[package]] -name = "smallvec" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" - -[[package]] -name = "smithay-client-toolkit" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421c8dc7acf5cb205b88160f8b4cc2c5cfabe210e43b2f80f009f4c1ef910f1d" -dependencies = [ - "andrew", - "bitflags", - "dlib", - "lazy_static", - "memmap", - "nix 0.14.1", - "wayland-client", - "wayland-protocols", -] - -[[package]] -name = "spirv_cross" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "946216f8793f7199e3ea5b995ee8dc20a0ace1fcf46293a0ef4c17e1d046dbde" -dependencies = [ - "cc", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "stb_truetype" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" -dependencies = [ - "byteorder", -] - -[[package]] -name = "storage-map" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd0a4829a5c591dc24a944a736d6b1e4053e51339a79fd5d4702c4c999a9c45e" -dependencies = [ - "lock_api", -] - -[[package]] -name = "syn" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213" -dependencies = [ - "proc-macro2 1.0.10", - "quote 1.0.3", - "unicode-xid 0.2.0", -] - -[[package]] -name = "synstructure" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" -dependencies = [ - "proc-macro2 1.0.10", - "quote 1.0.3", - "syn", - "unicode-xid 0.2.0", -] - -[[package]] -name = "termcolor" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thread_local" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "typenum" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" - -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - -[[package]] -name = "unicode-xid" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" - -[[package]] -name = "uom" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cec796ec5f7ac557631709079168286056205c51c60aac33f51764bdc7b8dc4" -dependencies = [ - "num-traits", - "typenum", -] - -[[package]] -name = "vec_map" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "walkdir" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" -dependencies = [ - "same-file", - "winapi 0.3.8", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc57ce05287f8376e998cbddfb4c8cb43b84a7ec55cf4551d7c00eef317a47f" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967d37bf6c16cca2973ca3af071d0a2523392e4a594548155d89a678f4237cd" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2 1.0.10", - "quote 1.0.3", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bd151b63e1ea881bb742cd20e1d6127cef28399558f3b5d415289bc41eee3a4" -dependencies = [ - "quote 1.0.3", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d68a5b36eef1be7868f668632863292e37739656a80fc4b9acec7b0bd35a4931" -dependencies = [ - "proc-macro2 1.0.10", - "quote 1.0.3", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf76fe7d25ac79748a37538b7daeed1c7a6867c92d3245c12c6222e4a20d639" - -[[package]] -name = "wayland-client" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" -dependencies = [ - "bitflags", - "calloop", - "downcast-rs", - "libc", - "mio", - "nix 0.14.1", - "wayland-commons", - "wayland-scanner", - "wayland-sys", -] - -[[package]] -name = "wayland-commons" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" -dependencies = [ - "nix 0.14.1", - "wayland-sys", -] - -[[package]] -name = "wayland-protocols" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" -dependencies = [ - "bitflags", - "wayland-client", - "wayland-commons", - "wayland-scanner", -] - -[[package]] -name = "wayland-scanner" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "xml-rs", -] - -[[package]] -name = "wayland-sys" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" -dependencies = [ - "dlib", - "lazy_static", -] - -[[package]] -name = "wgpu-core" -version = "0.5.0" -dependencies = [ - "arrayvec", - "battery", - "bitflags", - "copyless", - "fxhash", - "gfx-backend-dx11", - "gfx-backend-dx12", - "gfx-backend-empty", - "gfx-backend-metal", - "gfx-backend-vulkan", - "gfx-descriptor", - "gfx-hal", - "gfx-memory", - "log", - "parking_lot", - "peek-poke", - "raw-window-handle", - "ron", - "serde", - "smallvec", - "vec_map", - "wgpu-types", -] - -[[package]] -name = "wgpu-types" -version = "0.5.0" -dependencies = [ - "bitflags", - "peek-poke", - "serde", -] - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - -[[package]] -name = "winapi" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi 0.3.8", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "winit" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc53342d3d1a3d57f3949e0692d93d5a8adb7814d8683cef4a09c2b550e94246" -dependencies = [ - "android_glue", - "bitflags", - "cocoa 0.19.1", - "core-foundation 0.6.4", - "core-graphics 0.17.3", - "core-video-sys", - "dispatch", - "instant", - "lazy_static", - "libc", - "log", - "mio", - "mio-extras", - "objc", - "parking_lot", - "percent-encoding", - "raw-window-handle", - "smithay-client-toolkit", - "wayland-client", - "winapi 0.3.8", - "x11-dl", -] - -[[package]] -name = "wio" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" -dependencies = [ - "winapi 0.3.8", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "x11" -version = "2.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ecd092546cb16f25783a5451538e73afc8d32e242648d54f4ae5459ba1e773" -dependencies = [ - "libc", - "pkg-config", -] - -[[package]] -name = "x11-dl" -version = "2.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" -dependencies = [ - "lazy_static", - "libc", - "maybe-uninit", - "pkg-config", -] - -[[package]] -name = "xdg" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" - -[[package]] -name = "xml-rs" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" diff --git a/gfx/wgpu/Cargo.toml b/gfx/wgpu/Cargo.toml index b9d820c1eada..7958bd98a1dd 100644 --- a/gfx/wgpu/Cargo.toml +++ b/gfx/wgpu/Cargo.toml @@ -1,6 +1,5 @@ [workspace] members = [ - "player", "wgpu-core", "wgpu-types", ] diff --git a/gfx/wgpu/README.md b/gfx/wgpu/README.md index 1cbbcd26c3c2..f7ddf829fb59 100644 --- a/gfx/wgpu/README.md +++ b/gfx/wgpu/README.md @@ -17,7 +17,6 @@ The implementation consists of the following parts: - `wgpu-core` - internal Rust API for WebGPU implementations to use - `wgpu-types` - Rust types shared between `wgpu-core`, `wgpu-native`, and `wgpu-rs` - - `player` - application for replaying the API traces, uses `winit` This repository is not meant for direct use by applications. If you are looking for the user-facing Rust API, you need [wgpu-rs](https://github.com/gfx-rs/wgpu-rs). @@ -25,7 +24,7 @@ If you are looking for the native implementation or bindings to the API in other ## Supported Platforms - API | Windows 7/10 | Linux & Android | macOS & iOS | + API | Windows | Linux | macOS & iOS | ----- | ------------------ | ------------------ | ------------------ | DX11 | :white_check_mark: | | | DX12 | :heavy_check_mark: | | | diff --git a/gfx/wgpu/bors.toml b/gfx/wgpu/bors.toml index f83b5282ad2d..a2311e04f335 100644 --- a/gfx/wgpu/bors.toml +++ b/gfx/wgpu/bors.toml @@ -2,7 +2,6 @@ status = [ "iOS Stable", "MacOS Stable", "MacOS Nightly", - "Android Stable", "Ubuntu Stable", "Ubuntu Nightly", "Windows Stable", diff --git a/gfx/wgpu/player/Cargo.toml b/gfx/wgpu/player/Cargo.toml deleted file mode 100644 index cb165438baa6..000000000000 --- a/gfx/wgpu/player/Cargo.toml +++ /dev/null @@ -1,35 +0,0 @@ -[package] -name = "player" -version = "0.1.0" -authors = [ - "Dzmitry Malyshau ", -] -edition = "2018" -description = "WebGPU trace player" -homepage = "https://github.com/gfx-rs/wgpu" -repository = "https://github.com/gfx-rs/wgpu" -keywords = ["graphics"] -license = "MPL-2.0" -publish = false - -[features] - -[dependencies] -env_logger = "0.7" -log = "0.4" -raw-window-handle = "0.3" -renderdoc = { version = "0.8", optional = true, default_features = false } -ron = "0.5" -winit = { version = "0.22", optional = true } - -[dependencies.wgt] -path = "../wgpu-types" -package = "wgpu-types" -version = "0.5" -features = ["replay"] - -[dependencies.wgc] -path = "../wgpu-core" -package = "wgpu-core" -version = "0.5" -features = ["replay", "raw-window-handle"] diff --git a/gfx/wgpu/player/README.md b/gfx/wgpu/player/README.md deleted file mode 100644 index 707c6df413fc..000000000000 --- a/gfx/wgpu/player/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# wgpu player - -This is application that allows replaying the `wgpu` workloads recorded elsewhere. - -Launch as: -```rust -player -``` - -When built with "winit" feature, it's able to replay the workloads that operate on a swapchain. It renders each frame sequentially, then waits for the user to close the window. When built without "winit", it launches in console mode and can replay any trace that doesn't use swapchains. - -Note: replaying is currently restricted to the same backend, as one used for recording a trace. It is straightforward, however, to just replace the backend in RON, since it's serialized as plain text. Valid values are: Vulkan, Metal, Dx12, and Dx11. diff --git a/gfx/wgpu/player/src/main.rs b/gfx/wgpu/player/src/main.rs deleted file mode 100644 index b864edb0ec22..000000000000 --- a/gfx/wgpu/player/src/main.rs +++ /dev/null @@ -1,573 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/*! This is a player for WebGPU traces. - * - * # Notes - * - we call device_maintain_ids() before creating any refcounted resource, - * which is basically everything except for BGL and shader modules, - * so that we don't accidentally try to use the same ID. -!*/ - -use wgc::device::trace; - -use std::{ - ffi::CString, - fmt::Debug, - fs::File, - marker::PhantomData, - path::{Path, PathBuf}, - ptr, -}; - -macro_rules! gfx_select { - ($id:expr => $global:ident.$method:ident( $($param:expr),+ )) => { - match $id.backend() { - #[cfg(not(any(target_os = "ios", target_os = "macos")))] - wgt::Backend::Vulkan => $global.$method::( $($param),+ ), - #[cfg(any(target_os = "ios", target_os = "macos"))] - wgt::Backend::Metal => $global.$method::( $($param),+ ), - #[cfg(windows)] - wgt::Backend::Dx12 => $global.$method::( $($param),+ ), - #[cfg(windows)] - wgt::Backend::Dx11 => $global.$method::( $($param),+ ), - _ => unreachable!() - } - }; -} - -struct Label(Option); -impl Label { - fn new(text: &str) -> Self { - Self(if text.is_empty() { - None - } else { - Some(CString::new(text).expect("invalid label")) - }) - } - - fn as_ptr(&self) -> *const std::os::raw::c_char { - match self.0 { - Some(ref c_string) => c_string.as_ptr(), - None => ptr::null(), - } - } -} - -struct OwnedProgrammableStage { - desc: wgc::pipeline::ProgrammableStageDescriptor, - #[allow(dead_code)] - entry_point: CString, -} - -impl From for OwnedProgrammableStage { - fn from(stage: trace::ProgrammableStageDescriptor) -> Self { - let entry_point = CString::new(stage.entry_point.as_str()).unwrap(); - OwnedProgrammableStage { - desc: wgc::pipeline::ProgrammableStageDescriptor { - module: stage.module, - entry_point: entry_point.as_ptr(), - }, - entry_point, - } - } -} - -#[derive(Debug)] -struct IdentityPassThrough(PhantomData); - -impl wgc::hub::IdentityHandler for IdentityPassThrough { - type Input = I; - fn process(&self, id: I, backend: wgt::Backend) -> I { - let (index, epoch, _backend) = id.unzip(); - I::zip(index, epoch, backend) - } - fn free(&self, _id: I) {} -} - -struct IdentityPassThroughFactory; - -impl wgc::hub::IdentityHandlerFactory - for IdentityPassThroughFactory -{ - type Filter = IdentityPassThrough; - fn spawn(&self, _min_index: u32) -> Self::Filter { - IdentityPassThrough(PhantomData) - } -} -impl wgc::hub::GlobalIdentityHandlerFactory for IdentityPassThroughFactory {} - -trait GlobalExt { - fn encode_commands( - &self, - encoder: wgc::id::CommandEncoderId, - commands: Vec, - ) -> wgc::id::CommandBufferId; - fn process( - &self, - device: wgc::id::DeviceId, - action: trace::Action, - dir: &PathBuf, - comb_manager: &mut wgc::hub::IdentityManager, - ); -} - -impl GlobalExt for wgc::hub::Global { - fn encode_commands( - &self, - encoder: wgc::id::CommandEncoderId, - commands: Vec, - ) -> wgc::id::CommandBufferId { - for command in commands { - match command { - trace::Command::CopyBufferToBuffer { - src, - src_offset, - dst, - dst_offset, - size, - } => self.command_encoder_copy_buffer_to_buffer::( - encoder, src, src_offset, dst, dst_offset, size, - ), - trace::Command::CopyBufferToTexture { src, dst, size } => { - self.command_encoder_copy_buffer_to_texture::(encoder, &src, &dst, size) - } - trace::Command::CopyTextureToBuffer { src, dst, size } => { - self.command_encoder_copy_texture_to_buffer::(encoder, &src, &dst, size) - } - trace::Command::CopyTextureToTexture { src, dst, size } => { - self.command_encoder_copy_texture_to_texture::(encoder, &src, &dst, size) - } - trace::Command::RunComputePass { - commands, - dynamic_offsets, - } => unsafe { - let mut offsets = &dynamic_offsets[..]; - let mut pass = wgc::command::RawPass::new_compute(encoder); - for com in commands { - pass.encode(&com); - if let wgc::command::ComputeCommand::SetBindGroup { - num_dynamic_offsets, - .. - } = com - { - pass.encode_slice(&offsets[..num_dynamic_offsets as usize]); - offsets = &offsets[num_dynamic_offsets as usize..]; - } - } - let (data, _) = pass.finish_compute(); - self.command_encoder_run_compute_pass::(encoder, &data); - }, - trace::Command::RunRenderPass { - target_colors, - target_depth_stencil, - commands, - dynamic_offsets, - } => unsafe { - let mut offsets = &dynamic_offsets[..]; - let mut pass = wgc::command::RawPass::new_render( - encoder, - &wgc::command::RenderPassDescriptor { - color_attachments: target_colors.as_ptr(), - color_attachments_length: target_colors.len(), - depth_stencil_attachment: target_depth_stencil.as_ref(), - }, - ); - for com in commands { - pass.encode(&com); - if let wgc::command::RenderCommand::SetBindGroup { - num_dynamic_offsets, - .. - } = com - { - pass.encode_slice(&offsets[..num_dynamic_offsets as usize]); - offsets = &offsets[num_dynamic_offsets as usize..]; - } - } - let (data, _) = pass.finish_render(); - self.command_encoder_run_render_pass::(encoder, &data); - }, - } - } - self.command_encoder_finish::(encoder, &wgt::CommandBufferDescriptor { todo: 0 }) - } - - fn process( - &self, - device: wgc::id::DeviceId, - action: trace::Action, - dir: &PathBuf, - comb_manager: &mut wgc::hub::IdentityManager, - ) { - use wgc::device::trace::Action as A; - match action { - A::Init { .. } => panic!("Unexpected Action::Init: has to be the first action only"), - A::CreateSwapChain { .. } | A::PresentSwapChain(_) => { - panic!("Unexpected SwapChain action: winit feature is not enabled") - } - A::CreateBuffer { id, desc } => { - let label = Label::new(&desc.label); - self.device_maintain_ids::(device); - self.device_create_buffer::(device, &desc.map_label(|_| label.as_ptr()), id); - } - A::DestroyBuffer(id) => { - self.buffer_destroy::(id); - } - A::CreateTexture { id, desc } => { - let label = Label::new(&desc.label); - self.device_maintain_ids::(device); - self.device_create_texture::(device, &desc.map_label(|_| label.as_ptr()), id); - } - A::DestroyTexture(id) => { - self.texture_destroy::(id); - } - A::CreateTextureView { - id, - parent_id, - desc, - } => { - let label = desc.as_ref().map_or(Label(None), |d| Label::new(&d.label)); - self.device_maintain_ids::(device); - self.texture_create_view::( - parent_id, - desc.map(|d| d.map_label(|_| label.as_ptr())).as_ref(), - id, - ); - } - A::DestroyTextureView(id) => { - self.texture_view_destroy::(id); - } - A::CreateSampler { id, desc } => { - let label = Label::new(&desc.label); - self.device_maintain_ids::(device); - self.device_create_sampler::(device, &desc.map_label(|_| label.as_ptr()), id); - } - A::DestroySampler(id) => { - self.sampler_destroy::(id); - } - A::GetSwapChainTexture { id, parent_id } => { - self.swap_chain_get_next_texture::(parent_id, id) - .unwrap(); - } - A::CreateBindGroupLayout { id, label, entries } => { - let label = Label::new(&label); - self.device_create_bind_group_layout::( - device, - &wgc::binding_model::BindGroupLayoutDescriptor { - label: label.as_ptr(), - entries: entries.as_ptr(), - entries_length: entries.len(), - }, - id, - ); - } - A::DestroyBindGroupLayout(id) => { - self.bind_group_layout_destroy::(id); - } - A::CreatePipelineLayout { - id, - bind_group_layouts, - } => { - self.device_maintain_ids::(device); - self.device_create_pipeline_layout::( - device, - &wgc::binding_model::PipelineLayoutDescriptor { - bind_group_layouts: bind_group_layouts.as_ptr(), - bind_group_layouts_length: bind_group_layouts.len(), - }, - id, - ); - } - A::DestroyPipelineLayout(id) => { - self.pipeline_layout_destroy::(id); - } - A::CreateBindGroup { - id, - label, - layout_id, - entries, - } => { - use wgc::binding_model as bm; - let label = Label::new(&label); - let entry_vec = entries - .into_iter() - .map(|(binding, res)| wgc::binding_model::BindGroupEntry { - binding, - resource: match res { - trace::BindingResource::Buffer { id, offset, size } => { - bm::BindingResource::Buffer(bm::BufferBinding { - buffer: id, - offset, - size, - }) - } - trace::BindingResource::Sampler(id) => bm::BindingResource::Sampler(id), - trace::BindingResource::TextureView(id) => { - bm::BindingResource::TextureView(id) - } - }, - }) - .collect::>(); - self.device_maintain_ids::(device); - self.device_create_bind_group::( - device, - &wgc::binding_model::BindGroupDescriptor { - label: label.as_ptr(), - layout: layout_id, - entries: entry_vec.as_ptr(), - entries_length: entry_vec.len(), - }, - id, - ); - } - A::DestroyBindGroup(id) => { - self.bind_group_destroy::(id); - } - A::CreateShaderModule { id, data } => { - let spv = wgt::read_spirv(File::open(dir.join(data)).unwrap()).unwrap(); - self.device_create_shader_module::( - device, - &wgc::pipeline::ShaderModuleDescriptor { - code: wgc::U32Array { - bytes: spv.as_ptr(), - length: spv.len(), - }, - }, - id, - ); - } - A::DestroyShaderModule(id) => { - self.shader_module_destroy::(id); - } - A::CreateComputePipeline { id, desc } => { - let cs_stage = OwnedProgrammableStage::from(desc.compute_stage); - self.device_maintain_ids::(device); - self.device_create_compute_pipeline::( - device, - &wgc::pipeline::ComputePipelineDescriptor { - layout: desc.layout, - compute_stage: cs_stage.desc, - }, - id, - ); - } - A::DestroyComputePipeline(id) => { - self.compute_pipeline_destroy::(id); - } - A::CreateRenderPipeline { id, desc } => { - let vs_stage = OwnedProgrammableStage::from(desc.vertex_stage); - let fs_stage = desc.fragment_stage.map(OwnedProgrammableStage::from); - let vertex_buffers = desc - .vertex_state - .vertex_buffers - .iter() - .map(|vb| wgc::pipeline::VertexBufferLayoutDescriptor { - array_stride: vb.array_stride, - step_mode: vb.step_mode, - attributes: vb.attributes.as_ptr(), - attributes_length: vb.attributes.len(), - }) - .collect::>(); - self.device_maintain_ids::(device); - self.device_create_render_pipeline::( - device, - &wgc::pipeline::RenderPipelineDescriptor { - layout: desc.layout, - vertex_stage: vs_stage.desc, - fragment_stage: fs_stage.as_ref().map_or(ptr::null(), |s| &s.desc), - primitive_topology: desc.primitive_topology, - rasterization_state: desc - .rasterization_state - .as_ref() - .map_or(ptr::null(), |rs| rs), - color_states: desc.color_states.as_ptr(), - color_states_length: desc.color_states.len(), - depth_stencil_state: desc - .depth_stencil_state - .as_ref() - .map_or(ptr::null(), |ds| ds), - vertex_state: wgc::pipeline::VertexStateDescriptor { - index_format: desc.vertex_state.index_format, - vertex_buffers: vertex_buffers.as_ptr(), - vertex_buffers_length: vertex_buffers.len(), - }, - sample_count: desc.sample_count, - sample_mask: desc.sample_mask, - alpha_to_coverage_enabled: desc.alpha_to_coverage_enabled, - }, - id, - ); - } - A::DestroyRenderPipeline(id) => { - self.render_pipeline_destroy::(id); - } - A::WriteBuffer { id, data, range } => { - let bin = std::fs::read(dir.join(data)).unwrap(); - let size = (range.end - range.start) as usize; - self.device_wait_for_buffer::(device, id); - self.device_set_buffer_sub_data::(device, id, range.start, &bin[..size]); - } - A::Submit(_index, commands) => { - let encoder = self.device_create_command_encoder::( - device, - &wgt::CommandEncoderDescriptor { label: ptr::null() }, - comb_manager.alloc(device.backend()), - ); - let comb = self.encode_commands::(encoder, commands); - self.queue_submit::(device, &[comb]); - } - } - } -} - -fn main() { - #[cfg(feature = "winit")] - use winit::{event_loop::EventLoop, window::WindowBuilder}; - - env_logger::init(); - - #[cfg(feature = "renderdoc")] - let mut rd = renderdoc::RenderDoc::::new() - .expect("Failed to connect to RenderDoc: are you running without it?"); - - //TODO: setting for the backend bits - //TODO: setting for the target frame, or controls - - let dir = match std::env::args().nth(1) { - Some(arg) if Path::new(&arg).is_dir() => PathBuf::from(arg), - _ => panic!("Provide the dir path as the parameter"), - }; - - log::info!("Loading trace '{:?}'", dir); - let file = File::open(dir.join(trace::FILE_NAME)).unwrap(); - let mut actions: Vec = ron::de::from_reader(file).unwrap(); - actions.reverse(); // allows us to pop from the top - log::info!("Found {} actions", actions.len()); - - #[cfg(feature = "winit")] - let mut event_loop = { - log::info!("Creating a window"); - EventLoop::new() - }; - #[cfg(feature = "winit")] - let window = WindowBuilder::new() - .with_title("wgpu player") - .with_resizable(false) - .build(&event_loop) - .unwrap(); - - let global = wgc::hub::Global::new("player", IdentityPassThroughFactory); - let mut command_buffer_id_manager = wgc::hub::IdentityManager::default(); - - #[cfg(feature = "winit")] - let surface = - global.instance_create_surface(&window, wgc::id::TypedId::zip(0, 1, wgt::Backend::Empty)); - - let device = match actions.pop() { - Some(trace::Action::Init { desc, backend }) => { - log::info!("Initializing the device for backend: {:?}", backend); - let adapter = global - .pick_adapter( - &wgc::instance::RequestAdapterOptions { - power_preference: wgt::PowerPreference::Default, - #[cfg(feature = "winit")] - compatible_surface: Some(surface), - #[cfg(not(feature = "winit"))] - compatible_surface: None, - }, - wgc::instance::AdapterInputs::IdSet( - &[wgc::id::TypedId::zip(0, 0, backend)], - |id| id.backend(), - ), - ) - .expect("Unable to find an adapter for selected backend"); - - let info = gfx_select!(adapter => global.adapter_get_info(adapter)); - log::info!("Picked '{}'", info.name); - gfx_select!(adapter => global.adapter_request_device( - adapter, - &desc, - None, - wgc::id::TypedId::zip(1, 0, wgt::Backend::Empty) - )) - } - _ => panic!("Expected Action::Init"), - }; - - log::info!("Executing actions"); - #[cfg(not(feature = "winit"))] - { - #[cfg(feature = "renderdoc")] - rd.start_frame_capture(ptr::null(), ptr::null()); - - while let Some(action) = actions.pop() { - gfx_select!(device => global.process(device, action, &dir, &mut command_buffer_id_manager)); - } - - #[cfg(feature = "renderdoc")] - rd.end_frame_capture(ptr::null(), ptr::null()); - gfx_select!(device => global.device_poll(device, true)); - } - #[cfg(feature = "winit")] - { - use winit::{ - event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent}, - event_loop::ControlFlow, - platform::desktop::EventLoopExtDesktop, - }; - - let mut frame_count = 0; - event_loop.run(move |event, _, control_flow| { - *control_flow = ControlFlow::Poll; - match event { - Event::MainEventsCleared => { - window.request_redraw(); - } - Event::RedrawRequested(_) => loop { - match actions.pop() { - Some(trace::Action::CreateSwapChain { id, desc }) => { - log::info!("Initializing the swapchain"); - assert_eq!(id.to_surface_id(), surface); - window.set_inner_size(winit::dpi::PhysicalSize::new( - desc.width, - desc.height, - )); - gfx_select!(device => global.device_create_swap_chain(device, surface, &desc)); - } - Some(trace::Action::PresentSwapChain(id)) => { - frame_count += 1; - log::debug!("Presenting frame {}", frame_count); - gfx_select!(device => global.swap_chain_present(id)); - break; - } - Some(action) => { - gfx_select!(device => global.process(device, action, &dir, &mut command_buffer_id_manager)); - } - None => break, - } - }, - Event::WindowEvent { event, .. } => match event { - WindowEvent::KeyboardInput { - input: - KeyboardInput { - virtual_keycode: Some(VirtualKeyCode::Escape), - state: ElementState::Pressed, - .. - }, - .. - } - | WindowEvent::CloseRequested => { - *control_flow = ControlFlow::Exit; - } - _ => {} - }, - Event::LoopDestroyed => { - log::info!("Closing"); - gfx_select!(device => global.device_poll(device, true)); - } - _ => {} - } - }); - } -} diff --git a/gfx/wgpu/wgpu-core/Cargo.toml b/gfx/wgpu/wgpu-core/Cargo.toml index e18f320cea6b..974f019873dc 100644 --- a/gfx/wgpu/wgpu-core/Cargo.toml +++ b/gfx/wgpu/wgpu-core/Cargo.toml @@ -16,9 +16,8 @@ license = "MPL-2.0" [features] default = [] -trace = ["ron", "serde", "wgt/trace"] -replay = ["serde", "wgt/replay"] metal-auto-capture = ["gfx-backend-metal/auto-capture"] +serde = ["wgt/serde", "serde_crate"] #NOTE: glutin feature is not stable, use at your own risk #glutin = ["gfx-backend-gl/glutin"] @@ -34,12 +33,15 @@ gfx-descriptor = "0.1" gfx-memory = "0.1" parking_lot = "0.10" peek-poke = "0.2" -raw-window-handle = { version = "0.3", optional = true } -ron = { version = "0.5", optional = true } -serde = { version = "1.0", features = ["serde_derive"], optional = true } smallvec = "1" vec_map = "0.8.1" +[dependencies.serde_crate] +package = "serde" +version = "1.0" +features = ["serde_derive"] +optional = true + [dependencies.wgt] path = "../wgpu-types" package = "wgpu-types" diff --git a/gfx/wgpu/wgpu-core/src/binding_model.rs b/gfx/wgpu/wgpu-core/src/binding_model.rs index 2da2428d86be..1633eba9aa75 100644 --- a/gfx/wgpu/wgpu-core/src/binding_model.rs +++ b/gfx/wgpu/wgpu-core/src/binding_model.rs @@ -12,16 +12,17 @@ use arrayvec::ArrayVec; use gfx_descriptor::{DescriptorCounts, DescriptorSet}; use wgt::{BufferAddress, TextureComponentType}; -#[cfg(feature = "replay")] -use serde::Deserialize; -#[cfg(feature = "trace")] -use serde::Serialize; +#[cfg(feature = "serde")] +use serde_crate::{Deserialize, Serialize}; use std::borrow::Borrow; #[repr(C)] #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] -#[cfg_attr(feature = "trace", derive(Serialize))] -#[cfg_attr(feature = "replay", derive(Deserialize))] +#[cfg_attr( + feature = "serde", + derive(Serialize, Deserialize), + serde(crate = "serde_crate") +)] pub enum BindingType { UniformBuffer = 0, StorageBuffer = 1, @@ -35,8 +36,11 @@ pub enum BindingType { #[repr(C)] #[derive(Clone, Debug, Hash, PartialEq)] -#[cfg_attr(feature = "trace", derive(Serialize))] -#[cfg_attr(feature = "replay", derive(Deserialize))] +#[cfg_attr( + feature = "serde", + derive(Serialize, Deserialize), + serde(crate = "serde_crate") +)] pub struct BindGroupLayoutEntry { pub binding: u32, pub visibility: wgt::ShaderStage, @@ -83,8 +87,11 @@ pub struct PipelineLayout { #[repr(C)] #[derive(Debug)] -#[cfg_attr(feature = "trace", derive(Serialize))] -#[cfg_attr(feature = "replay", derive(Deserialize))] +#[cfg_attr( + feature = "serde", + derive(Serialize, Deserialize), + serde(crate = "serde_crate") +)] pub struct BufferBinding { pub buffer: BufferId, pub offset: BufferAddress, @@ -93,8 +100,11 @@ pub struct BufferBinding { #[repr(C)] #[derive(Debug)] -#[cfg_attr(feature = "trace", derive(Serialize))] -#[cfg_attr(feature = "replay", derive(Deserialize))] +#[cfg_attr( + feature = "serde", + derive(Serialize, Deserialize), + serde(crate = "serde_crate") +)] pub enum BindingResource { Buffer(BufferBinding), Sampler(SamplerId), @@ -103,8 +113,11 @@ pub enum BindingResource { #[repr(C)] #[derive(Debug)] -#[cfg_attr(feature = "trace", derive(Serialize))] -#[cfg_attr(feature = "replay", derive(Deserialize))] +#[cfg_attr( + feature = "serde", + derive(Serialize, Deserialize), + serde(crate = "serde_crate") +)] pub struct BindGroupEntry { pub binding: u32, pub resource: BindingResource, diff --git a/gfx/wgpu/wgpu-core/src/command/allocator.rs b/gfx/wgpu/wgpu-core/src/command/allocator.rs index 1d89b3862334..436bb550ad10 100644 --- a/gfx/wgpu/wgpu-core/src/command/allocator.rs +++ b/gfx/wgpu/wgpu-core/src/command/allocator.rs @@ -4,8 +4,7 @@ use super::CommandBuffer; use crate::{ - hub::GfxBackend, id::DeviceId, track::TrackerSet, LifeGuard, PrivateFeatures, Stored, - SubmissionIndex, + hub::GfxBackend, id::DeviceId, track::TrackerSet, Features, LifeGuard, Stored, SubmissionIndex, }; use hal::{command::CommandBuffer as _, device::Device as _, pool::CommandPool as _}; @@ -77,10 +76,8 @@ impl CommandAllocator { &self, device_id: Stored, device: &B::Device, - limits: wgt::Limits, - private_features: PrivateFeatures, + features: Features, lowest_active_index: SubmissionIndex, - #[cfg(feature = "trace")] enable_tracing: bool, ) -> CommandBuffer { //debug_assert_eq!(device_id.backend(), B::VARIANT); let thread_id = thread::current().id(); @@ -111,14 +108,7 @@ impl CommandAllocator { life_guard: LifeGuard::new(), trackers: TrackerSet::new(B::VARIANT), used_swap_chain: None, - limits, - private_features, - #[cfg(feature = "trace")] - commands: if enable_tracing { - Some(Vec::new()) - } else { - None - }, + features, } } } diff --git a/gfx/wgpu/wgpu-core/src/command/compute.rs b/gfx/wgpu/wgpu-core/src/command/compute.rs index 57c385594211..180b18e8c3c4 100644 --- a/gfx/wgpu/wgpu-core/src/command/compute.rs +++ b/gfx/wgpu/wgpu-core/src/command/compute.rs @@ -26,14 +26,11 @@ enum PipelineState { } #[derive(Clone, Copy, Debug, PeekPoke)] -#[cfg_attr(feature = "trace", derive(serde::Serialize))] -#[cfg_attr(feature = "replay", derive(serde::Deserialize))] -pub enum ComputeCommand { +enum ComputeCommand { SetBindGroup { index: u8, num_dynamic_offsets: u8, bind_group_id: id::BindGroupId, - #[cfg_attr(any(feature = "trace", feature = "replay"), serde(skip))] phantom_offsets: PhantomSlice, }, SetPipeline(id::ComputePipelineId), @@ -82,7 +79,7 @@ impl Global { let (mut cmb_guard, mut token) = hub.command_buffers.write(&mut token); let cmb = &mut cmb_guard[encoder_id]; let raw = cmb.raw.last_mut().unwrap(); - let mut binder = Binder::new(cmb.limits.max_bind_groups); + let mut binder = Binder::new(cmb.features.max_bind_groups); let (pipeline_layout_guard, mut token) = hub.pipeline_layouts.read(&mut token); let (bind_group_guard, mut token) = hub.bind_groups.read(&mut token); @@ -250,43 +247,6 @@ impl Global { ComputeCommand::End => break, } } - - #[cfg(feature = "trace")] - match cmb.commands { - Some(ref mut list) => { - let mut pass_commands = Vec::new(); - let mut pass_dynamic_offsets = Vec::new(); - peeker = raw_data.as_ptr(); - loop { - peeker = unsafe { ComputeCommand::peek_from(peeker, &mut command) }; - match command { - ComputeCommand::SetBindGroup { - num_dynamic_offsets, - phantom_offsets, - .. - } => { - let (new_peeker, offsets) = unsafe { - phantom_offsets.decode_unaligned( - peeker, - num_dynamic_offsets as usize, - raw_data_end, - ) - }; - peeker = new_peeker; - pass_dynamic_offsets.extend_from_slice(offsets); - } - ComputeCommand::End => break, - _ => {} - } - pass_commands.push(command); - } - list.push(crate::device::trace::Command::RunComputePass { - commands: pass_commands, - dynamic_offsets: pass_dynamic_offsets, - }); - } - None => {} - } } } diff --git a/gfx/wgpu/wgpu-core/src/command/mod.rs b/gfx/wgpu/wgpu-core/src/command/mod.rs index d2c15ec73b9d..c8ef83767754 100644 --- a/gfx/wgpu/wgpu-core/src/command/mod.rs +++ b/gfx/wgpu/wgpu-core/src/command/mod.rs @@ -19,7 +19,7 @@ use crate::{ id, resource::{Buffer, Texture}, track::TrackerSet, - LifeGuard, PrivateFeatures, Stored, + Features, LifeGuard, Stored, }; use peek_poke::PeekPoke; @@ -27,7 +27,7 @@ use peek_poke::PeekPoke; use std::{marker::PhantomData, mem, ptr, slice, thread::ThreadId}; #[derive(Clone, Copy, Debug, PeekPoke)] -pub struct PhantomSlice(PhantomData); +struct PhantomSlice(PhantomData); impl Default for PhantomSlice { fn default() -> Self { @@ -119,13 +119,13 @@ impl RawPass { } #[inline] - pub unsafe fn encode(&mut self, command: &C) { + unsafe fn encode(&mut self, command: &C) { self.ensure_extra_size(C::max_size()); self.data = command.poke_into(self.data); } #[inline] - pub unsafe fn encode_slice(&mut self, data: &[T]) { + unsafe fn encode_slice(&mut self, data: &[T]) { let align_offset = self.data.align_offset(mem::align_of::()); let extra = align_offset + mem::size_of::() * data.len(); self.ensure_extra_size(extra); @@ -148,10 +148,7 @@ pub struct CommandBuffer { pub(crate) life_guard: LifeGuard, pub(crate) trackers: TrackerSet, pub(crate) used_swap_chain: Option<(Stored, B::Framebuffer)>, - limits: wgt::Limits, - private_features: PrivateFeatures, - #[cfg(feature = "trace")] - pub(crate) commands: Option>, + pub(crate) features: Features, } impl CommandBuffer { diff --git a/gfx/wgpu/wgpu-core/src/command/render.rs b/gfx/wgpu/wgpu-core/src/command/render.rs index 0cc592030154..a88bf35bcd2a 100644 --- a/gfx/wgpu/wgpu-core/src/command/render.rs +++ b/gfx/wgpu/wgpu-core/src/command/render.rs @@ -46,8 +46,6 @@ pub struct RenderPassDescriptor<'a> { } #[derive(Clone, Copy, Debug, Default, PeekPoke)] -#[cfg_attr(feature = "trace", derive(serde::Serialize))] -#[cfg_attr(feature = "replay", derive(serde::Deserialize))] pub struct Rect { pub x: T, pub y: T, @@ -56,14 +54,11 @@ pub struct Rect { } #[derive(Clone, Copy, Debug, PeekPoke)] -#[cfg_attr(feature = "trace", derive(serde::Serialize))] -#[cfg_attr(feature = "replay", derive(serde::Deserialize))] -pub enum RenderCommand { +enum RenderCommand { SetBindGroup { index: u8, num_dynamic_offsets: u8, bind_group_id: id::BindGroupId, - #[cfg_attr(any(feature = "trace", feature = "replay"), serde(skip))] phantom_offsets: PhantomSlice, }, SetPipeline(id::RenderPipelineId), @@ -339,8 +334,6 @@ impl Global { raw_data.len() ); peeker = unsafe { RawRenderTargets::peek_from(peeker, &mut targets) }; - #[cfg(feature = "trace")] - let command_peeker_base = peeker; let color_attachments = targets .colors @@ -443,10 +436,7 @@ impl Global { }; Some(hal::pass::Attachment { - format: Some(conv::map_texture_format( - view.format, - device.private_features, - )), + format: Some(conv::map_texture_format(view.format, device.features)), samples: view.samples, ops: conv::map_load_store_ops(at.depth_load_op, at.depth_store_op), stencil_ops: conv::map_load_store_ops( @@ -513,10 +503,7 @@ impl Global { }; colors.push(hal::pass::Attachment { - format: Some(conv::map_texture_format( - view.format, - device.private_features, - )), + format: Some(conv::map_texture_format(view.format, device.features)), samples: view.samples, ops: conv::map_load_store_ops(at.load_op, at.store_op), stencil_ops: hal::pass::AttachmentOps::DONT_CARE, @@ -569,10 +556,7 @@ impl Global { }; resolves.push(hal::pass::Attachment { - format: Some(conv::map_texture_format( - view.format, - device.private_features, - )), + format: Some(conv::map_texture_format(view.format, device.features)), samples: view.samples, ops: hal::pass::AttachmentOps::new( hal::pass::AttachmentLoadOp::DontCare, @@ -826,7 +810,7 @@ impl Global { }; let mut state = State { - binder: Binder::new(cmb.limits.max_bind_groups), + binder: Binder::new(cmb.features.max_bind_groups), blend_color: OptionalState::Unused, stencil_reference: OptionalState::Unused, pipeline: OptionalState::Required, @@ -1215,45 +1199,6 @@ impl Global { } } - #[cfg(feature = "trace")] - match cmb.commands { - Some(ref mut list) => { - let mut pass_commands = Vec::new(); - let mut pass_dynamic_offsets = Vec::new(); - peeker = command_peeker_base; - loop { - peeker = unsafe { RenderCommand::peek_from(peeker, &mut command) }; - match command { - RenderCommand::SetBindGroup { - num_dynamic_offsets, - phantom_offsets, - .. - } => { - let (new_peeker, offsets) = unsafe { - phantom_offsets.decode_unaligned( - peeker, - num_dynamic_offsets as usize, - raw_data_end, - ) - }; - peeker = new_peeker; - pass_dynamic_offsets.extend_from_slice(offsets); - } - RenderCommand::End => break, - _ => {} - } - pass_commands.push(command); - } - list.push(crate::device::trace::Command::RunRenderPass { - target_colors: color_attachments.into_iter().collect(), - target_depth_stencil: depth_stencil_attachment.cloned(), - commands: pass_commands, - dynamic_offsets: pass_dynamic_offsets, - }); - } - None => {} - } - log::trace!("Merging {:?} with the render pass", encoder_id); unsafe { raw.end_render_pass(); diff --git a/gfx/wgpu/wgpu-core/src/command/transfer.rs b/gfx/wgpu/wgpu-core/src/command/transfer.rs index 3d19246132bd..b5ba8957303f 100644 --- a/gfx/wgpu/wgpu-core/src/command/transfer.rs +++ b/gfx/wgpu/wgpu-core/src/command/transfer.rs @@ -2,8 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#[cfg(feature = "trace")] -use crate::device::trace::Command as TraceCommand; use crate::{ conv, device::{all_buffer_stages, all_image_stages}, @@ -20,9 +18,7 @@ use std::iter; const BITS_PER_BYTE: u32 = 8; #[repr(C)] -#[derive(Clone, Debug)] -#[cfg_attr(feature = "trace", derive(serde::Serialize))] -#[cfg_attr(feature = "replay", derive(serde::Deserialize))] +#[derive(Debug)] pub struct BufferCopyView { pub buffer: BufferId, pub offset: BufferAddress, @@ -31,9 +27,7 @@ pub struct BufferCopyView { } #[repr(C)] -#[derive(Clone, Debug)] -#[cfg_attr(feature = "trace", derive(serde::Serialize))] -#[cfg_attr(feature = "replay", derive(serde::Deserialize))] +#[derive(Debug)] pub struct TextureCopyView { pub texture: TextureId, pub mip_level: u32, @@ -96,18 +90,6 @@ impl Global { // borrow the buffer tracker mutably... let mut barriers = Vec::new(); - #[cfg(feature = "trace")] - match cmb.commands { - Some(ref mut list) => list.push(TraceCommand::CopyBufferToBuffer { - src: source, - src_offset: source_offset, - dst: destination, - dst_offset: destination_offset, - size, - }), - None => (), - } - let (src_buffer, src_pending) = cmb.trackers .buffers @@ -161,16 +143,6 @@ impl Global { let (texture_guard, _) = hub.textures.read(&mut token); let aspects = texture_guard[destination.texture].full_range.aspects; - #[cfg(feature = "trace")] - match cmb.commands { - Some(ref mut list) => list.push(TraceCommand::CopyBufferToTexture { - src: source.clone(), - dst: destination.clone(), - size: copy_size, - }), - None => (), - } - let (src_buffer, src_pending) = cmb.trackers.buffers.use_replace( &*buffer_guard, source.buffer, @@ -189,7 +161,7 @@ impl Global { assert!(dst_texture.usage.contains(TextureUsage::COPY_DST)); let dst_barriers = dst_pending.map(|pending| pending.into_hal(dst_texture)); - let bytes_per_texel = conv::map_texture_format(dst_texture.format, cmb.private_features) + let bytes_per_texel = conv::map_texture_format(dst_texture.format, cmb.features) .surface_desc() .bits as u32 / BITS_PER_BYTE; @@ -241,16 +213,6 @@ impl Global { let (texture_guard, _) = hub.textures.read(&mut token); let aspects = texture_guard[source.texture].full_range.aspects; - #[cfg(feature = "trace")] - match cmb.commands { - Some(ref mut list) => list.push(TraceCommand::CopyTextureToBuffer { - src: source.clone(), - dst: destination.clone(), - size: copy_size, - }), - None => (), - } - let (src_texture, src_pending) = cmb.trackers.textures.use_replace( &*texture_guard, source.texture, @@ -277,7 +239,7 @@ impl Global { ); let dst_barrier = dst_barriers.map(|pending| pending.into_hal(dst_buffer)); - let bytes_per_texel = conv::map_texture_format(src_texture.format, cmb.private_features) + let bytes_per_texel = conv::map_texture_format(src_texture.format, cmb.features) .surface_desc() .bits as u32 / BITS_PER_BYTE; @@ -334,16 +296,6 @@ impl Global { let aspects = texture_guard[source.texture].full_range.aspects & texture_guard[destination.texture].full_range.aspects; - #[cfg(feature = "trace")] - match cmb.commands { - Some(ref mut list) => list.push(TraceCommand::CopyTextureToTexture { - src: source.clone(), - dst: destination.clone(), - size: copy_size, - }), - None => (), - } - let (src_texture, src_pending) = cmb.trackers.textures.use_replace( &*texture_guard, source.texture, diff --git a/gfx/wgpu/wgpu-core/src/conv.rs b/gfx/wgpu/wgpu-core/src/conv.rs index 5f239c933ba7..510ec6c56802 100644 --- a/gfx/wgpu/wgpu-core/src/conv.rs +++ b/gfx/wgpu/wgpu-core/src/conv.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use crate::{binding_model, resource, PrivateFeatures}; +use crate::{binding_model, resource, Features}; pub fn map_buffer_usage(usage: wgt::BufferUsage) -> (hal::buffer::Usage, hal::memory::Properties) { use hal::buffer::Usage as U; @@ -321,7 +321,7 @@ fn map_stencil_operation(stencil_operation: wgt::StencilOperation) -> hal::pso:: pub(crate) fn map_texture_format( texture_format: wgt::TextureFormat, - private_features: PrivateFeatures, + features: Features, ) -> hal::format::Format { use hal::format::Format as H; use wgt::TextureFormat as Tf; @@ -376,14 +376,14 @@ pub(crate) fn map_texture_format( // Depth and stencil formats Tf::Depth32Float => H::D32Sfloat, Tf::Depth24Plus => { - if private_features.supports_texture_d24_s8 { + if features.supports_texture_d24_s8 { H::D24UnormS8Uint } else { H::D32Sfloat } } Tf::Depth24PlusStencil8 => { - if private_features.supports_texture_d24_s8 { + if features.supports_texture_d24_s8 { H::D24UnormS8Uint } else { H::D32SfloatS8Uint diff --git a/gfx/wgpu/wgpu-core/src/device/life.rs b/gfx/wgpu/wgpu-core/src/device/life.rs index 10b2f4959db7..856e9db5e376 100644 --- a/gfx/wgpu/wgpu-core/src/device/life.rs +++ b/gfx/wgpu/wgpu-core/src/device/life.rs @@ -2,8 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#[cfg(feature = "trace")] -use crate::device::trace; use crate::{ hub::{GfxBackend, Global, GlobalIdentityHandlerFactory, Token}, id, resource, @@ -301,7 +299,6 @@ impl LifetimeTracker { &mut self, global: &Global, trackers: &Mutex, - #[cfg(feature = "trace")] trace: Option<&Mutex>, token: &mut Token>, ) { let hub = B::hub(global); @@ -312,8 +309,6 @@ impl LifetimeTracker { for id in self.suspected_resources.bind_groups.drain(..) { if trackers.bind_groups.remove_abandoned(id) { - #[cfg(feature = "trace")] - trace.map(|t| t.lock().add(trace::Action::DestroyBindGroup(id))); hub.bind_groups.free_id(id); let res = guard.remove(id).unwrap(); @@ -348,8 +343,6 @@ impl LifetimeTracker { for id in self.suspected_resources.texture_views.drain(..) { if trackers.views.remove_abandoned(id) { - #[cfg(feature = "trace")] - trace.map(|t| t.lock().add(trace::Action::DestroyTextureView(id))); hub.texture_views.free_id(id); let res = guard.remove(id).unwrap(); @@ -378,8 +371,6 @@ impl LifetimeTracker { for id in self.suspected_resources.textures.drain(..) { if trackers.textures.remove_abandoned(id) { - #[cfg(feature = "trace")] - trace.map(|t| t.lock().add(trace::Action::DestroyTexture(id))); hub.textures.free_id(id); let res = guard.remove(id).unwrap(); @@ -400,8 +391,6 @@ impl LifetimeTracker { for id in self.suspected_resources.samplers.drain(..) { if trackers.samplers.remove_abandoned(id) { - #[cfg(feature = "trace")] - trace.map(|t| t.lock().add(trace::Action::DestroySampler(id))); hub.samplers.free_id(id); let res = guard.remove(id).unwrap(); @@ -422,8 +411,6 @@ impl LifetimeTracker { for id in self.suspected_resources.buffers.drain(..) { if trackers.buffers.remove_abandoned(id) { - #[cfg(feature = "trace")] - trace.map(|t| t.lock().add(trace::Action::DestroyBuffer(id))); hub.buffers.free_id(id); let res = guard.remove(id).unwrap(); log::debug!("Buffer {:?} is detached", id); @@ -445,8 +432,6 @@ impl LifetimeTracker { for id in self.suspected_resources.compute_pipelines.drain(..) { if trackers.compute_pipes.remove_abandoned(id) { - #[cfg(feature = "trace")] - trace.map(|t| t.lock().add(trace::Action::DestroyComputePipeline(id))); hub.compute_pipelines.free_id(id); let res = guard.remove(id).unwrap(); @@ -467,8 +452,6 @@ impl LifetimeTracker { for id in self.suspected_resources.render_pipelines.drain(..) { if trackers.render_pipes.remove_abandoned(id) { - #[cfg(feature = "trace")] - trace.map(|t| t.lock().add(trace::Action::DestroyRenderPipeline(id))); hub.render_pipelines.free_id(id); let res = guard.remove(id).unwrap(); @@ -512,8 +495,6 @@ impl LifetimeTracker { { //Note: this has to happen after all the suspected pipelines are destroyed if ref_count.load() == 1 { - #[cfg(feature = "trace")] - trace.map(|t| t.lock().add(trace::Action::DestroyPipelineLayout(id))); hub.pipeline_layouts.free_id(id); let layout = guard.remove(id).unwrap(); self.free_resources.pipeline_layouts.push(layout.raw); @@ -647,24 +628,20 @@ impl LifetimeTracker { } else { let mapping = match std::mem::replace( &mut buffer.map_state, - resource::BufferMapState::Idle, + resource::BufferMapState::Active, ) { resource::BufferMapState::Waiting(pending_mapping) => pending_mapping, _ => panic!("No pending mapping."), }; log::debug!("Buffer {:?} map state -> Active", buffer_id); - let host = match mapping.op { - resource::BufferMapOperation::Read { .. } => super::HostMap::Read, - resource::BufferMapOperation::Write { .. } => super::HostMap::Write, + let result = match mapping.op { + resource::BufferMapOperation::Read { .. } => { + super::map_buffer(raw, buffer, mapping.sub_range, super::HostMap::Read) + } + resource::BufferMapOperation::Write { .. } => { + super::map_buffer(raw, buffer, mapping.sub_range, super::HostMap::Write) + } }; - let result = super::map_buffer(raw, buffer, mapping.sub_range.clone(), host); - if let Ok(ptr) = result { - buffer.map_state = resource::BufferMapState::Active { - ptr, - sub_range: mapping.sub_range, - host, - }; - } pending_callbacks.push((mapping.op, result)); } } diff --git a/gfx/wgpu/wgpu-core/src/device/mod.rs b/gfx/wgpu/wgpu-core/src/device/mod.rs index 8f48dff6b258..1656d34eae50 100644 --- a/gfx/wgpu/wgpu-core/src/device/mod.rs +++ b/gfx/wgpu/wgpu-core/src/device/mod.rs @@ -7,7 +7,7 @@ use crate::{ hub::{GfxBackend, Global, GlobalIdentityHandlerFactory, Input, Token}, id, pipeline, resource, swap_chain, track::{BufferState, TextureState, TrackerSet}, - FastHashMap, LifeGuard, PrivateFeatures, Stored, + FastHashMap, Features, LifeGuard, Stored, }; use arrayvec::ArrayVec; @@ -31,22 +31,6 @@ use std::{ }; mod life; -#[cfg(any(feature = "trace", feature = "replay"))] -pub mod trace; -#[cfg(feature = "trace")] -use trace::{Action, Trace}; - -pub type Label = *const std::os::raw::c_char; -#[cfg(feature = "trace")] -fn own_label(label: &Label) -> String { - if label.is_null() { - String::new() - } else { - unsafe { ffi::CStr::from_ptr(*label) } - .to_string_lossy() - .to_string() - } -} pub const MAX_COLOR_TARGETS: usize = 4; pub const MAX_MIP_LEVELS: usize = 16; @@ -125,38 +109,50 @@ fn map_buffer( sub_range: hal::buffer::SubRange, kind: HostMap, ) -> BufferMapResult { - let (ptr, segment, needs_sync) = { + let (ptr, sync_range) = { let segment = hal::memory::Segment { offset: sub_range.offset, size: sub_range.size, }; let mapped = buffer.memory.map(raw, segment)?; - let mr = mapped.range(); - let segment = hal::memory::Segment { - offset: mr.start, - size: Some(mr.end - mr.start), + let sync_range = if mapped.is_coherent() { + None + } else { + Some(mapped.range()) }; - (mapped.ptr(), segment, !mapped.is_coherent()) + (mapped.ptr(), sync_range) }; - buffer.sync_mapped_writes = match kind { - HostMap::Read if needs_sync => unsafe { - raw.invalidate_mapped_memory_ranges(iter::once((buffer.memory.memory(), segment))) - .unwrap(); - None - }, - HostMap::Write if needs_sync => Some(segment), - _ => None, - }; + if let Some(range) = sync_range { + let segment = hal::memory::Segment { + offset: range.start, + size: Some(range.end - range.start), + }; + match kind { + HostMap::Read => unsafe { + raw.invalidate_mapped_memory_ranges(iter::once((buffer.memory.memory(), segment))) + .unwrap(); + }, + HostMap::Write => { + buffer.mapped_write_segments.push(segment); + } + } + } Ok(ptr.as_ptr()) } fn unmap_buffer(raw: &B::Device, buffer: &mut resource::Buffer) { - if let Some(segment) = buffer.sync_mapped_writes.take() { + if !buffer.mapped_write_segments.is_empty() { unsafe { - raw.flush_mapped_memory_ranges(iter::once((buffer.memory.memory(), segment))) - .unwrap() + raw.flush_mapped_memory_ranges( + buffer + .mapped_write_segments + .iter() + .map(|r| (buffer.memory.memory(), r.clone())), + ) + .unwrap() }; + buffer.mapped_write_segments.clear(); } } @@ -197,11 +193,7 @@ pub struct Device { // Life tracker should be locked right after the device and before anything else. life_tracker: Mutex>, temp_suspected: life::SuspectedResources, - pub(crate) private_features: PrivateFeatures, - limits: wgt::Limits, - extensions: wgt::Extensions, - #[cfg(feature = "trace")] - pub(crate) trace: Option>, + pub(crate) features: Features, } impl Device { @@ -212,8 +204,7 @@ impl Device { mem_props: hal::adapter::MemoryProperties, non_coherent_atom_size: u64, supports_texture_d24_s8: bool, - desc: &wgt::DeviceDescriptor, - trace_path: Option<&std::path::Path>, + max_bind_groups: u32, ) -> Self { // don't start submission index at zero let life_guard = LifeGuard::new(); @@ -233,11 +224,6 @@ impl Device { non_coherent_atom_size, ) }; - #[cfg(not(feature = "trace"))] - match trace_path { - Some(_) => log::warn!("Tracing feature is not enabled"), - None => (), - } Device { raw, @@ -252,25 +238,10 @@ impl Device { framebuffers: Mutex::new(FastHashMap::default()), life_tracker: Mutex::new(life::LifetimeTracker::new()), temp_suspected: life::SuspectedResources::default(), - #[cfg(feature = "trace")] - trace: trace_path.and_then(|path| match Trace::new(path) { - Ok(mut trace) => { - trace.add(Action::Init { - desc: desc.clone(), - backend: B::VARIANT, - }); - Some(Mutex::new(trace)) - } - Err(e) => { - log::warn!("Unable to start a trace in '{:?}': {:?}", path, e); - None - } - }), - private_features: PrivateFeatures { + features: Features { + max_bind_groups, supports_texture_d24_s8, }, - limits: desc.limits.clone(), - extensions: desc.extensions.clone(), } } @@ -289,13 +260,7 @@ impl Device { ) -> Vec { let mut life_tracker = self.lock_life(token); - life_tracker.triage_suspected( - global, - &self.trackers, - #[cfg(feature = "trace")] - self.trace.as_ref(), - token, - ); + life_tracker.triage_suspected(global, &self.trackers, token); life_tracker.triage_mapped(global, token); life_tracker.triage_framebuffers(global, &mut *self.framebuffers.lock(), token); let _last_done = life_tracker.triage_submissions(&self.raw, force_wait); @@ -307,7 +272,7 @@ impl Device { fn create_buffer( &self, self_id: id::DeviceId, - desc: &wgt::BufferDescriptor