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