From 3fa3e5667b1ca22875a9e17a0aaabab1a22d243e Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 28 Jun 2022 15:55:16 +0000 Subject: [PATCH] dawn::wire::client: ReserveTexture: remove defaulting of descriptor The usages in Chromium have been updated to pass a descriptor. Bug: dawn:1451 Change-Id: I1f08141759dc7b8e0e805aa8efc9a8db51162876 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94941 Reviewed-by: Austin Eng Commit-Queue: Corentin Wallez --- include/dawn/wire/WireClient.h | 4 +--- src/dawn/wire/client/Client.cpp | 14 -------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/include/dawn/wire/WireClient.h b/include/dawn/wire/WireClient.h index 9b425b61d7..93cc199990 100644 --- a/include/dawn/wire/WireClient.h +++ b/include/dawn/wire/WireClient.h @@ -70,10 +70,8 @@ class DAWN_WIRE_EXPORT WireClient : public CommandHandler { const volatile char* HandleCommands(const volatile char* commands, size_t size) override; - // TODO(dawn:1451): Remove the defaulting of descriptor once the callers are updated to provide - // one. ReservedTexture ReserveTexture(WGPUDevice device, - const WGPUTextureDescriptor* descriptor = nullptr); + const WGPUTextureDescriptor* descriptor); ReservedSwapChain ReserveSwapChain(WGPUDevice device); ReservedDevice ReserveDevice(); ReservedInstance ReserveInstance(); diff --git a/src/dawn/wire/client/Client.cpp b/src/dawn/wire/client/Client.cpp index 9b9fc1ab5c..57f3c57a8a 100644 --- a/src/dawn/wire/client/Client.cpp +++ b/src/dawn/wire/client/Client.cpp @@ -82,20 +82,6 @@ void Client::DestroyAllObjects() { } ReservedTexture Client::ReserveTexture(WGPUDevice device, const WGPUTextureDescriptor* descriptor) { - // Make a fake descriptor so that data returned by wgpu::Texture getters isn't garbage. - // TODO(dawn:1451): Remove this defaulting once the descriptor is required for ReserveTexture. - WGPUTextureDescriptor defaultDescriptor = {}; - if (descriptor == nullptr) { - defaultDescriptor.size = {1, 1, 1}; - defaultDescriptor.mipLevelCount = 1; - defaultDescriptor.sampleCount = 1; - defaultDescriptor.dimension = WGPUTextureDimension_1D; - defaultDescriptor.format = WGPUTextureFormat_RGBA8Unorm; - defaultDescriptor.usage = 0; - - descriptor = &defaultDescriptor; - } - Texture* texture = Make(descriptor); ReservedTexture result;