Commit fda93fab authored by Kai Ninomiya's avatar Kai Ninomiya Committed by Commit Bot

Implement minBufferBindingSize

Note this doesn't implement the validation that minBufferBindingSize
must be undefined for incompatible binding types (since that hasn't been
done for any of the other fields yet either).

Also slightly reorder things to match the upstream spec (which groups
optional fields by what binding type they're used for).

Minimally tested locally against upstream
webgpu:api,validation,createBindGroupLayout:bindingTypeSpecific_optional_members:*
but we need to fix a lot more things in those tests including a crash
and the binding type rules mentioned above.

Bug: 1069302
Change-Id: I64b4ac41297539c066b7f22ff9b6766462138c07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2324723Reviewed-by: default avatarCorentin Wallez <cwallez@chromium.org>
Reviewed-by: default avatarAustin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792475}
parent ecb5c38e
......@@ -18,15 +18,24 @@ WGPUBindGroupLayoutEntry AsDawnType(
WGPUBindGroupLayoutEntry dawn_binding = {};
dawn_binding.binding = webgpu_binding->binding();
dawn_binding.type = AsDawnEnum<WGPUBindingType>(webgpu_binding->type());
dawn_binding.visibility =
AsDawnEnum<WGPUShaderStage>(webgpu_binding->visibility());
dawn_binding.type = AsDawnEnum<WGPUBindingType>(webgpu_binding->type());
dawn_binding.hasDynamicOffset = webgpu_binding->hasDynamicOffset();
dawn_binding.minBufferBindingSize =
webgpu_binding->hasMinBufferBindingSize()
? webgpu_binding->minBufferBindingSize()
: 0;
dawn_binding.viewDimension =
AsDawnEnum<WGPUTextureViewDimension>(webgpu_binding->viewDimension());
dawn_binding.textureComponentType = AsDawnEnum<WGPUTextureComponentType>(
webgpu_binding->textureComponentType());
dawn_binding.multisampled = webgpu_binding->multisampled();
dawn_binding.hasDynamicOffset = webgpu_binding->hasDynamicOffset();
dawn_binding.storageTextureFormat =
AsDawnEnum<WGPUTextureFormat>(webgpu_binding->storageTextureFormat());
......
......@@ -8,10 +8,16 @@ dictionary GPUBindGroupLayoutEntry {
required GPUIndex32 binding;
required GPUShaderStageFlags visibility;
required GPUBindingType type;
boolean hasDynamicOffset = false;
GPUSize64 minBufferBindingSize;
GPUTextureViewDimension viewDimension = "2d";
GPUTextureComponentType textureComponentType = "float";
boolean multisampled = false;
boolean hasDynamicOffset = false;
GPUTextureFormat storageTextureFormat;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment