Commit 2ac35352 authored by Kai Ninomiya's avatar Kai Ninomiya Committed by Commit Bot

Remove GPUTexture.createDefaultView

https://github.com/gpuweb/gpuweb/pull/389

Bug: dawn:214
Change-Id: I4450e9abcc1f202b3107b2ed42f54626f896f874
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1766765Reviewed-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@{#690746}
parent 6ff562d1
......@@ -86,6 +86,10 @@ DawnCompareFunction AsDawnEnum<DawnCompareFunction>(
template <>
DawnTextureFormat AsDawnEnum<DawnTextureFormat>(
const WTF::String& webgpu_enum) {
if (webgpu_enum.IsNull()) {
return DAWN_TEXTURE_FORMAT_NONE;
}
// Normal 8 bit formats
if (webgpu_enum == "r8unorm") {
return DAWN_TEXTURE_FORMAT_R8_UNORM;
......@@ -231,6 +235,9 @@ DawnTextureDimension AsDawnEnum<DawnTextureDimension>(
template <>
DawnTextureViewDimension AsDawnEnum<DawnTextureViewDimension>(
const WTF::String& webgpu_enum) {
if (webgpu_enum.IsNull()) {
return DAWN_TEXTURE_VIEW_DIMENSION_NONE;
}
if (webgpu_enum == "2d") {
return DAWN_TEXTURE_VIEW_DIMENSION_2D;
}
......
......@@ -81,11 +81,6 @@ GPUTextureView* GPUTexture::createView(
device_, GetProcs().textureCreateView(GetHandle(), &dawn_desc));
}
GPUTextureView* GPUTexture::createDefaultView() {
return GPUTextureView::Create(
device_, GetProcs().textureCreateDefaultView(GetHandle()));
}
void GPUTexture::destroy() {
GetProcs().textureDestroy(GetHandle());
}
......
......@@ -24,7 +24,6 @@ class GPUTexture : public DawnObject<DawnTexture> {
// gpu_texture.idl
GPUTextureView* createView(const GPUTextureViewDescriptor* webgpu_desc);
GPUTextureView* createDefaultView();
void destroy();
private:
......
......@@ -7,7 +7,6 @@
[
RuntimeEnabled=WebGPU
] interface GPUTexture {
GPUTextureView createView(GPUTextureViewDescriptor desc);
GPUTextureView createDefaultView();
GPUTextureView createView(optional GPUTextureViewDescriptor desc);
void destroy();
};
......@@ -5,13 +5,13 @@
// https://gpuweb.github.io/gpuweb/
dictionary GPUTextureViewDescriptor {
required GPUTextureFormat format;
required GPUTextureViewDimension dimension;
required GPUTextureAspect aspect;
GPUTextureFormat format;
GPUTextureViewDimension dimension;
GPUTextureAspect aspect = "all";
unsigned long baseMipLevel = 0;
unsigned long mipLevelCount = 1;
unsigned long mipLevelCount = 0;
unsigned long baseArrayLayer = 0;
unsigned long arrayLayerCount = 1;
unsigned long arrayLayerCount = 0;
};
enum GPUTextureViewDimension {
......
// AUTO-GENERATED - DO NOT EDIT. See tools/gen_version.
export const version = '84ef21bec576c9272e64e08727dbdf75a2b0e9d8';
export const version = 'f690ac56a3291801e817433f43877132bb531d5f';
......@@ -22,7 +22,7 @@ g.test('clear', async t => {
},
usage: GPUTextureUsage.COPY_SRC | GPUTextureUsage.OUTPUT_ATTACHMENT
});
const colorAttachmentView = colorAttachment.createDefaultView();
const colorAttachmentView = colorAttachment.createView();
const encoder = t.device.createCommandEncoder({});
const pass = encoder.beginRenderPass({
colorAttachments: [{
......
......@@ -20,7 +20,7 @@ g.test('fullscreen quad', async t => {
},
usage: GPUTextureUsage.COPY_SRC | GPUTextureUsage.OUTPUT_ATTACHMENT
});
const colorAttachmentView = colorAttachment.createDefaultView();
const colorAttachmentView = colorAttachment.createView();
const vertexModule = t.device.createShaderModule({
code:
/* GLSL(
......
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