diff --git a/dawn.json b/dawn.json index ac048fbe6c..a2516ba1a3 100644 --- a/dawn.json +++ b/dawn.json @@ -935,11 +935,11 @@ "category": "object", "methods": [ { - "name": "create default texture view", + "name": "create default view", "returns": "texture view" }, { - "name": "create texture view", + "name": "create view", "returns": "texture view", "args": [ {"name": "descriptor", "type": "texture view descriptor", "annotation": "const*"} diff --git a/examples/Animometer.cpp b/examples/Animometer.cpp index 020a512c13..263f35cb11 100644 --- a/examples/Animometer.cpp +++ b/examples/Animometer.cpp @@ -138,7 +138,7 @@ void frame() { size_t i = 0; - utils::ComboRenderPassDescriptor renderPass({backbuffer.CreateDefaultTextureView()}, + utils::ComboRenderPassDescriptor renderPass({backbuffer.CreateDefaultView()}, depthStencilView); dawn::CommandEncoder encoder = device.CreateCommandEncoder(); { diff --git a/examples/CHelloTriangle.cpp b/examples/CHelloTriangle.cpp index 3ef4d0296a..c79f557c08 100644 --- a/examples/CHelloTriangle.cpp +++ b/examples/CHelloTriangle.cpp @@ -117,7 +117,7 @@ void frame() { DawnTexture backbuffer = dawnSwapChainGetNextTexture(swapchain); DawnTextureView backbufferView; { - backbufferView = dawnTextureCreateDefaultTextureView(backbuffer); + backbufferView = dawnTextureCreateDefaultView(backbuffer); } DawnRenderPassDescriptor renderpassInfo; DawnRenderPassColorAttachmentDescriptor colorAttachment; diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp index 9a7e479d0e..e9f44ac897 100644 --- a/examples/ComputeBoids.cpp +++ b/examples/ComputeBoids.cpp @@ -269,7 +269,7 @@ dawn::CommandBuffer createCommandBuffer(const dawn::Texture backbuffer, size_t i } { - utils::ComboRenderPassDescriptor renderPass({backbuffer.CreateDefaultTextureView()}, + utils::ComboRenderPassDescriptor renderPass({backbuffer.CreateDefaultView()}, depthStencilView); dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); pass.SetPipeline(renderPipeline); diff --git a/examples/CppHelloTriangle.cpp b/examples/CppHelloTriangle.cpp index f13d0ba1e4..b560d7959e 100644 --- a/examples/CppHelloTriangle.cpp +++ b/examples/CppHelloTriangle.cpp @@ -135,7 +135,7 @@ void init() { pipeline = device.CreateRenderPipeline(&descriptor); - dawn::TextureView view = texture.CreateDefaultTextureView(); + dawn::TextureView view = texture.CreateDefaultView(); bindGroup = utils::MakeBindGroup(device, bgl, { {0, sampler}, @@ -150,7 +150,7 @@ void frame() { if (s.b >= 1.0f) {s.b = 0.0f;} dawn::Texture backbuffer = swapchain.GetNextTexture(); - utils::ComboRenderPassDescriptor renderPass({backbuffer.CreateDefaultTextureView()}, + utils::ComboRenderPassDescriptor renderPass({backbuffer.CreateDefaultView()}, depthStencilView); static const uint64_t vertexBufferOffsets[1] = {0}; diff --git a/examples/CubeReflection.cpp b/examples/CubeReflection.cpp index 7e6119b2ca..56263d444a 100644 --- a/examples/CubeReflection.cpp +++ b/examples/CubeReflection.cpp @@ -260,7 +260,7 @@ void frame() { cameraBuffer.SetSubData(0, sizeof(CameraData), reinterpret_cast(&cameraData)); dawn::Texture backbuffer = swapchain.GetNextTexture(); - utils::ComboRenderPassDescriptor renderPass({backbuffer.CreateDefaultTextureView()}, + utils::ComboRenderPassDescriptor renderPass({backbuffer.CreateDefaultView()}, depthStencilView); dawn::CommandEncoder encoder = device.CreateCommandEncoder(); diff --git a/examples/SampleUtils.cpp b/examples/SampleUtils.cpp index e979467bce..678b4bfdb7 100644 --- a/examples/SampleUtils.cpp +++ b/examples/SampleUtils.cpp @@ -167,7 +167,7 @@ dawn::TextureView CreateDefaultDepthStencilView(const dawn::Device& device) { descriptor.mipLevelCount = 1; descriptor.usage = dawn::TextureUsageBit::OutputAttachment; auto depthStencilTexture = device.CreateTexture(&descriptor); - return depthStencilTexture.CreateDefaultTextureView(); + return depthStencilTexture.CreateDefaultView(); } bool InitSample(int argc, const char** argv) { diff --git a/examples/glTFViewer/glTFViewer.cpp b/examples/glTFViewer/glTFViewer.cpp index af7350fd2f..aebf9431bc 100644 --- a/examples/glTFViewer/glTFViewer.cpp +++ b/examples/glTFViewer/glTFViewer.cpp @@ -466,7 +466,7 @@ namespace { dawn::CommandBuffer cmdbuf = encoder.Finish(); queue.Submit(1, &cmdbuf); - textures[iTextureID] = oTexture.CreateDefaultTextureView(); + textures[iTextureID] = oTexture.CreateDefaultView(); } } @@ -593,7 +593,7 @@ namespace { const auto& defaultSceneNodes = scene.scenes.at(scene.defaultScene); dawn::CommandEncoder encoder = device.CreateCommandEncoder(); { - utils::ComboRenderPassDescriptor renderPass({backbuffer.CreateDefaultTextureView()}, + utils::ComboRenderPassDescriptor renderPass({backbuffer.CreateDefaultView()}, depthStencilView); dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); for (const auto& n : defaultSceneNodes) { diff --git a/src/dawn_native/Texture.cpp b/src/dawn_native/Texture.cpp index 9d584e87cd..22a62e7d39 100644 --- a/src/dawn_native/Texture.cpp +++ b/src/dawn_native/Texture.cpp @@ -381,7 +381,7 @@ namespace dawn_native { return mSampleCount > 1; } - TextureViewBase* TextureBase::CreateDefaultTextureView() { + TextureViewBase* TextureBase::CreateDefaultView() { TextureViewDescriptor descriptor = {}; if (!IsError()) { @@ -391,7 +391,7 @@ namespace dawn_native { return GetDevice()->CreateTextureView(this, &descriptor); } - TextureViewBase* TextureBase::CreateTextureView(const TextureViewDescriptor* descriptor) { + TextureViewBase* TextureBase::CreateView(const TextureViewDescriptor* descriptor) { return GetDevice()->CreateTextureView(this, descriptor); } diff --git a/src/dawn_native/Texture.h b/src/dawn_native/Texture.h index 15c3dcdee8..abfce114d9 100644 --- a/src/dawn_native/Texture.h +++ b/src/dawn_native/Texture.h @@ -65,8 +65,8 @@ namespace dawn_native { bool IsMultisampledTexture() const; // Dawn API - TextureViewBase* CreateDefaultTextureView(); - TextureViewBase* CreateTextureView(const TextureViewDescriptor* descriptor); + TextureViewBase* CreateDefaultView(); + TextureViewBase* CreateView(const TextureViewDescriptor* descriptor); void Destroy(); protected: diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp index 96b978e76f..9bf437e26c 100644 --- a/src/tests/end2end/BindGroupTests.cpp +++ b/src/tests/end2end/BindGroupTests.cpp @@ -247,7 +247,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) { descriptor.mipLevelCount = 1; descriptor.usage = dawn::TextureUsageBit::TransferDst | dawn::TextureUsageBit::Sampled; dawn::Texture texture = device.CreateTexture(&descriptor); - dawn::TextureView textureView = texture.CreateDefaultTextureView(); + dawn::TextureView textureView = texture.CreateDefaultView(); int width = kRTSize, height = kRTSize; int widthInBytes = width * sizeof(RGBA8); diff --git a/src/tests/end2end/ClipSpaceTests.cpp b/src/tests/end2end/ClipSpaceTests.cpp index bd5e9f194c..ee3663ff36 100644 --- a/src/tests/end2end/ClipSpaceTests.cpp +++ b/src/tests/end2end/ClipSpaceTests.cpp @@ -76,7 +76,7 @@ TEST_P(ClipSpaceTest, ClipSpace) { dawn::Texture depthStencilTexture = Create2DTextureForTest(dawn::TextureFormat::D32FloatS8Uint); utils::ComboRenderPassDescriptor renderPassDescriptor( - {colorTexture.CreateDefaultTextureView()}, depthStencilTexture.CreateDefaultTextureView()); + {colorTexture.CreateDefaultView()}, depthStencilTexture.CreateDefaultView()); renderPassDescriptor.cColorAttachmentsInfoPtr[0]->clearColor = {0.0, 1.0, 0.0, 1.0}; renderPassDescriptor.cColorAttachmentsInfoPtr[0]->loadOp = dawn::LoadOp::Clear; diff --git a/src/tests/end2end/ColorStateTests.cpp b/src/tests/end2end/ColorStateTests.cpp index 1744285ad3..e83a57a37e 100644 --- a/src/tests/end2end/ColorStateTests.cpp +++ b/src/tests/end2end/ColorStateTests.cpp @@ -766,7 +766,7 @@ TEST_P(ColorStateTest, IndependentColorState) { for (uint32_t i = 0; i < 4; ++i) { renderTargets[i] = device.CreateTexture(&descriptor); - renderTargetViews[i] = renderTargets[i].CreateDefaultTextureView(); + renderTargetViews[i] = renderTargets[i].CreateDefaultView(); } utils::ComboRenderPassDescriptor renderPass({renderTargetViews[0], renderTargetViews[1], diff --git a/src/tests/end2end/DepthStencilStateTests.cpp b/src/tests/end2end/DepthStencilStateTests.cpp index 4e6bf8e493..e700ceab4a 100644 --- a/src/tests/end2end/DepthStencilStateTests.cpp +++ b/src/tests/end2end/DepthStencilStateTests.cpp @@ -37,7 +37,7 @@ class DepthStencilStateTest : public DawnTest { renderTargetDescriptor.usage = dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc; renderTarget = device.CreateTexture(&renderTargetDescriptor); - renderTargetView = renderTarget.CreateDefaultTextureView(); + renderTargetView = renderTarget.CreateDefaultView(); dawn::TextureDescriptor depthDescriptor; depthDescriptor.dimension = dawn::TextureDimension::e2D; @@ -51,7 +51,7 @@ class DepthStencilStateTest : public DawnTest { depthDescriptor.usage = dawn::TextureUsageBit::OutputAttachment; depthTexture = device.CreateTexture(&depthDescriptor); - depthTextureView = depthTexture.CreateDefaultTextureView(); + depthTextureView = depthTexture.CreateDefaultView(); vsModule = utils::CreateShaderModule(device, dawn::ShaderStage::Vertex, R"( #version 450 diff --git a/src/tests/end2end/IOSurfaceWrappingTests.cpp b/src/tests/end2end/IOSurfaceWrappingTests.cpp index c7f1fb7c70..4c9736c740 100644 --- a/src/tests/end2end/IOSurfaceWrappingTests.cpp +++ b/src/tests/end2end/IOSurfaceWrappingTests.cpp @@ -239,7 +239,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase { textureDescriptor.usage = dawn::TextureUsageBit::Sampled; dawn::Texture wrappingTexture = WrapIOSurface(&textureDescriptor, ioSurface, 0); - dawn::TextureView textureView = wrappingTexture.CreateDefaultTextureView(); + dawn::TextureView textureView = wrappingTexture.CreateDefaultView(); dawn::SamplerDescriptor samplerDescriptor = utils::GetDefaultSamplerDescriptor(); dawn::Sampler sampler = device.CreateSampler(&samplerDescriptor); @@ -331,7 +331,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase { textureDescriptor.usage = dawn::TextureUsageBit::OutputAttachment; dawn::Texture ioSurfaceTexture = WrapIOSurface(&textureDescriptor, ioSurface, 0); - dawn::TextureView ioSurfaceView = ioSurfaceTexture.CreateDefaultTextureView(); + dawn::TextureView ioSurfaceView = ioSurfaceTexture.CreateDefaultView(); utils::ComboRenderPassDescriptor renderPassDescriptor({ioSurfaceView}, {}); renderPassDescriptor.cColorAttachmentsInfoPtr[0]->clearColor = {1 / 255.0f, 2 / 255.0f, diff --git a/src/tests/end2end/MultisampledRenderingTests.cpp b/src/tests/end2end/MultisampledRenderingTests.cpp index 76d3c119c9..71f564dec4 100644 --- a/src/tests/end2end/MultisampledRenderingTests.cpp +++ b/src/tests/end2end/MultisampledRenderingTests.cpp @@ -28,9 +28,9 @@ class MultisampledRenderingTest : public DawnTest { void InitTexturesForTest() { mMultisampledColorView = - CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateDefaultTextureView(); + CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateDefaultView(); mResolveTexture = CreateTextureForOutputAttachment(kColorFormat, 1); - mResolveView = mResolveTexture.CreateDefaultTextureView(); + mResolveView = mResolveTexture.CreateDefaultView(); } dawn::RenderPipeline CreateRenderPipelineWithOneOutputForTest(bool testDepth) { @@ -143,7 +143,7 @@ class MultisampledRenderingTest : public DawnTest { dawn::Texture depthStencilTexture = CreateTextureForOutputAttachment(kDepthStencilFormat, kSampleCount); renderPass.cDepthStencilAttachmentInfo.attachment = - depthStencilTexture.CreateDefaultTextureView(); + depthStencilTexture.CreateDefaultView(); renderPass.depthStencilAttachment = &renderPass.cDepthStencilAttachmentInfo; } @@ -338,9 +338,9 @@ TEST_P(MultisampledRenderingTest, ResolveInAnotherRenderPass) { // Test doing MSAA resolve into multiple resolve targets works correctly. TEST_P(MultisampledRenderingTest, ResolveIntoMultipleResolveTargets) { dawn::TextureView multisampledColorView2 = - CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateDefaultTextureView(); + CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateDefaultView(); dawn::Texture resolveTexture2 = CreateTextureForOutputAttachment(kColorFormat, 1); - dawn::TextureView resolveView2 = resolveTexture2.CreateDefaultTextureView(); + dawn::TextureView resolveView2 = resolveTexture2.CreateDefaultView(); dawn::CommandEncoder commandEncoder = device.CreateCommandEncoder(); dawn::RenderPipeline pipeline = CreateRenderPipelineWithTwoOutputsForTest(); @@ -425,7 +425,7 @@ TEST_P(MultisampledRenderingTest, ResolveIntoOneMipmapLevelOf2DTexture) { dawn::Texture resolveTexture = CreateTextureForOutputAttachment(kColorFormat, 1, kBaseMipLevel + 1, 1); - dawn::TextureView resolveView = resolveTexture.CreateTextureView(&textureViewDescriptor); + dawn::TextureView resolveView = resolveTexture.CreateView(&textureViewDescriptor); dawn::CommandEncoder commandEncoder = device.CreateCommandEncoder(); constexpr dawn::Color kGreen = {0.0f, 0.8f, 0.0f, 0.8f}; @@ -454,7 +454,7 @@ TEST_P(MultisampledRenderingTest, ResolveInto2DArrayTexture) { // TODO(jiawei.shao@intel.com): investigate why this case fails on Intel and Nvidia. DAWN_SKIP_TEST_IF(IsMetal() && (IsIntel() || IsNvidia())); dawn::TextureView multisampledColorView2 = - CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateDefaultTextureView(); + CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateDefaultView(); dawn::TextureViewDescriptor baseTextureViewDescriptor; baseTextureViewDescriptor.dimension = dawn::TextureViewDimension::e2D; @@ -470,7 +470,7 @@ TEST_P(MultisampledRenderingTest, ResolveInto2DArrayTexture) { dawn::TextureViewDescriptor resolveViewDescriptor1 = baseTextureViewDescriptor; resolveViewDescriptor1.baseArrayLayer = kBaseArrayLayer1; resolveViewDescriptor1.baseMipLevel = kBaseMipLevel1; - dawn::TextureView resolveView1 = resolveTexture1.CreateTextureView(&resolveViewDescriptor1); + dawn::TextureView resolveView1 = resolveTexture1.CreateView(&resolveViewDescriptor1); // Create resolveTexture2 with (kBaseMipLevel2 + 1) mipmap levels and resolve into its last // mipmap level. @@ -481,7 +481,7 @@ TEST_P(MultisampledRenderingTest, ResolveInto2DArrayTexture) { dawn::TextureViewDescriptor resolveViewDescriptor2 = baseTextureViewDescriptor; resolveViewDescriptor2.baseArrayLayer = kBaseArrayLayer2; resolveViewDescriptor2.baseMipLevel = kBaseMipLevel2; - dawn::TextureView resolveView2 = resolveTexture2.CreateTextureView(&resolveViewDescriptor2); + dawn::TextureView resolveView2 = resolveTexture2.CreateView(&resolveViewDescriptor2); dawn::CommandEncoder commandEncoder = device.CreateCommandEncoder(); dawn::RenderPipeline pipeline = CreateRenderPipelineWithTwoOutputsForTest(); diff --git a/src/tests/end2end/RenderPassLoadOpTests.cpp b/src/tests/end2end/RenderPassLoadOpTests.cpp index f3810d663c..aadd9bc292 100644 --- a/src/tests/end2end/RenderPassLoadOpTests.cpp +++ b/src/tests/end2end/RenderPassLoadOpTests.cpp @@ -69,7 +69,7 @@ class RenderPassLoadOpTests : public DawnTest { descriptor.usage = dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc; renderTarget = device.CreateTexture(&descriptor); - renderTargetView = renderTarget.CreateDefaultTextureView(); + renderTargetView = renderTarget.CreateDefaultView(); RGBA8 zero(0, 0, 0, 0); std::fill(expectZero.begin(), expectZero.end(), zero); diff --git a/src/tests/end2end/RenderPassTests.cpp b/src/tests/end2end/RenderPassTests.cpp index e38b929c91..afc53174fa 100644 --- a/src/tests/end2end/RenderPassTests.cpp +++ b/src/tests/end2end/RenderPassTests.cpp @@ -84,7 +84,7 @@ TEST_P(RenderPassTest, TwoRenderPassesInOneCommandBuffer) { { // In the first render pass we clear renderTarget1 to red and draw a blue triangle in the // bottom left of renderTarget1. - utils::ComboRenderPassDescriptor renderPass({renderTarget1.CreateDefaultTextureView()}); + utils::ComboRenderPassDescriptor renderPass({renderTarget1.CreateDefaultView()}); renderPass.cColorAttachmentsInfoPtr[0]->clearColor = {1.0f, 0.0f, 0.0f, 1.0f}; dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); @@ -96,7 +96,7 @@ TEST_P(RenderPassTest, TwoRenderPassesInOneCommandBuffer) { { // In the second render pass we clear renderTarget2 to green and draw a blue triangle in the // bottom left of renderTarget2. - utils::ComboRenderPassDescriptor renderPass({renderTarget2.CreateDefaultTextureView()}); + utils::ComboRenderPassDescriptor renderPass({renderTarget2.CreateDefaultView()}); renderPass.cColorAttachmentsInfoPtr[0]->clearColor = {0.0f, 1.0f, 0.0f, 1.0f}; dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); diff --git a/src/tests/end2end/SamplerTests.cpp b/src/tests/end2end/SamplerTests.cpp index 215f91b819..4e72fddbbc 100644 --- a/src/tests/end2end/SamplerTests.cpp +++ b/src/tests/end2end/SamplerTests.cpp @@ -113,7 +113,7 @@ protected: dawn::CommandBuffer copy = encoder.Finish(); queue.Submit(1, ©); - mTextureView = texture.CreateDefaultTextureView(); + mTextureView = texture.CreateDefaultView(); } void TestAddressModes(AddressModeTestCase u, AddressModeTestCase v, AddressModeTestCase w) { diff --git a/src/tests/end2end/TextureViewTests.cpp b/src/tests/end2end/TextureViewTests.cpp index ac4f017d2d..e2cf9eff51 100644 --- a/src/tests/end2end/TextureViewTests.cpp +++ b/src/tests/end2end/TextureViewTests.cpp @@ -209,7 +209,7 @@ protected: descriptor.arrayLayerCount = 1; descriptor.baseMipLevel = textureViewBaseMipLevel; descriptor.mipLevelCount = 1; - dawn::TextureView textureView = mTexture.CreateTextureView(&descriptor); + dawn::TextureView textureView = mTexture.CreateView(&descriptor); const char* fragmentShader = R"( #version 450 @@ -248,7 +248,7 @@ protected: descriptor.arrayLayerCount = kTextureViewLayerCount; descriptor.baseMipLevel = textureViewBaseMipLevel; descriptor.mipLevelCount = 1; - dawn::TextureView textureView = mTexture.CreateTextureView(&descriptor); + dawn::TextureView textureView = mTexture.CreateView(&descriptor); const char* fragmentShader = R"( #version 450 @@ -328,7 +328,7 @@ protected: descriptor.baseArrayLayer = textureViewBaseLayer; descriptor.arrayLayerCount = textureViewLayerCount; - dawn::TextureView cubeMapTextureView = mTexture.CreateTextureView(&descriptor); + dawn::TextureView cubeMapTextureView = mTexture.CreateView(&descriptor); // Check the data in the every face of the cube map (array) texture view. for (uint32_t layer = 0; layer < textureViewLayerCount; ++layer) { @@ -358,7 +358,7 @@ TEST_P(TextureViewSamplingTest, Default2DArrayTexture) { constexpr uint32_t kMipLevels = 1; initTexture(kLayers, kMipLevels); - dawn::TextureView textureView = mTexture.CreateDefaultTextureView(); + dawn::TextureView textureView = mTexture.CreateDefaultView(); const char* fragmentShader = R"( #version 450 @@ -486,7 +486,7 @@ class TextureViewRenderingTest : public DawnTest { descriptor.arrayLayerCount = 1; descriptor.baseMipLevel = textureViewBaseLevel; descriptor.mipLevelCount = 1; - dawn::TextureView textureView = texture.CreateTextureView(&descriptor); + dawn::TextureView textureView = texture.CreateView(&descriptor); dawn::ShaderModule vsModule = CreateDefaultVertexShaderModule(device); diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp index 78563c47f8..cd4f6c8656 100644 --- a/src/tests/unittests/validation/BindGroupValidationTests.cpp +++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp @@ -47,7 +47,7 @@ class BindGroupValidationTest : public ValidationTest { descriptor.mipLevelCount = 1; descriptor.usage = dawn::TextureUsageBit::Sampled; mSampledTexture = device.CreateTexture(&descriptor); - mSampledTextureView = mSampledTexture.CreateDefaultTextureView(); + mSampledTextureView = mSampledTexture.CreateDefaultView(); } } @@ -223,7 +223,7 @@ TEST_F(BindGroupValidationTest, TextureBindingType) { viewDesc.arrayLayerCount = 0; dawn::TextureView errorView; - ASSERT_DEVICE_ERROR(errorView = mSampledTexture.CreateTextureView(&viewDesc)); + ASSERT_DEVICE_ERROR(errorView = mSampledTexture.CreateView(&viewDesc)); binding.textureView = errorView; ASSERT_DEVICE_ERROR(device.CreateBindGroup(&descriptor)); @@ -301,7 +301,7 @@ TEST_F(BindGroupValidationTest, TextureUsage) { descriptor.mipLevelCount = 1; descriptor.usage = dawn::TextureUsageBit::OutputAttachment; dawn::Texture outputTexture = device.CreateTexture(&descriptor); - dawn::TextureView outputTextureView = outputTexture.CreateDefaultTextureView(); + dawn::TextureView outputTextureView = outputTexture.CreateDefaultView(); ASSERT_DEVICE_ERROR(utils::MakeBindGroup(device, layout, {{0, outputTextureView}})); } diff --git a/src/tests/unittests/validation/CommandBufferValidationTests.cpp b/src/tests/unittests/validation/CommandBufferValidationTests.cpp index a39989a160..882fd03a51 100644 --- a/src/tests/unittests/validation/CommandBufferValidationTests.cpp +++ b/src/tests/unittests/validation/CommandBufferValidationTests.cpp @@ -226,7 +226,7 @@ TEST_F(CommandBufferValidationTest, TextureWithReadAndWriteUsage) { textureDescriptor.sampleCount = 1; textureDescriptor.mipLevelCount = 1; dawn::Texture texture = device.CreateTexture(&textureDescriptor); - dawn::TextureView view = texture.CreateDefaultTextureView(); + dawn::TextureView view = texture.CreateDefaultView(); // Create the bind group to use the texture as sampled dawn::BindGroupLayout bgl = utils::MakeBindGroupLayout(device, {{ diff --git a/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp b/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp index b532a957ea..12f68f73c1 100644 --- a/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp @@ -69,11 +69,11 @@ dawn::TextureView Create2DAttachment(dawn::Device& device, dawn::TextureFormat format) { dawn::Texture texture = CreateTexture( device, dawn::TextureDimension::e2D, format, width, height, 1, 1); - return texture.CreateDefaultTextureView(); + return texture.CreateDefaultView(); } // Using BeginRenderPass with no attachments isn't valid -TEST_F(RenderPassDescriptorValidationTest, Empty) { +TEST_F(RenderPassDescriptorValidationTest, Empty) { utils::ComboRenderPassDescriptor renderPass({}, nullptr); AssertBeginRenderPassError(&renderPass); } @@ -222,7 +222,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth descriptor.format = kColorFormat; descriptor.arrayLayerCount = 5; - dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor); + dawn::TextureView colorTextureView = colorTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({colorTextureView}); AssertBeginRenderPassError(&renderPass); } @@ -233,7 +233,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth descriptor.format = kDepthStencilFormat; descriptor.arrayLayerCount = 5; - dawn::TextureView depthStencilView = depthStencilTexture.CreateTextureView(&descriptor); + dawn::TextureView depthStencilView = depthStencilTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({}, depthStencilView); AssertBeginRenderPassError(&renderPass); } @@ -245,7 +245,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth descriptor.baseArrayLayer = 0; descriptor.arrayLayerCount = 1; - dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor); + dawn::TextureView colorTextureView = colorTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({colorTextureView}); AssertBeginRenderPassSuccess(&renderPass); } @@ -257,7 +257,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth descriptor.baseArrayLayer = 0; descriptor.arrayLayerCount = 1; - dawn::TextureView depthStencilView = depthStencilTexture.CreateTextureView(&descriptor); + dawn::TextureView depthStencilView = depthStencilTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({}, depthStencilView); AssertBeginRenderPassSuccess(&renderPass); } @@ -269,7 +269,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth descriptor.baseArrayLayer = kArrayLayers - 1; descriptor.arrayLayerCount = 1; - dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor); + dawn::TextureView colorTextureView = colorTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({colorTextureView}); AssertBeginRenderPassSuccess(&renderPass); } @@ -281,7 +281,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth descriptor.baseArrayLayer = kArrayLayers - 1; descriptor.arrayLayerCount = 1; - dawn::TextureView depthStencilView = depthStencilTexture.CreateTextureView(&descriptor); + dawn::TextureView depthStencilView = depthStencilTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({}, depthStencilView); AssertBeginRenderPassSuccess(&renderPass); } @@ -315,7 +315,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth descriptor.format = kColorFormat; descriptor.mipLevelCount = 2; - dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor); + dawn::TextureView colorTextureView = colorTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({colorTextureView}); AssertBeginRenderPassError(&renderPass); } @@ -326,7 +326,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth descriptor.format = kDepthStencilFormat; descriptor.mipLevelCount = 2; - dawn::TextureView depthStencilView = depthStencilTexture.CreateTextureView(&descriptor); + dawn::TextureView depthStencilView = depthStencilTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({}, depthStencilView); AssertBeginRenderPassError(&renderPass); } @@ -338,7 +338,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth descriptor.baseMipLevel = 0; descriptor.mipLevelCount = 1; - dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor); + dawn::TextureView colorTextureView = colorTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({colorTextureView}); AssertBeginRenderPassSuccess(&renderPass); } @@ -350,7 +350,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth descriptor.baseMipLevel = 0; descriptor.mipLevelCount = 1; - dawn::TextureView depthStencilView = depthStencilTexture.CreateTextureView(&descriptor); + dawn::TextureView depthStencilView = depthStencilTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({}, depthStencilView); AssertBeginRenderPassSuccess(&renderPass); } @@ -362,7 +362,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth descriptor.baseMipLevel = kLevelCount - 1; descriptor.mipLevelCount = 1; - dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor); + dawn::TextureView colorTextureView = colorTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({colorTextureView}); AssertBeginRenderPassSuccess(&renderPass); } @@ -374,7 +374,7 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth descriptor.baseMipLevel = kLevelCount - 1; descriptor.mipLevelCount = 1; - dawn::TextureView depthStencilView = depthStencilTexture.CreateTextureView(&descriptor); + dawn::TextureView depthStencilView = depthStencilTexture.CreateView(&descriptor); utils::ComboRenderPassDescriptor renderPass({}, depthStencilView); AssertBeginRenderPassSuccess(&renderPass); } @@ -394,8 +394,8 @@ TEST_F(RenderPassDescriptorValidationTest, NonMultisampledColorWithResolveTarget dawn::Texture resolveTargetTexture = CreateTexture( device, dawn::TextureDimension::e2D, kColorFormat, kSize, kSize, kArrayLayers, kLevelCount, kSampleCount); - dawn::TextureView colorTextureView = colorTexture.CreateDefaultTextureView(); - dawn::TextureView resolveTargetTextureView = resolveTargetTexture.CreateDefaultTextureView(); + dawn::TextureView colorTextureView = colorTexture.CreateDefaultView(); + dawn::TextureView resolveTargetTextureView = resolveTargetTexture.CreateDefaultView(); utils::ComboRenderPassDescriptor renderPass({colorTextureView}); renderPass.cColorAttachmentsInfoPtr[0]->resolveTarget = resolveTargetTextureView; @@ -428,7 +428,7 @@ class MultisampledRenderPassDescriptorValidationTest : public RenderPassDescript device, dawn::TextureDimension::e2D, kColorFormat, kSize, kSize, kArrayLayers, kLevelCount, sampleCount); - return colorTexture.CreateDefaultTextureView(); + return colorTexture.CreateDefaultView(); } }; @@ -467,7 +467,7 @@ TEST_F(MultisampledRenderPassDescriptorValidationTest, ResolveTargetArrayLayerMo dawn::Texture resolveTexture = CreateTexture( device, dawn::TextureDimension::e2D, kColorFormat, kSize, kSize, kArrayLayers2, kLevelCount); - dawn::TextureView resolveTextureView = resolveTexture.CreateDefaultTextureView(); + dawn::TextureView resolveTextureView = resolveTexture.CreateDefaultView(); utils::ComboRenderPassDescriptor renderPass = CreateMultisampledRenderPass(); renderPass.cColorAttachmentsInfoPtr[0]->resolveTarget = resolveTextureView; @@ -480,7 +480,7 @@ TEST_F(MultisampledRenderPassDescriptorValidationTest, ResolveTargetMipmapLevelM dawn::Texture resolveTexture = CreateTexture( device, dawn::TextureDimension::e2D, kColorFormat, kSize, kSize, kArrayLayers, kLevelCount2); - dawn::TextureView resolveTextureView = resolveTexture.CreateDefaultTextureView(); + dawn::TextureView resolveTextureView = resolveTexture.CreateDefaultView(); utils::ComboRenderPassDescriptor renderPass = CreateMultisampledRenderPass(); renderPass.cColorAttachmentsInfoPtr[0]->resolveTarget = resolveTextureView; @@ -496,7 +496,7 @@ TEST_F(MultisampledRenderPassDescriptorValidationTest, ResolveTargetUsageNoOutpu device, dawn::TextureDimension::e2D, kColorFormat, kSize, kSize, kArrayLayers, kLevelCount, 1, kUsage); dawn::TextureView nonColorUsageResolveTextureView = - nonColorUsageResolveTexture.CreateDefaultTextureView(); + nonColorUsageResolveTexture.CreateDefaultView(); utils::ComboRenderPassDescriptor renderPass = CreateMultisampledRenderPass(); renderPass.cColorAttachmentsInfoPtr[0]->resolveTarget = nonColorUsageResolveTextureView; @@ -514,7 +514,7 @@ TEST_F(MultisampledRenderPassDescriptorValidationTest, ResolveTargetInErrorState errorTextureView.baseArrayLayer = kArrayLayers + 1; ASSERT_DEVICE_ERROR( dawn::TextureView errorResolveTarget = - resolveTexture.CreateTextureView(&errorTextureView)); + resolveTexture.CreateView(&errorTextureView)); utils::ComboRenderPassDescriptor renderPass = CreateMultisampledRenderPass(); renderPass.cColorAttachmentsInfoPtr[0]->resolveTarget = errorResolveTarget; @@ -536,7 +536,7 @@ TEST_F(MultisampledRenderPassDescriptorValidationTest, ResolveTargetDifferentFor dawn::Texture resolveTexture = CreateTexture( device, dawn::TextureDimension::e2D, kColorFormat2, kSize, kSize, kArrayLayers, kLevelCount); - dawn::TextureView resolveTextureView = resolveTexture.CreateDefaultTextureView(); + dawn::TextureView resolveTextureView = resolveTexture.CreateDefaultView(); utils::ComboRenderPassDescriptor renderPass = CreateMultisampledRenderPass(); renderPass.cColorAttachmentsInfoPtr[0]->resolveTarget = resolveTextureView; @@ -563,7 +563,7 @@ TEST_F(MultisampledRenderPassDescriptorValidationTest, ColorAttachmentResolveTar firstMipLevelDescriptor.baseMipLevel = 0; dawn::TextureView resolveTextureView = - resolveTexture.CreateTextureView(&firstMipLevelDescriptor); + resolveTexture.CreateView(&firstMipLevelDescriptor); utils::ComboRenderPassDescriptor renderPass = CreateMultisampledRenderPass(); renderPass.cColorAttachmentsInfoPtr[0]->resolveTarget = resolveTextureView; @@ -575,7 +575,7 @@ TEST_F(MultisampledRenderPassDescriptorValidationTest, ColorAttachmentResolveTar secondMipLevelDescriptor.baseMipLevel = 1; dawn::TextureView resolveTextureView = - resolveTexture.CreateTextureView(&secondMipLevelDescriptor); + resolveTexture.CreateView(&secondMipLevelDescriptor); utils::ComboRenderPassDescriptor renderPass = CreateMultisampledRenderPass(); renderPass.cColorAttachmentsInfoPtr[0]->resolveTarget = resolveTextureView; @@ -590,7 +590,7 @@ TEST_F(MultisampledRenderPassDescriptorValidationTest, DepthStencilAttachmentSam device, dawn::TextureDimension::e2D, kDepthStencilFormat, kSize, kSize, kArrayLayers, kLevelCount, kSampleCount); dawn::TextureView multisampledDepthStencilTextureView = - multisampledDepthStencilTexture.CreateDefaultTextureView(); + multisampledDepthStencilTexture.CreateDefaultView(); // It is not allowed to use a depth stencil attachment whose sample count is different from the // one of the color attachment. @@ -598,7 +598,7 @@ TEST_F(MultisampledRenderPassDescriptorValidationTest, DepthStencilAttachmentSam dawn::Texture depthStencilTexture = CreateTexture( device, dawn::TextureDimension::e2D, kDepthStencilFormat, kSize, kSize, kArrayLayers, kLevelCount); - dawn::TextureView depthStencilTextureView = depthStencilTexture.CreateDefaultTextureView(); + dawn::TextureView depthStencilTextureView = depthStencilTexture.CreateDefaultView(); utils::ComboRenderPassDescriptor renderPass( {CreateMultisampledColorTextureView()}, depthStencilTextureView); diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index 61fbfb953e..0bb87fd7b8 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -143,7 +143,7 @@ TEST_F(RenderPipelineValidationTest, SampleCountCompatibilityWithRenderPass) { textureDescriptor.sampleCount = kMultisampledCount; dawn::Texture multisampledColorTexture = device.CreateTexture(&textureDescriptor); utils::ComboRenderPassDescriptor renderPassDescriptor( - {multisampledColorTexture.CreateDefaultTextureView()}); + {multisampledColorTexture.CreateDefaultView()}); dawn::CommandEncoder encoder = device.CreateCommandEncoder(); dawn::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDescriptor); @@ -160,7 +160,7 @@ TEST_F(RenderPipelineValidationTest, SampleCountCompatibilityWithRenderPass) { dawn::Texture multisampledDepthStencilTexture = device.CreateTexture(&textureDescriptor); utils::ComboRenderPassDescriptor renderPassDescriptor( - {}, multisampledDepthStencilTexture.CreateDefaultTextureView()); + {}, multisampledDepthStencilTexture.CreateDefaultView()); dawn::CommandEncoder encoder = device.CreateCommandEncoder(); dawn::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDescriptor); @@ -179,7 +179,7 @@ TEST_F(RenderPipelineValidationTest, SampleCountCompatibilityWithRenderPass) { textureDescriptor.sampleCount = kMultisampledCount; dawn::Texture multisampledColorTexture = device.CreateTexture(&textureDescriptor); utils::ComboRenderPassDescriptor renderPassDescriptor( - {multisampledColorTexture.CreateDefaultTextureView()}); + {multisampledColorTexture.CreateDefaultView()}); dawn::CommandEncoder encoder = device.CreateCommandEncoder(); dawn::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDescriptor); @@ -196,7 +196,7 @@ TEST_F(RenderPipelineValidationTest, SampleCountCompatibilityWithRenderPass) { dawn::Texture multisampledDepthStencilTexture = device.CreateTexture(&textureDescriptor); utils::ComboRenderPassDescriptor renderPassDescriptor( - {}, multisampledDepthStencilTexture.CreateDefaultTextureView()); + {}, multisampledDepthStencilTexture.CreateDefaultView()); dawn::CommandEncoder encoder = device.CreateCommandEncoder(); dawn::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDescriptor); @@ -215,7 +215,7 @@ TEST_F(RenderPipelineValidationTest, SampleCountCompatibilityWithRenderPass) { textureDescriptor.sampleCount = 1; dawn::Texture nonMultisampledColorTexture = device.CreateTexture(&textureDescriptor); utils::ComboRenderPassDescriptor nonMultisampledRenderPassDescriptor( - { nonMultisampledColorTexture.CreateDefaultTextureView() }); + { nonMultisampledColorTexture.CreateDefaultView() }); dawn::CommandEncoder encoder = device.CreateCommandEncoder(); dawn::RenderPassEncoder renderPass = @@ -233,7 +233,7 @@ TEST_F(RenderPipelineValidationTest, SampleCountCompatibilityWithRenderPass) { dawn::Texture multisampledDepthStencilTexture = device.CreateTexture(&textureDescriptor); utils::ComboRenderPassDescriptor renderPassDescriptor( - {}, multisampledDepthStencilTexture.CreateDefaultTextureView()); + {}, multisampledDepthStencilTexture.CreateDefaultView()); dawn::CommandEncoder encoder = device.CreateCommandEncoder(); dawn::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDescriptor); diff --git a/src/tests/unittests/validation/TextureValidationTests.cpp b/src/tests/unittests/validation/TextureValidationTests.cpp index cfe722e16f..a88a7df4ee 100644 --- a/src/tests/unittests/validation/TextureValidationTests.cpp +++ b/src/tests/unittests/validation/TextureValidationTests.cpp @@ -115,7 +115,7 @@ TEST_F(TextureValidationTest, DestroyDestroyedTexture) { TEST_F(TextureValidationTest, DestroyEncodeSubmit) { dawn::TextureDescriptor descriptor = CreateDefaultTextureDescriptor(); dawn::Texture texture = device.CreateTexture(&descriptor); - dawn::TextureView textureView = texture.CreateDefaultTextureView(); + dawn::TextureView textureView = texture.CreateDefaultView(); utils::ComboRenderPassDescriptor renderPass({textureView}); @@ -138,7 +138,7 @@ TEST_F(TextureValidationTest, DestroyEncodeSubmit) { TEST_F(TextureValidationTest, EncodeDestroySubmit) { dawn::TextureDescriptor descriptor = CreateDefaultTextureDescriptor(); dawn::Texture texture = device.CreateTexture(&descriptor); - dawn::TextureView textureView = texture.CreateDefaultTextureView(); + dawn::TextureView textureView = texture.CreateDefaultView(); utils::ComboRenderPassDescriptor renderPass({textureView}); diff --git a/src/tests/unittests/validation/TextureViewValidationTests.cpp b/src/tests/unittests/validation/TextureViewValidationTests.cpp index 9eda487364..707db08f8f 100644 --- a/src/tests/unittests/validation/TextureViewValidationTests.cpp +++ b/src/tests/unittests/validation/TextureViewValidationTests.cpp @@ -44,7 +44,7 @@ dawn::Texture Create2DArrayTexture(dawn::Device& device, return device.CreateTexture(&descriptor); } -dawn::TextureViewDescriptor CreateDefaultTextureViewDescriptor(dawn::TextureViewDimension dimension) { +dawn::TextureViewDescriptor CreateDefaultViewDescriptor(dawn::TextureViewDimension dimension) { dawn::TextureViewDescriptor descriptor; descriptor.format = kDefaultTextureFormat; descriptor.dimension = dimension; @@ -60,13 +60,13 @@ TEST_F(TextureViewValidationTest, CreateTextureViewOnTexture2D) { dawn::Texture texture = Create2DArrayTexture(device, 1); dawn::TextureViewDescriptor base2DTextureViewDescriptor = - CreateDefaultTextureViewDescriptor(dawn::TextureViewDimension::e2D); + CreateDefaultViewDescriptor(dawn::TextureViewDimension::e2D); // It is OK to create a 2D texture view on a 2D texture. { dawn::TextureViewDescriptor descriptor = base2DTextureViewDescriptor; descriptor.arrayLayerCount = 1; - texture.CreateTextureView(&descriptor); + texture.CreateView(&descriptor); } // It is an error to specify the layer count of the texture view > 1 when texture view dimension @@ -74,7 +74,7 @@ TEST_F(TextureViewValidationTest, CreateTextureViewOnTexture2D) { { dawn::TextureViewDescriptor descriptor = base2DTextureViewDescriptor; descriptor.arrayLayerCount = 2; - ASSERT_DEVICE_ERROR(texture.CreateTextureView(&descriptor)); + ASSERT_DEVICE_ERROR(texture.CreateView(&descriptor)); } // It is OK to create a 1-layer 2D array texture view on a 2D texture. @@ -82,14 +82,14 @@ TEST_F(TextureViewValidationTest, CreateTextureViewOnTexture2D) { dawn::TextureViewDescriptor descriptor = base2DTextureViewDescriptor; descriptor.dimension = dawn::TextureViewDimension::e2DArray; descriptor.arrayLayerCount = 1; - texture.CreateTextureView(&descriptor); + texture.CreateView(&descriptor); } // It is an error to specify mipLevelCount == 0. { dawn::TextureViewDescriptor descriptor = base2DTextureViewDescriptor; descriptor.mipLevelCount = 0; - ASSERT_DEVICE_ERROR(texture.CreateTextureView(&descriptor)); + ASSERT_DEVICE_ERROR(texture.CreateView(&descriptor)); } // It is an error to make the mip level out of range. @@ -97,7 +97,7 @@ TEST_F(TextureViewValidationTest, CreateTextureViewOnTexture2D) { dawn::TextureViewDescriptor descriptor = base2DTextureViewDescriptor; descriptor.baseMipLevel = kDefaultMipLevels - 1; descriptor.mipLevelCount = 2; - ASSERT_DEVICE_ERROR(texture.CreateTextureView(&descriptor)); + ASSERT_DEVICE_ERROR(texture.CreateView(&descriptor)); } } @@ -108,35 +108,35 @@ TEST_F(TextureViewValidationTest, CreateTextureViewOnTexture2DArray) { dawn::Texture texture = Create2DArrayTexture(device, kDefaultArrayLayers); dawn::TextureViewDescriptor base2DArrayTextureViewDescriptor = - CreateDefaultTextureViewDescriptor(dawn::TextureViewDimension::e2DArray); + CreateDefaultViewDescriptor(dawn::TextureViewDimension::e2DArray); // It is OK to create a 2D texture view on a 2D array texture. { dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor; descriptor.dimension = dawn::TextureViewDimension::e2D; descriptor.arrayLayerCount = 1; - texture.CreateTextureView(&descriptor); + texture.CreateView(&descriptor); } // It is OK to create a 2D array texture view on a 2D array texture. { dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor; descriptor.arrayLayerCount = kDefaultArrayLayers; - texture.CreateTextureView(&descriptor); + texture.CreateView(&descriptor); } // It is an error to specify arrayLayerCount == 0. { dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor; descriptor.arrayLayerCount = 0; - ASSERT_DEVICE_ERROR(texture.CreateTextureView(&descriptor)); + ASSERT_DEVICE_ERROR(texture.CreateView(&descriptor)); } // It is an error to make the array layer out of range. { dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor; descriptor.arrayLayerCount = kDefaultArrayLayers + 1; - ASSERT_DEVICE_ERROR(texture.CreateTextureView(&descriptor)); + ASSERT_DEVICE_ERROR(texture.CreateView(&descriptor)); } } @@ -147,14 +147,14 @@ TEST_F(TextureViewValidationTest, CreateCubeMapTextureView) { dawn::Texture texture = Create2DArrayTexture(device, kDefaultArrayLayers); dawn::TextureViewDescriptor base2DArrayTextureViewDescriptor = - CreateDefaultTextureViewDescriptor(dawn::TextureViewDimension::e2DArray); + CreateDefaultViewDescriptor(dawn::TextureViewDimension::e2DArray); // It is OK to create a cube map texture view with arrayLayerCount == 6. { dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor; descriptor.dimension = dawn::TextureViewDimension::Cube; descriptor.arrayLayerCount = 6; - texture.CreateTextureView(&descriptor); + texture.CreateView(&descriptor); } // It is an error to create a cube map texture view with arrayLayerCount != 6. @@ -162,7 +162,7 @@ TEST_F(TextureViewValidationTest, CreateCubeMapTextureView) { dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor; descriptor.dimension = dawn::TextureViewDimension::Cube; descriptor.arrayLayerCount = 3; - ASSERT_DEVICE_ERROR(texture.CreateTextureView(&descriptor)); + ASSERT_DEVICE_ERROR(texture.CreateView(&descriptor)); } // It is OK to create a cube map array texture view with arrayLayerCount % 6 == 0. @@ -170,7 +170,7 @@ TEST_F(TextureViewValidationTest, CreateCubeMapTextureView) { dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor; descriptor.dimension = dawn::TextureViewDimension::CubeArray; descriptor.arrayLayerCount = 12; - texture.CreateTextureView(&descriptor); + texture.CreateView(&descriptor); } // It is an error to create a cube map array texture view with arrayLayerCount % 6 != 0. @@ -178,7 +178,7 @@ TEST_F(TextureViewValidationTest, CreateCubeMapTextureView) { dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor; descriptor.dimension = dawn::TextureViewDimension::CubeArray; descriptor.arrayLayerCount = 11; - ASSERT_DEVICE_ERROR(texture.CreateTextureView(&descriptor)); + ASSERT_DEVICE_ERROR(texture.CreateView(&descriptor)); } // It is an error to create a cube map texture view with width != height. @@ -188,7 +188,7 @@ TEST_F(TextureViewValidationTest, CreateCubeMapTextureView) { dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor; descriptor.dimension = dawn::TextureViewDimension::Cube; descriptor.arrayLayerCount = 6; - ASSERT_DEVICE_ERROR(nonSquareTexture.CreateTextureView(&descriptor)); + ASSERT_DEVICE_ERROR(nonSquareTexture.CreateView(&descriptor)); } // It is an error to create a cube map array texture view with width != height. @@ -198,7 +198,7 @@ TEST_F(TextureViewValidationTest, CreateCubeMapTextureView) { dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor; descriptor.dimension = dawn::TextureViewDimension::CubeArray; descriptor.arrayLayerCount = 12; - ASSERT_DEVICE_ERROR(nonSquareTexture.CreateTextureView(&descriptor)); + ASSERT_DEVICE_ERROR(nonSquareTexture.CreateView(&descriptor)); } } @@ -208,13 +208,13 @@ TEST_F(TextureViewValidationTest, TextureViewFormatCompatibility) { dawn::Texture texture = Create2DArrayTexture(device, 1); dawn::TextureViewDescriptor base2DTextureViewDescriptor = - CreateDefaultTextureViewDescriptor(dawn::TextureViewDimension::e2D); + CreateDefaultViewDescriptor(dawn::TextureViewDimension::e2D); // It is an error to create a texture view in depth-stencil format on a RGBA texture. { dawn::TextureViewDescriptor descriptor = base2DTextureViewDescriptor; descriptor.format = dawn::TextureFormat::D32FloatS8Uint; - ASSERT_DEVICE_ERROR(texture.CreateTextureView(&descriptor)); + ASSERT_DEVICE_ERROR(texture.CreateView(&descriptor)); } } @@ -222,8 +222,8 @@ TEST_F(TextureViewValidationTest, TextureViewFormatCompatibility) { TEST_F(TextureViewValidationTest, DestroyCreateTextureView) { dawn::Texture texture = Create2DArrayTexture(device, 1); dawn::TextureViewDescriptor descriptor = - CreateDefaultTextureViewDescriptor(dawn::TextureViewDimension::e2D); + CreateDefaultViewDescriptor(dawn::TextureViewDimension::e2D); texture.Destroy(); - ASSERT_DEVICE_ERROR(texture.CreateTextureView(&descriptor)); + ASSERT_DEVICE_ERROR(texture.CreateView(&descriptor)); +} } -} \ No newline at end of file diff --git a/src/tests/unittests/validation/ValidationTest.cpp b/src/tests/unittests/validation/ValidationTest.cpp index d83b767833..c673629b66 100644 --- a/src/tests/unittests/validation/ValidationTest.cpp +++ b/src/tests/unittests/validation/ValidationTest.cpp @@ -93,7 +93,7 @@ ValidationTest::DummyRenderPass::DummyRenderPass(const dawn::Device& device) descriptor.usage = dawn::TextureUsageBit::OutputAttachment; attachment = device.CreateTexture(&descriptor); - dawn::TextureView view = attachment.CreateDefaultTextureView(); + dawn::TextureView view = attachment.CreateDefaultView(); mColorAttachment.attachment = view; mColorAttachment.resolveTarget = nullptr; mColorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f }; diff --git a/src/tests/unittests/wire/WireInjectTextureTests.cpp b/src/tests/unittests/wire/WireInjectTextureTests.cpp index 23da573061..9cf04796b1 100644 --- a/src/tests/unittests/wire/WireInjectTextureTests.cpp +++ b/src/tests/unittests/wire/WireInjectTextureTests.cpp @@ -36,9 +36,9 @@ TEST_F(WireInjectTextureTests, CallAfterReserveInject) { EXPECT_CALL(api, TextureReference(apiTexture)); ASSERT_TRUE(GetWireServer()->InjectTexture(apiTexture, reservation.id, reservation.generation)); - dawnTextureCreateDefaultTextureView(reservation.texture); + dawnTextureCreateDefaultView(reservation.texture); DawnTextureView apiDummyView = api.GetNewTextureView(); - EXPECT_CALL(api, TextureCreateDefaultTextureView(apiTexture)).WillOnce(Return(apiDummyView)); + EXPECT_CALL(api, TextureCreateDefaultView(apiTexture)).WillOnce(Return(apiDummyView)); FlushClient(); } diff --git a/src/utils/DawnHelpers.cpp b/src/utils/DawnHelpers.cpp index 0aaa8a4677..0fa9441628 100644 --- a/src/utils/DawnHelpers.cpp +++ b/src/utils/DawnHelpers.cpp @@ -207,7 +207,7 @@ namespace utils { height(texHeight), color(colorAttachment), colorFormat(textureFormat), - renderPassInfo({colorAttachment.CreateDefaultTextureView()}) { + renderPassInfo({colorAttachment.CreateDefaultView()}) { } BasicRenderPass CreateBasicRenderPass(const dawn::Device& device,