s/OutputAttachment/RenderAttachment/g
But also keep OutputAttachment so it can be gradually changed in all
dependants.
See https://github.com/gpuweb/gpuweb/pull/1168 and
https://github.com/gpuweb/gpuweb/pull/1168
Bug: dawn:22
Change-Id: I6a1ec1de6c22ca4deac88b7fffde4b98d9d54a84
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31040
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/dawn.json b/dawn.json
index 5671e26..9bf733a 100644
--- a/dawn.json
+++ b/dawn.json
@@ -1713,6 +1713,7 @@
{"value": 4, "name": "sampled"},
{"value": 8, "name": "storage"},
{"value": 16, "name": "output attachment"},
+ {"value": 16, "name": "render attachment"},
{"value": 32, "name": "present"}
]
},
diff --git a/examples/Animometer.cpp b/examples/Animometer.cpp
index 5c197c4..e090042 100644
--- a/examples/Animometer.cpp
+++ b/examples/Animometer.cpp
@@ -52,7 +52,7 @@
queue = device.GetDefaultQueue();
swapchain = GetSwapChain(device);
- swapchain.Configure(GetPreferredSwapChainTextureFormat(), wgpu::TextureUsage::OutputAttachment,
+ swapchain.Configure(GetPreferredSwapChainTextureFormat(), wgpu::TextureUsage::RenderAttachment,
640, 480);
wgpu::ShaderModule vsModule =
diff --git a/examples/CHelloTriangle.cpp b/examples/CHelloTriangle.cpp
index 22d8202..4c5c7cc 100644
--- a/examples/CHelloTriangle.cpp
+++ b/examples/CHelloTriangle.cpp
@@ -34,7 +34,7 @@
swapchain = wgpuDeviceCreateSwapChain(device, nullptr, &descriptor);
}
swapChainFormat = static_cast<WGPUTextureFormat>(GetPreferredSwapChainTextureFormat());
- wgpuSwapChainConfigure(swapchain, swapChainFormat, WGPUTextureUsage_OutputAttachment, 640, 480);
+ wgpuSwapChainConfigure(swapchain, swapChainFormat, WGPUTextureUsage_RenderAttachment, 640, 480);
const char* vs =
"#version 450\n"
diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp
index f958ab4..08487da 100644
--- a/examples/ComputeBoids.cpp
+++ b/examples/ComputeBoids.cpp
@@ -292,7 +292,7 @@
queue = device.GetDefaultQueue();
swapchain = GetSwapChain(device);
- swapchain.Configure(GetPreferredSwapChainTextureFormat(), wgpu::TextureUsage::OutputAttachment,
+ swapchain.Configure(GetPreferredSwapChainTextureFormat(), wgpu::TextureUsage::RenderAttachment,
640, 480);
initBuffers();
diff --git a/examples/CppHelloTriangle.cpp b/examples/CppHelloTriangle.cpp
index c3548ab..cef8d6e 100644
--- a/examples/CppHelloTriangle.cpp
+++ b/examples/CppHelloTriangle.cpp
@@ -90,7 +90,7 @@
queue = device.GetDefaultQueue();
swapchain = GetSwapChain(device);
- swapchain.Configure(GetPreferredSwapChainTextureFormat(), wgpu::TextureUsage::OutputAttachment,
+ swapchain.Configure(GetPreferredSwapChainTextureFormat(), wgpu::TextureUsage::RenderAttachment,
640, 480);
initBuffers();
diff --git a/examples/CubeReflection.cpp b/examples/CubeReflection.cpp
index 52d32b5..125ca6c 100644
--- a/examples/CubeReflection.cpp
+++ b/examples/CubeReflection.cpp
@@ -96,7 +96,7 @@
queue = device.GetDefaultQueue();
swapchain = GetSwapChain(device);
- swapchain.Configure(GetPreferredSwapChainTextureFormat(), wgpu::TextureUsage::OutputAttachment,
+ swapchain.Configure(GetPreferredSwapChainTextureFormat(), wgpu::TextureUsage::RenderAttachment,
640, 480);
initBuffers();
diff --git a/examples/ManualSwapChainTest.cpp b/examples/ManualSwapChainTest.cpp
index 9e3990d..8918fed 100644
--- a/examples/ManualSwapChainTest.cpp
+++ b/examples/ManualSwapChainTest.cpp
@@ -111,7 +111,7 @@
glfwSetKeyCallback(window, OnKeyPress);
wgpu::SwapChainDescriptor descriptor;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment;
descriptor.format = wgpu::TextureFormat::BGRA8Unorm;
descriptor.width = 0;
descriptor.height = 0;
@@ -165,8 +165,8 @@
std::ostream& operator<<(std::ostream& o, const wgpu::SwapChainDescriptor& desc) {
// For now only output attachment is possible.
- ASSERT(desc.usage == wgpu::TextureUsage::OutputAttachment);
- o << "OutputAttachment ";
+ ASSERT(desc.usage == wgpu::TextureUsage::RenderAttachment);
+ o << "RenderAttachment ";
o << desc.width << "x" << desc.height << " ";
// For now only BGRA is allowed
diff --git a/examples/SampleUtils.cpp b/examples/SampleUtils.cpp
index f1fbb6c..cab6cb0 100644
--- a/examples/SampleUtils.cpp
+++ b/examples/SampleUtils.cpp
@@ -188,7 +188,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::Depth24PlusStencil8;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment;
auto depthStencilTexture = device.CreateTexture(&descriptor);
return depthStencilTexture.CreateView();
}
diff --git a/src/dawn_native/CommandEncoder.cpp b/src/dawn_native/CommandEncoder.cpp
index 0fdded3..0df7870 100644
--- a/src/dawn_native/CommandEncoder.cpp
+++ b/src/dawn_native/CommandEncoder.cpp
@@ -543,11 +543,11 @@
cmd->colorAttachments[index].clearColor =
descriptor->colorAttachments[i].clearColor;
- usageTracker.TextureViewUsedAs(view, wgpu::TextureUsage::OutputAttachment);
+ usageTracker.TextureViewUsedAs(view, wgpu::TextureUsage::RenderAttachment);
if (resolveTarget != nullptr) {
usageTracker.TextureViewUsedAs(resolveTarget,
- wgpu::TextureUsage::OutputAttachment);
+ wgpu::TextureUsage::RenderAttachment);
}
}
@@ -568,7 +568,7 @@
cmd->depthStencilAttachment.stencilStoreOp =
descriptor->depthStencilAttachment->stencilStoreOp;
- usageTracker.TextureViewUsedAs(view, wgpu::TextureUsage::OutputAttachment);
+ usageTracker.TextureViewUsedAs(view, wgpu::TextureUsage::RenderAttachment);
}
cmd->width = width;
diff --git a/src/dawn_native/SwapChain.cpp b/src/dawn_native/SwapChain.cpp
index 965b4cb..b0e03ef 100644
--- a/src/dawn_native/SwapChain.cpp
+++ b/src/dawn_native/SwapChain.cpp
@@ -81,8 +81,8 @@
return DAWN_VALIDATION_ERROR("Format must (currently) be BGRA8Unorm");
}
- if (descriptor->usage != wgpu::TextureUsage::OutputAttachment) {
- return DAWN_VALIDATION_ERROR("Usage must (currently) be OutputAttachment");
+ if (descriptor->usage != wgpu::TextureUsage::RenderAttachment) {
+ return DAWN_VALIDATION_ERROR("Usage must (currently) be RenderAttachment");
}
if (descriptor->width == 0 || descriptor->height == 0) {
diff --git a/src/dawn_native/Texture.cpp b/src/dawn_native/Texture.cpp
index c46ae88..253541a 100644
--- a/src/dawn_native/Texture.cpp
+++ b/src/dawn_native/Texture.cpp
@@ -198,9 +198,9 @@
}
if (!format->isRenderable &&
- (descriptor->usage & wgpu::TextureUsage::OutputAttachment)) {
+ (descriptor->usage & wgpu::TextureUsage::RenderAttachment)) {
return DAWN_VALIDATION_ERROR(
- "Non-renderable format used with OutputAttachment usage");
+ "Non-renderable format used with RenderAttachment usage");
}
if (!format->supportsStorageUsage &&
diff --git a/src/dawn_native/Texture.h b/src/dawn_native/Texture.h
index 001f5d5..17e2dc1 100644
--- a/src/dawn_native/Texture.h
+++ b/src/dawn_native/Texture.h
@@ -71,7 +71,7 @@
static constexpr wgpu::TextureUsage kWritableTextureUsages =
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Storage |
- wgpu::TextureUsage::OutputAttachment;
+ wgpu::TextureUsage::RenderAttachment;
// Convert the TextureAspect to an Aspect mask for the format. ASSERTs if the aspect
// does not exist in the format.
diff --git a/src/dawn_native/d3d12/CommandBufferD3D12.cpp b/src/dawn_native/d3d12/CommandBufferD3D12.cpp
index 5b36200..ff8bec2 100644
--- a/src/dawn_native/d3d12/CommandBufferD3D12.cpp
+++ b/src/dawn_native/d3d12/CommandBufferD3D12.cpp
@@ -629,7 +629,7 @@
// Clear textures that are not output attachments. Output attachments will be
// cleared during record render pass if the texture subresource has not been
// initialized before the render pass.
- if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::OutputAttachment)) {
+ if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::RenderAttachment)) {
texture->EnsureSubresourceContentInitialized(commandContext,
texture->GetAllSubresources());
}
diff --git a/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp b/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp
index 328284d..c29ae72 100644
--- a/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp
+++ b/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp
@@ -29,7 +29,7 @@
if (allowedUsages & WGPUTextureUsage_Storage) {
usage |= DXGI_USAGE_UNORDERED_ACCESS;
}
- if (allowedUsages & WGPUTextureUsage_OutputAttachment) {
+ if (allowedUsages & WGPUTextureUsage_RenderAttachment) {
usage |= DXGI_USAGE_RENDER_TARGET_OUTPUT;
}
return usage;
diff --git a/src/dawn_native/d3d12/TextureD3D12.cpp b/src/dawn_native/d3d12/TextureD3D12.cpp
index e1eac4e..94b8053 100644
--- a/src/dawn_native/d3d12/TextureD3D12.cpp
+++ b/src/dawn_native/d3d12/TextureD3D12.cpp
@@ -56,7 +56,7 @@
if (usage & wgpu::TextureUsage::Storage) {
resourceState |= D3D12_RESOURCE_STATE_UNORDERED_ACCESS;
}
- if (usage & wgpu::TextureUsage::OutputAttachment) {
+ if (usage & wgpu::TextureUsage::RenderAttachment) {
if (format.HasDepthOrStencil()) {
resourceState |= D3D12_RESOURCE_STATE_DEPTH_WRITE;
} else {
@@ -79,7 +79,7 @@
// A multisampled resource must have either D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET or
// D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL set in D3D12_RESOURCE_DESC::Flags.
// https://docs.microsoft.com/en-us/windows/desktop/api/d3d12/ns-d3d12-d3d12_resource_desc
- if ((usage & wgpu::TextureUsage::OutputAttachment) != 0 || isMultisampledTexture) {
+ if ((usage & wgpu::TextureUsage::RenderAttachment) != 0 || isMultisampledTexture) {
if (format.HasDepthOrStencil()) {
flags |= D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
} else {
@@ -864,7 +864,7 @@
uint8_t clearColor = (clearValue == TextureBase::ClearValue::Zero) ? 0 : 1;
float fClearColor = (clearValue == TextureBase::ClearValue::Zero) ? 0.f : 1.f;
- if ((GetUsage() & wgpu::TextureUsage::OutputAttachment) != 0) {
+ if ((GetUsage() & wgpu::TextureUsage::RenderAttachment) != 0) {
if (GetFormat().HasDepthOrStencil()) {
TrackUsageAndTransitionNow(commandContext, D3D12_RESOURCE_STATE_DEPTH_WRITE, range);
diff --git a/src/dawn_native/metal/CommandBufferMTL.mm b/src/dawn_native/metal/CommandBufferMTL.mm
index 6f388aa..4e4156b 100644
--- a/src/dawn_native/metal/CommandBufferMTL.mm
+++ b/src/dawn_native/metal/CommandBufferMTL.mm
@@ -547,7 +547,7 @@
// Clear textures that are not output attachments. Output attachments will be
// cleared in CreateMTLRenderPassDescriptor by setting the loadop to clear when the
// texture subresource has not been initialized before the render pass.
- if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::OutputAttachment)) {
+ if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::RenderAttachment)) {
texture->EnsureSubresourceContentInitialized(texture->GetAllSubresources());
}
}
diff --git a/src/dawn_native/metal/SwapChainMTL.mm b/src/dawn_native/metal/SwapChainMTL.mm
index 7b0cbe2..512cd87 100644
--- a/src/dawn_native/metal/SwapChainMTL.mm
+++ b/src/dawn_native/metal/SwapChainMTL.mm
@@ -94,7 +94,7 @@
size.height = GetHeight();
[mLayer setDrawableSize:size];
- [mLayer setFramebufferOnly:(GetUsage() == wgpu::TextureUsage::OutputAttachment)];
+ [mLayer setFramebufferOnly:(GetUsage() == wgpu::TextureUsage::RenderAttachment)];
[mLayer setDevice:ToBackend(GetDevice())->GetMTLDevice()];
[mLayer setPixelFormat:MetalPixelFormat(GetFormat())];
diff --git a/src/dawn_native/metal/TextureMTL.mm b/src/dawn_native/metal/TextureMTL.mm
index 2e2f34f..57ead88 100644
--- a/src/dawn_native/metal/TextureMTL.mm
+++ b/src/dawn_native/metal/TextureMTL.mm
@@ -45,7 +45,7 @@
result |= MTLTextureUsageShaderRead;
}
- if (usage & (wgpu::TextureUsage::OutputAttachment)) {
+ if (usage & (wgpu::TextureUsage::RenderAttachment)) {
result |= MTLTextureUsageRenderTarget;
}
@@ -385,7 +385,7 @@
const uint8_t clearColor = (clearValue == TextureBase::ClearValue::Zero) ? 0 : 1;
const double dClearColor = (clearValue == TextureBase::ClearValue::Zero) ? 0.0 : 1.0;
- if ((GetUsage() & wgpu::TextureUsage::OutputAttachment) != 0) {
+ if ((GetUsage() & wgpu::TextureUsage::RenderAttachment) != 0) {
ASSERT(GetFormat().isRenderable);
// End the blit encoder if it is open.
diff --git a/src/dawn_native/opengl/CommandBufferGL.cpp b/src/dawn_native/opengl/CommandBufferGL.cpp
index 65dd9e0..d3a138f 100644
--- a/src/dawn_native/opengl/CommandBufferGL.cpp
+++ b/src/dawn_native/opengl/CommandBufferGL.cpp
@@ -445,7 +445,7 @@
// Clear textures that are not output attachments. Output attachments will be
// cleared in BeginRenderPass by setting the loadop to clear when the
// texture subresource has not been initialized before the render pass.
- if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::OutputAttachment)) {
+ if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::RenderAttachment)) {
texture->EnsureSubresourceContentInitialized(texture->GetAllSubresources());
}
}
diff --git a/src/dawn_native/vulkan/CommandBufferVk.cpp b/src/dawn_native/vulkan/CommandBufferVk.cpp
index 7b02f62..fe21095 100644
--- a/src/dawn_native/vulkan/CommandBufferVk.cpp
+++ b/src/dawn_native/vulkan/CommandBufferVk.cpp
@@ -519,7 +519,7 @@
// Clear textures that are not output attachments. Output attachments will be
// cleared in RecordBeginRenderPass by setting the loadop to clear when the
// texture subresource has not been initialized before the render pass.
- if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::OutputAttachment)) {
+ if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::RenderAttachment)) {
texture->EnsureSubresourceContentInitialized(recordingContext,
texture->GetAllSubresources());
}
diff --git a/src/dawn_native/vulkan/TextureVk.cpp b/src/dawn_native/vulkan/TextureVk.cpp
index db510f3..a708efd 100644
--- a/src/dawn_native/vulkan/TextureVk.cpp
+++ b/src/dawn_native/vulkan/TextureVk.cpp
@@ -71,7 +71,7 @@
if (usage & wgpu::TextureUsage::Storage) {
flags |= VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
}
- if (usage & wgpu::TextureUsage::OutputAttachment) {
+ if (usage & wgpu::TextureUsage::RenderAttachment) {
if (format.HasDepthOrStencil()) {
flags |= VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
@@ -130,7 +130,7 @@
case wgpu::TextureUsage::Storage:
case kReadonlyStorageTexture:
return VK_IMAGE_LAYOUT_GENERAL;
- case wgpu::TextureUsage::OutputAttachment:
+ case wgpu::TextureUsage::RenderAttachment:
if (format.HasDepthOrStencil()) {
return VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
} else {
@@ -168,7 +168,7 @@
flags |=
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
}
- if (usage & wgpu::TextureUsage::OutputAttachment) {
+ if (usage & wgpu::TextureUsage::RenderAttachment) {
if (format.HasDepthOrStencil()) {
flags |= VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT;
@@ -395,7 +395,7 @@
if (usage & wgpu::TextureUsage::Storage) {
flags |= VK_IMAGE_USAGE_STORAGE_BIT;
}
- if (usage & wgpu::TextureUsage::OutputAttachment) {
+ if (usage & wgpu::TextureUsage::RenderAttachment) {
if (format.HasDepthOrStencil()) {
flags |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
} else {
diff --git a/src/tests/BUILD.gn b/src/tests/BUILD.gn
index 7f821fc..474b663 100644
--- a/src/tests/BUILD.gn
+++ b/src/tests/BUILD.gn
@@ -311,7 +311,7 @@
"end2end/ScissorTests.cpp",
"end2end/ShaderFloat16Tests.cpp",
"end2end/StorageTextureTests.cpp",
- "end2end/SubresourceOutputAttachmentTests.cpp",
+ "end2end/SubresourceRenderAttachmentTests.cpp",
"end2end/TextureFormatTests.cpp",
"end2end/TextureSubresourceTests.cpp",
"end2end/TextureViewTests.cpp",
diff --git a/src/tests/end2end/BufferZeroInitTests.cpp b/src/tests/end2end/BufferZeroInitTests.cpp
index d14160c..7cb7990 100644
--- a/src/tests/end2end/BufferZeroInitTests.cpp
+++ b/src/tests/end2end/BufferZeroInitTests.cpp
@@ -91,7 +91,7 @@
descriptor.size = size;
descriptor.format = format;
descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc |
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::Storage;
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::Storage;
wgpu::Texture texture = device.CreateTexture(&descriptor);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
diff --git a/src/tests/end2end/ClipSpaceTests.cpp b/src/tests/end2end/ClipSpaceTests.cpp
index 33c78e9..cb58525 100644
--- a/src/tests/end2end/ClipSpaceTests.cpp
+++ b/src/tests/end2end/ClipSpaceTests.cpp
@@ -59,7 +59,7 @@
textureDescriptor.dimension = wgpu::TextureDimension::e2D;
textureDescriptor.format = format;
textureDescriptor.usage =
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
textureDescriptor.mipLevelCount = 1;
textureDescriptor.sampleCount = 1;
textureDescriptor.size = {kSize, kSize, 1};
diff --git a/src/tests/end2end/ColorStateTests.cpp b/src/tests/end2end/ColorStateTests.cpp
index b4f935d..9651b99 100644
--- a/src/tests/end2end/ColorStateTests.cpp
+++ b/src/tests/end2end/ColorStateTests.cpp
@@ -751,7 +751,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
for (uint32_t i = 0; i < 4; ++i) {
renderTargets[i] = device.CreateTexture(&descriptor);
diff --git a/src/tests/end2end/CreateReadyPipelineTests.cpp b/src/tests/end2end/CreateReadyPipelineTests.cpp
index a03443b..4d7fbe7 100644
--- a/src/tests/end2end/CreateReadyPipelineTests.cpp
+++ b/src/tests/end2end/CreateReadyPipelineTests.cpp
@@ -135,7 +135,7 @@
// Verify the basic use of CreateReadyRenderPipeline() works on all backends.
TEST_P(CreateReadyPipelineTest, BasicUseOfCreateReadyRenderPipeline) {
- constexpr wgpu::TextureFormat kOutputAttachmentFormat = wgpu::TextureFormat::RGBA8Unorm;
+ constexpr wgpu::TextureFormat kRenderAttachmentFormat = wgpu::TextureFormat::RGBA8Unorm;
const char* vertexShader = R"(
#version 450
@@ -157,7 +157,7 @@
utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, fragmentShader);
renderPipelineDescriptor.vertexStage.module = vsModule;
renderPipelineDescriptor.cFragmentStage.module = fsModule;
- renderPipelineDescriptor.cColorStates[0].format = kOutputAttachmentFormat;
+ renderPipelineDescriptor.cColorStates[0].format = kRenderAttachmentFormat;
renderPipelineDescriptor.primitiveTopology = wgpu::PrimitiveTopology::PointList;
device.CreateReadyRenderPipeline(
@@ -175,8 +175,8 @@
wgpu::TextureDescriptor textureDescriptor;
textureDescriptor.size = {1, 1, 1};
- textureDescriptor.format = kOutputAttachmentFormat;
- textureDescriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ textureDescriptor.format = kRenderAttachmentFormat;
+ textureDescriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
wgpu::Texture outputTexture = device.CreateTexture(&textureDescriptor);
utils::ComboRenderPassDescriptor renderPassDescriptor({outputTexture.CreateView()});
@@ -212,7 +212,7 @@
TEST_P(CreateReadyPipelineTest, CreateRenderPipelineFailed) {
DAWN_SKIP_TEST_IF(IsDawnValidationSkipped());
- constexpr wgpu::TextureFormat kOutputAttachmentFormat = wgpu::TextureFormat::Depth32Float;
+ constexpr wgpu::TextureFormat kRenderAttachmentFormat = wgpu::TextureFormat::Depth32Float;
const char* vertexShader = R"(
#version 450
@@ -234,7 +234,7 @@
utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, fragmentShader);
renderPipelineDescriptor.vertexStage.module = vsModule;
renderPipelineDescriptor.cFragmentStage.module = fsModule;
- renderPipelineDescriptor.cColorStates[0].format = kOutputAttachmentFormat;
+ renderPipelineDescriptor.cColorStates[0].format = kRenderAttachmentFormat;
renderPipelineDescriptor.primitiveTopology = wgpu::PrimitiveTopology::PointList;
device.CreateReadyRenderPipeline(
diff --git a/src/tests/end2end/CullingTests.cpp b/src/tests/end2end/CullingTests.cpp
index 726df13..cce3253 100644
--- a/src/tests/end2end/CullingTests.cpp
+++ b/src/tests/end2end/CullingTests.cpp
@@ -63,7 +63,7 @@
textureDescriptor.dimension = wgpu::TextureDimension::e2D;
textureDescriptor.format = format;
textureDescriptor.usage =
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
textureDescriptor.mipLevelCount = 1;
textureDescriptor.sampleCount = 1;
textureDescriptor.size = {kSize, kSize, 1};
diff --git a/src/tests/end2end/D3D12ResourceWrappingTests.cpp b/src/tests/end2end/D3D12ResourceWrappingTests.cpp
index a028319..003d011 100644
--- a/src/tests/end2end/D3D12ResourceWrappingTests.cpp
+++ b/src/tests/end2end/D3D12ResourceWrappingTests.cpp
@@ -65,7 +65,7 @@
baseDawnDescriptor.sampleCount = 1;
baseDawnDescriptor.mipLevelCount = 1;
baseDawnDescriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc |
- wgpu::TextureUsage::OutputAttachment |
+ wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::CopyDst;
baseD3dDescriptor.Width = kTestWidth;
diff --git a/src/tests/end2end/DepthBiasTests.cpp b/src/tests/end2end/DepthBiasTests.cpp
index 505e89d..e3ef7df 100644
--- a/src/tests/end2end/DepthBiasTests.cpp
+++ b/src/tests/end2end/DepthBiasTests.cpp
@@ -71,7 +71,7 @@
wgpu::TextureDescriptor descriptor;
descriptor.size = {kRTSize, kRTSize, 1};
descriptor.format = depthFormat;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
mDepthTexture = device.CreateTexture(&descriptor);
}
@@ -79,7 +79,7 @@
wgpu::TextureDescriptor descriptor;
descriptor.size = {kRTSize, kRTSize, 1};
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
mRenderTarget = device.CreateTexture(&descriptor);
}
diff --git a/src/tests/end2end/DepthSamplingTests.cpp b/src/tests/end2end/DepthSamplingTests.cpp
index 14d6d4f..df75ee2 100644
--- a/src/tests/end2end/DepthSamplingTests.cpp
+++ b/src/tests/end2end/DepthSamplingTests.cpp
@@ -50,14 +50,14 @@
mTextureUploadBuffer = device.CreateBuffer(&textureUploadDesc);
wgpu::TextureDescriptor inputTextureDesc;
- inputTextureDesc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment;
+ inputTextureDesc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment;
inputTextureDesc.size = {1, 1, 1};
inputTextureDesc.format = wgpu::TextureFormat::Depth32Float;
mInputTexture = device.CreateTexture(&inputTextureDesc);
wgpu::TextureDescriptor outputTextureDesc;
outputTextureDesc.usage =
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
outputTextureDesc.size = {1, 1, 1};
outputTextureDesc.format = wgpu::TextureFormat::R32Float;
mOutputTexture = device.CreateTexture(&outputTextureDesc);
diff --git a/src/tests/end2end/DepthStencilCopyTests.cpp b/src/tests/end2end/DepthStencilCopyTests.cpp
index bd8ceb7..9a60a9b 100644
--- a/src/tests/end2end/DepthStencilCopyTests.cpp
+++ b/src/tests/end2end/DepthStencilCopyTests.cpp
@@ -155,7 +155,7 @@
wgpu::TextureUsage usage,
uint32_t mipLevel = 0) {
wgpu::Texture src = CreateDepthStencilTexture(
- width, height, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc,
+ width, height, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc,
mipLevel + 1);
wgpu::Texture dst = CreateDepthStencilTexture(
@@ -193,7 +193,7 @@
wgpu::TextureDescriptor colorTexDesc = {};
colorTexDesc.size = {width, height, 1};
colorTexDesc.format = wgpu::TextureFormat::R32Uint;
- colorTexDesc.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ colorTexDesc.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
wgpu::Texture colorTexture = device.CreateTexture(&colorTexDesc);
// Make a sampleable texture to store the depth data. We'll sample this in the
@@ -306,7 +306,7 @@
constexpr uint32_t kHeight = 4;
wgpu::Texture depthTexture = CreateDepthTexture(
- kWidth, kHeight, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc);
+ kWidth, kHeight, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc);
InitializeDepthTextureRegion(depthTexture, 0.f, 0.3f);
@@ -327,7 +327,7 @@
constexpr uint32_t kHeight = 4;
wgpu::Texture depthStencilTexture = CreateDepthStencilTexture(
- kWidth, kHeight, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc);
+ kWidth, kHeight, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc);
InitializeDepthStencilTextureRegion(depthStencilTexture, 0.f, 0.3f, 0u, 1u);
@@ -349,7 +349,7 @@
DAWN_SKIP_TEST_IF(IsMetal() && IsIntel());
wgpu::Texture depthStencilTexture = CreateDepthStencilTexture(
- 9, 9, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc, 2);
+ 9, 9, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc, 2);
InitializeDepthStencilTextureRegion(depthStencilTexture, 0.f, 0.3f, 0u, 1u, 1u);
@@ -367,7 +367,7 @@
// Test copying the non-zero mip, depth-only aspect into a buffer.
TEST_P(DepthStencilCopyTests, FromNonZeroMipDepthAspect) {
wgpu::Texture depthTexture = CreateDepthTexture(
- 9, 9, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc, 2);
+ 9, 9, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc, 2);
InitializeDepthTextureRegion(depthTexture, 0.f, 0.4f, 1);
@@ -386,8 +386,8 @@
TEST_P(DepthStencilCopyTests, T2TBothAspectsThenCopyStencil) {
// TODO(enga): Figure out why this fails on MacOS Intel Iris.
// It passes on AMD Radeon Pro and Intel HD Graphics 630.
- // Maybe has to do with the OutputAttachment usage. Notably, a later test
- // T2TBothAspectsThenCopyNonRenderableStencil does not use OutputAttachment and works correctly.
+ // Maybe has to do with the RenderAttachment usage. Notably, a later test
+ // T2TBothAspectsThenCopyNonRenderableStencil does not use RenderAttachment and works correctly.
DAWN_SKIP_TEST_IF(IsMetal() && IsIntel());
constexpr uint32_t kWidth = 4;
@@ -395,7 +395,7 @@
wgpu::Texture texture = CreateInitializeDepthStencilTextureAndCopyT2T(
0.1f, 0.3f, 1u, 3u, kWidth, kHeight,
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::OutputAttachment);
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::RenderAttachment);
// Check the stencil
std::vector<uint8_t> expectedData = {
@@ -457,7 +457,7 @@
constexpr uint32_t kHeight = 4;
wgpu::Texture texture = CreateInitializeDepthStencilTextureAndCopyT2T(
- 0.1f, 0.3f, 1u, 3u, kWidth, kHeight, wgpu::TextureUsage::OutputAttachment);
+ 0.1f, 0.3f, 1u, 3u, kWidth, kHeight, wgpu::TextureUsage::RenderAttachment);
// Check the depth
ExpectDepthData(texture, wgpu::TextureFormat::Depth24PlusStencil8, kWidth, kHeight, 0,
@@ -472,7 +472,7 @@
// Test copying both aspects in a T2T copy, then copying only depth at a nonzero mip.
TEST_P(DepthStencilCopyTests, T2TBothAspectsThenCopyNonZeroMipDepth) {
wgpu::Texture texture = CreateInitializeDepthStencilTextureAndCopyT2T(
- 0.1f, 0.3f, 1u, 3u, 8, 8, wgpu::TextureUsage::OutputAttachment, 1);
+ 0.1f, 0.3f, 1u, 3u, 8, 8, wgpu::TextureUsage::RenderAttachment, 1);
// Check the depth
ExpectDepthData(texture, wgpu::TextureFormat::Depth24PlusStencil8, 4, 4, 1,
@@ -491,7 +491,7 @@
wgpu::Texture texture = CreateInitializeDepthStencilTextureAndCopyT2T(
0.1f, 0.3f, 1u, 3u, kWidth, kHeight,
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::OutputAttachment);
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::RenderAttachment);
// Check the stencil
std::vector<uint8_t> expectedData = {
@@ -527,7 +527,7 @@
wgpu::Texture texture = CreateInitializeDepthStencilTextureAndCopyT2T(
0.1f, 0.3f, 1u, 3u, kWidth, kHeight,
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::OutputAttachment);
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::RenderAttachment);
// Check the depth
ExpectDepthData(texture, wgpu::TextureFormat::Depth24PlusStencil8, kWidth, kHeight, 0,
@@ -568,7 +568,7 @@
wgpu::Texture depthStencilTexture =
CreateDepthStencilTexture(kWidth, kHeight,
- wgpu::TextureUsage::OutputAttachment |
+ wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst);
{
diff --git a/src/tests/end2end/DepthStencilStateTests.cpp b/src/tests/end2end/DepthStencilStateTests.cpp
index 5f5895a..bb614bf 100644
--- a/src/tests/end2end/DepthStencilStateTests.cpp
+++ b/src/tests/end2end/DepthStencilStateTests.cpp
@@ -34,7 +34,7 @@
renderTargetDescriptor.format = wgpu::TextureFormat::RGBA8Unorm;
renderTargetDescriptor.mipLevelCount = 1;
renderTargetDescriptor.usage =
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
renderTarget = device.CreateTexture(&renderTargetDescriptor);
renderTargetView = renderTarget.CreateView();
@@ -47,7 +47,7 @@
depthDescriptor.sampleCount = 1;
depthDescriptor.format = wgpu::TextureFormat::Depth24PlusStencil8;
depthDescriptor.mipLevelCount = 1;
- depthDescriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ depthDescriptor.usage = wgpu::TextureUsage::RenderAttachment;
depthTexture = device.CreateTexture(&depthDescriptor);
depthTextureView = depthTexture.CreateView();
diff --git a/src/tests/end2end/DeviceLostTests.cpp b/src/tests/end2end/DeviceLostTests.cpp
index caaacd4..57051a8 100644
--- a/src/tests/end2end/DeviceLostTests.cpp
+++ b/src/tests/end2end/DeviceLostTests.cpp
@@ -226,7 +226,7 @@
descriptor.size.depth = 1;
descriptor.mipLevelCount = 1;
descriptor.dimension = wgpu::TextureDimension::e2D;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment;
ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor));
}
diff --git a/src/tests/end2end/IOSurfaceWrappingTests.cpp b/src/tests/end2end/IOSurfaceWrappingTests.cpp
index ad025f3..1ae3fa0 100644
--- a/src/tests/end2end/IOSurfaceWrappingTests.cpp
+++ b/src/tests/end2end/IOSurfaceWrappingTests.cpp
@@ -123,7 +123,7 @@
descriptor.size = {10, 10, 1};
descriptor.sampleCount = 1;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment;
}
protected:
@@ -339,7 +339,7 @@
textureDescriptor.size = {1, 1, 1};
textureDescriptor.sampleCount = 1;
textureDescriptor.mipLevelCount = 1;
- textureDescriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ textureDescriptor.usage = wgpu::TextureUsage::RenderAttachment;
wgpu::Texture ioSurfaceTexture = WrapIOSurface(&textureDescriptor, ioSurface, 0);
wgpu::TextureView ioSurfaceView = ioSurfaceTexture.CreateView();
@@ -463,7 +463,7 @@
textureDescriptor.size = {1, 1, 1};
textureDescriptor.sampleCount = 1;
textureDescriptor.mipLevelCount = 1;
- textureDescriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ textureDescriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
// wrap ioSurface and ensure color is not visible when isInitialized set to false
wgpu::Texture ioSurfaceTexture = WrapIOSurface(&textureDescriptor, ioSurface.get(), 0, false);
diff --git a/src/tests/end2end/MultisampledRenderingTests.cpp b/src/tests/end2end/MultisampledRenderingTests.cpp
index 63f1eff..d7d7d05 100644
--- a/src/tests/end2end/MultisampledRenderingTests.cpp
+++ b/src/tests/end2end/MultisampledRenderingTests.cpp
@@ -27,12 +27,12 @@
}
void InitTexturesForTest() {
- mMultisampledColorTexture = CreateTextureForOutputAttachment(kColorFormat, kSampleCount);
+ mMultisampledColorTexture = CreateTextureForRenderAttachment(kColorFormat, kSampleCount);
mMultisampledColorView = mMultisampledColorTexture.CreateView();
- mResolveTexture = CreateTextureForOutputAttachment(kColorFormat, 1);
+ mResolveTexture = CreateTextureForRenderAttachment(kColorFormat, 1);
mResolveView = mResolveTexture.CreateView();
- mDepthStencilTexture = CreateTextureForOutputAttachment(kDepthStencilFormat, kSampleCount);
+ mDepthStencilTexture = CreateTextureForRenderAttachment(kDepthStencilFormat, kSampleCount);
mDepthStencilView = mDepthStencilTexture.CreateView();
}
@@ -89,7 +89,7 @@
alphaToCoverageEnabled);
}
- wgpu::Texture CreateTextureForOutputAttachment(wgpu::TextureFormat format,
+ wgpu::Texture CreateTextureForRenderAttachment(wgpu::TextureFormat format,
uint32_t sampleCount,
uint32_t mipLevelCount = 1,
uint32_t arrayLayerCount = 1) {
@@ -101,7 +101,7 @@
descriptor.sampleCount = sampleCount;
descriptor.format = format;
descriptor.mipLevelCount = mipLevelCount;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
return device.CreateTexture(&descriptor);
}
@@ -395,8 +395,8 @@
DAWN_SKIP_TEST_IF(IsD3D12() && IsNvidia() && IsBackendValidationEnabled());
wgpu::TextureView multisampledColorView2 =
- CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateView();
- wgpu::Texture resolveTexture2 = CreateTextureForOutputAttachment(kColorFormat, 1);
+ CreateTextureForRenderAttachment(kColorFormat, kSampleCount).CreateView();
+ wgpu::Texture resolveTexture2 = CreateTextureForRenderAttachment(kColorFormat, 1);
wgpu::TextureView resolveView2 = resolveTexture2.CreateView();
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
@@ -438,7 +438,7 @@
constexpr wgpu::Color kGreen = {0.0f, 0.8f, 0.0f, 0.8f};
- wgpu::Texture resolveTexture2 = CreateTextureForOutputAttachment(kColorFormat, 1);
+ wgpu::Texture resolveTexture2 = CreateTextureForRenderAttachment(kColorFormat, 1);
// In first render pass we draw a green triangle and specify mResolveView as the resolve target.
{
@@ -483,7 +483,7 @@
textureViewDescriptor.baseMipLevel = kBaseMipLevel;
wgpu::Texture resolveTexture =
- CreateTextureForOutputAttachment(kColorFormat, 1, kBaseMipLevel + 1, 1);
+ CreateTextureForRenderAttachment(kColorFormat, 1, kBaseMipLevel + 1, 1);
wgpu::TextureView resolveView = resolveTexture.CreateView(&textureViewDescriptor);
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
@@ -511,7 +511,7 @@
DAWN_SKIP_TEST_IF(IsD3D12() && IsNvidia() && IsBackendValidationEnabled());
wgpu::TextureView multisampledColorView2 =
- CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateView();
+ CreateTextureForRenderAttachment(kColorFormat, kSampleCount).CreateView();
wgpu::TextureViewDescriptor baseTextureViewDescriptor;
baseTextureViewDescriptor.dimension = wgpu::TextureViewDimension::e2D;
@@ -523,7 +523,7 @@
constexpr uint32_t kBaseArrayLayer1 = 2;
constexpr uint32_t kBaseMipLevel1 = 0;
wgpu::Texture resolveTexture1 =
- CreateTextureForOutputAttachment(kColorFormat, 1, kBaseMipLevel1 + 1, kBaseArrayLayer1 + 1);
+ CreateTextureForRenderAttachment(kColorFormat, 1, kBaseMipLevel1 + 1, kBaseArrayLayer1 + 1);
wgpu::TextureViewDescriptor resolveViewDescriptor1 = baseTextureViewDescriptor;
resolveViewDescriptor1.baseArrayLayer = kBaseArrayLayer1;
resolveViewDescriptor1.baseMipLevel = kBaseMipLevel1;
@@ -534,7 +534,7 @@
constexpr uint32_t kBaseArrayLayer2 = 5;
constexpr uint32_t kBaseMipLevel2 = 3;
wgpu::Texture resolveTexture2 =
- CreateTextureForOutputAttachment(kColorFormat, 1, kBaseMipLevel2 + 1, kBaseArrayLayer2 + 1);
+ CreateTextureForRenderAttachment(kColorFormat, 1, kBaseMipLevel2 + 1, kBaseArrayLayer2 + 1);
wgpu::TextureViewDescriptor resolveViewDescriptor2 = baseTextureViewDescriptor;
resolveViewDescriptor2.baseArrayLayer = kBaseArrayLayer2;
resolveViewDescriptor2.baseMipLevel = kBaseMipLevel2;
@@ -629,8 +629,8 @@
// mask.
TEST_P(MultisampledRenderingTest, ResolveIntoMultipleResolveTargetsWithSampleMask) {
wgpu::TextureView multisampledColorView2 =
- CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateView();
- wgpu::Texture resolveTexture2 = CreateTextureForOutputAttachment(kColorFormat, 1);
+ CreateTextureForRenderAttachment(kColorFormat, kSampleCount).CreateView();
+ wgpu::Texture resolveTexture2 = CreateTextureForRenderAttachment(kColorFormat, 1);
wgpu::TextureView resolveView2 = resolveTexture2.CreateView();
// The first and fourth samples are included,
@@ -774,8 +774,8 @@
// shader-output mask.
TEST_P(MultisampledRenderingTest, ResolveIntoMultipleResolveTargetsWithShaderOutputMask) {
wgpu::TextureView multisampledColorView2 =
- CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateView();
- wgpu::Texture resolveTexture2 = CreateTextureForOutputAttachment(kColorFormat, 1);
+ CreateTextureForRenderAttachment(kColorFormat, kSampleCount).CreateView();
+ wgpu::Texture resolveTexture2 = CreateTextureForRenderAttachment(kColorFormat, 1);
wgpu::TextureView resolveView2 = resolveTexture2.CreateView();
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
@@ -871,8 +871,8 @@
// component of the first color output attachment.
TEST_P(MultisampledRenderingTest, ResolveIntoMultipleResolveTargetsWithAlphaToCoverage) {
wgpu::TextureView multisampledColorView2 =
- CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateView();
- wgpu::Texture resolveTexture2 = CreateTextureForOutputAttachment(kColorFormat, 1);
+ CreateTextureForRenderAttachment(kColorFormat, kSampleCount).CreateView();
+ wgpu::Texture resolveTexture2 = CreateTextureForRenderAttachment(kColorFormat, 1);
wgpu::TextureView resolveView2 = resolveTexture2.CreateView();
constexpr uint32_t kSampleMask = 0xFFFFFFFF;
constexpr float kMSAACoverage = 0.50f;
diff --git a/src/tests/end2end/MultisampledSamplingTests.cpp b/src/tests/end2end/MultisampledSamplingTests.cpp
index 244c673..1e72857 100644
--- a/src/tests/end2end/MultisampledSamplingTests.cpp
+++ b/src/tests/end2end/MultisampledSamplingTests.cpp
@@ -131,7 +131,7 @@
wgpu::Texture colorTexture;
{
wgpu::TextureDescriptor desc = {};
- desc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment;
+ desc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment;
desc.size = kTextureSize;
desc.format = kColorFormat;
desc.sampleCount = kSampleCount;
@@ -141,7 +141,7 @@
wgpu::Texture depthTexture;
{
wgpu::TextureDescriptor desc = {};
- desc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment;
+ desc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment;
desc.size = kTextureSize;
desc.format = kDepthFormat;
desc.sampleCount = kSampleCount;
diff --git a/src/tests/end2end/NonzeroTextureCreationTests.cpp b/src/tests/end2end/NonzeroTextureCreationTests.cpp
index eba13f3..2e574cc 100644
--- a/src/tests/end2end/NonzeroTextureCreationTests.cpp
+++ b/src/tests/end2end/NonzeroTextureCreationTests.cpp
@@ -37,7 +37,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
wgpu::Texture texture = device.CreateTexture(&descriptor);
RGBA8 filled(255, 255, 255, 255);
@@ -56,7 +56,7 @@
descriptor.size.depth = 1;
descriptor.sampleCount = 1;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
descriptor.format = wgpu::TextureFormat::Depth32Float;
// We can only really test Depth32Float here because Depth24Plus(Stencil8)? may be in an unknown
@@ -79,7 +79,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = mipLevels;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
wgpu::Texture texture = device.CreateTexture(&descriptor);
std::vector<RGBA8> expected;
@@ -103,7 +103,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
wgpu::Texture texture = device.CreateTexture(&descriptor);
std::vector<RGBA8> expected;
@@ -192,7 +192,7 @@
baseDescriptor.sampleCount = 1;
baseDescriptor.format = wgpu::TextureFormat::RGBA8Unorm;
baseDescriptor.mipLevelCount = 1;
- baseDescriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ baseDescriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
RGBA8 filled(255, 255, 255, 255);
diff --git a/src/tests/end2end/RenderPassLoadOpTests.cpp b/src/tests/end2end/RenderPassLoadOpTests.cpp
index ee8dcd0..645ccb5 100644
--- a/src/tests/end2end/RenderPassLoadOpTests.cpp
+++ b/src/tests/end2end/RenderPassLoadOpTests.cpp
@@ -64,7 +64,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
renderTarget = device.CreateTexture(&descriptor);
renderTargetView = renderTarget.CreateView();
@@ -105,7 +105,7 @@
textureDescriptor.dimension = wgpu::TextureDimension::e2D;
textureDescriptor.size = kTextureSize;
textureDescriptor.usage =
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
textureDescriptor.format = format;
wgpu::Texture texture = device.CreateTexture(&textureDescriptor);
diff --git a/src/tests/end2end/RenderPassTests.cpp b/src/tests/end2end/RenderPassTests.cpp
index 427de70..cc32577 100644
--- a/src/tests/end2end/RenderPassTests.cpp
+++ b/src/tests/end2end/RenderPassTests.cpp
@@ -60,7 +60,7 @@
descriptor.sampleCount = 1;
descriptor.format = kFormat;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
return device.CreateTexture(&descriptor);
}
diff --git a/src/tests/end2end/StorageTextureTests.cpp b/src/tests/end2end/StorageTextureTests.cpp
index 441ec0f..6e6a97f 100644
--- a/src/tests/end2end/StorageTextureTests.cpp
+++ b/src/tests/end2end/StorageTextureTests.cpp
@@ -495,7 +495,7 @@
utils::ComboRenderPipelineDescriptor desc(device);
desc.vertexStage.module = vsModule;
desc.cFragmentStage.module = fsModule;
- desc.cColorStates[0].format = kOutputAttachmentFormat;
+ desc.cColorStates[0].format = kRenderAttachmentFormat;
desc.primitiveTopology = wgpu::PrimitiveTopology::PointList;
return device.CreateRenderPipeline(&desc);
}
@@ -509,8 +509,8 @@
// Clear the output attachment to red at the beginning of the render pass.
wgpu::Texture outputTexture =
- CreateTexture(kOutputAttachmentFormat,
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc, 1, 1);
+ CreateTexture(kRenderAttachmentFormat,
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc, 1, 1);
utils::ComboRenderPassDescriptor renderPassDescriptor({outputTexture.CreateView()});
renderPassDescriptor.cColorAttachments[0].loadOp = wgpu::LoadOp::Clear;
renderPassDescriptor.cColorAttachments[0].clearColor = {1.f, 0.f, 0.f, 1.f};
@@ -570,8 +570,8 @@
// TODO(jiawei.shao@intel.com): remove the output attachment when Dawn supports beginning a
// render pass with no attachments.
wgpu::Texture dummyOutputTexture =
- CreateTexture(kOutputAttachmentFormat,
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc, 1, 1);
+ CreateTexture(kRenderAttachmentFormat,
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc, 1, 1);
utils::ComboRenderPassDescriptor renderPassDescriptor({dummyOutputTexture.CreateView()});
wgpu::RenderPassEncoder renderPassEncoder = encoder.BeginRenderPass(&renderPassDescriptor);
renderPassEncoder.SetBindGroup(0, bindGroup);
@@ -660,7 +660,7 @@
static constexpr size_t kWidth = 4u;
static constexpr size_t kHeight = 4u;
- static constexpr wgpu::TextureFormat kOutputAttachmentFormat = wgpu::TextureFormat::RGBA8Unorm;
+ static constexpr wgpu::TextureFormat kRenderAttachmentFormat = wgpu::TextureFormat::RGBA8Unorm;
const char* kSimpleVertexShader = R"(
#version 450
diff --git a/src/tests/end2end/SubresourceOutputAttachmentTests.cpp b/src/tests/end2end/SubresourceRenderAttachmentTests.cpp
similarity index 94%
rename from src/tests/end2end/SubresourceOutputAttachmentTests.cpp
rename to src/tests/end2end/SubresourceRenderAttachmentTests.cpp
index ff45abc..f3dd0ec 100644
--- a/src/tests/end2end/SubresourceOutputAttachmentTests.cpp
+++ b/src/tests/end2end/SubresourceRenderAttachmentTests.cpp
@@ -19,7 +19,7 @@
#include "utils/WGPUHelpers.h"
// Test that rendering to a subresource of a texture works.
-class SubresourceOutputAttachmentTest : public DawnTest {
+class SubresourceRenderAttachmentTest : public DawnTest {
constexpr static uint32_t kRTSize = 2;
protected:
@@ -125,7 +125,7 @@
renderTargetDesc.sampleCount = 1;
renderTargetDesc.format = format;
renderTargetDesc.mipLevelCount = kMipLevelCount;
- renderTargetDesc.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ renderTargetDesc.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
wgpu::Texture renderTarget = device.CreateTexture(&renderTargetDesc);
@@ -139,22 +139,22 @@
};
// Test rendering into a subresource of a color texture
-TEST_P(SubresourceOutputAttachmentTest, ColorTexture) {
+TEST_P(SubresourceRenderAttachmentTest, ColorTexture) {
DoTest(Type::Color);
}
// Test rendering into a subresource of a depth texture
-TEST_P(SubresourceOutputAttachmentTest, DepthTexture) {
+TEST_P(SubresourceRenderAttachmentTest, DepthTexture) {
DoTest(Type::Depth);
}
// Test rendering into a subresource of a stencil texture
// TODO(crbug.com/dawn/439): sample / copy of the stencil aspect.
-TEST_P(SubresourceOutputAttachmentTest, DISABLED_StencilTexture) {
+TEST_P(SubresourceRenderAttachmentTest, DISABLED_StencilTexture) {
DoTest(Type::Stencil);
}
-DAWN_INSTANTIATE_TEST(SubresourceOutputAttachmentTest,
+DAWN_INSTANTIATE_TEST(SubresourceRenderAttachmentTest,
D3D12Backend(),
D3D12Backend({}, {"use_d3d12_render_pass"}),
MetalBackend(),
diff --git a/src/tests/end2end/SwapChainTests.cpp b/src/tests/end2end/SwapChainTests.cpp
index 2a4cd93..383a477 100644
--- a/src/tests/end2end/SwapChainTests.cpp
+++ b/src/tests/end2end/SwapChainTests.cpp
@@ -53,7 +53,7 @@
baseDescriptor.width = width;
baseDescriptor.height = height;
- baseDescriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ baseDescriptor.usage = wgpu::TextureUsage::RenderAttachment;
baseDescriptor.format = wgpu::TextureFormat::BGRA8Unorm;
baseDescriptor.presentMode = wgpu::PresentMode::Mailbox;
}
diff --git a/src/tests/end2end/SwapChainValidationTests.cpp b/src/tests/end2end/SwapChainValidationTests.cpp
index e5c6cc2..bb87994 100644
--- a/src/tests/end2end/SwapChainValidationTests.cpp
+++ b/src/tests/end2end/SwapChainValidationTests.cpp
@@ -46,7 +46,7 @@
goodDescriptor.width = 1;
goodDescriptor.height = 1;
- goodDescriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ goodDescriptor.usage = wgpu::TextureUsage::RenderAttachment;
goodDescriptor.format = wgpu::TextureFormat::BGRA8Unorm;
goodDescriptor.presentMode = wgpu::PresentMode::Mailbox;
@@ -69,12 +69,12 @@
wgpu::SwapChainDescriptor goodDescriptor;
wgpu::SwapChainDescriptor badDescriptor;
- // Checks that an OutputAttachment view is an error by trying to create a render pass on it.
+ // Checks that an RenderAttachment view is an error by trying to create a render pass on it.
void CheckTextureViewIsError(wgpu::TextureView view) {
CheckTextureView(view, true, false);
}
- // Checks that an OutputAttachment view is an error by trying to submit a render pass on it.
+ // Checks that an RenderAttachment view is an error by trying to submit a render pass on it.
void CheckTextureViewIsDestroyed(wgpu::TextureView view) {
CheckTextureView(view, false, true);
}
@@ -149,7 +149,7 @@
}
}
-// Checks that the creation usage must be OutputAttachment
+// Checks that the creation usage must be RenderAttachment
TEST_P(SwapChainValidationTests, InvalidCreationUsage) {
wgpu::SwapChainDescriptor desc = goodDescriptor;
desc.usage = wgpu::TextureUsage::Sampled;
@@ -245,7 +245,7 @@
// Create a second texture to be used as render pass attachment. Validation will check that the
// size of the view matches the size of this texture.
wgpu::TextureDescriptor textureDesc;
- textureDesc.usage = wgpu::TextureUsage::OutputAttachment;
+ textureDesc.usage = wgpu::TextureUsage::RenderAttachment;
textureDesc.dimension = wgpu::TextureDimension::e2D;
textureDesc.size = {1, 1, 1};
textureDesc.format = wgpu::TextureFormat::R8Unorm;
@@ -257,7 +257,7 @@
wgpu::TextureView view = swapchain.GetCurrentTextureView();
// Validation will also check the dimension of the view is 2D, and it's usage contains
- // OutputAttachment
+ // RenderAttachment
utils::ComboRenderPassDescriptor renderPassDesc({view, secondTexture.CreateView()});
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc);
diff --git a/src/tests/end2end/TextureFormatTests.cpp b/src/tests/end2end/TextureFormatTests.cpp
index b67ff08..1055267 100644
--- a/src/tests/end2end/TextureFormatTests.cpp
+++ b/src/tests/end2end/TextureFormatTests.cpp
@@ -215,7 +215,7 @@
ASSERT(expectedRenderDataSize == width * renderFormatInfo.texelByteSize);
wgpu::TextureDescriptor renderTargetDesc;
- renderTargetDesc.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::OutputAttachment;
+ renderTargetDesc.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::RenderAttachment;
renderTargetDesc.size = {width, 1, 1};
renderTargetDesc.format = renderFormatInfo.format;
diff --git a/src/tests/end2end/TextureSubresourceTests.cpp b/src/tests/end2end/TextureSubresourceTests.cpp
index 27c9617..aa6a5fa 100644
--- a/src/tests/end2end/TextureSubresourceTests.cpp
+++ b/src/tests/end2end/TextureSubresourceTests.cpp
@@ -140,7 +140,7 @@
// Create a texture with 2 mipmap levels and 1 layer
wgpu::Texture texture =
CreateTexture(2, 1,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment |
+ wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::CopySrc);
// Create two views on different mipmap levels.
@@ -166,7 +166,7 @@
// Create a texture with 1 mipmap level and 2 layers
wgpu::Texture texture =
CreateTexture(1, 2,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment |
+ wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::CopySrc);
// Create two views on different layers
diff --git a/src/tests/end2end/TextureViewTests.cpp b/src/tests/end2end/TextureViewTests.cpp
index b501b3e..597ce35 100644
--- a/src/tests/end2end/TextureViewTests.cpp
+++ b/src/tests/end2end/TextureViewTests.cpp
@@ -462,7 +462,7 @@
ASSERT_LT(textureViewBaseLevel, levelCount);
constexpr wgpu::TextureUsage kUsage =
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
wgpu::Texture texture = Create2DTexture(device, textureWidthLevel0, textureHeightLevel0,
layerCount, levelCount, kUsage);
diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp
index 55a45d6..bb9231b 100644
--- a/src/tests/end2end/TextureZeroInitTests.cpp
+++ b/src/tests/end2end/TextureZeroInitTests.cpp
@@ -123,7 +123,7 @@
// This tests that the code path of CopyTextureToBuffer clears correctly to Zero after first usage
TEST_P(TextureZeroInitTest, CopyTextureToBufferSource) {
wgpu::TextureDescriptor descriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc, kColorFormat);
+ 1, 1, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc, kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
// Texture's first usage is in EXPECT_PIXEL_RGBA8_EQ's call to CopyTextureToBuffer
@@ -140,7 +140,7 @@
constexpr uint32_t kArrayLayers = 6u;
const wgpu::TextureDescriptor descriptor = CreateTextureDescriptor(
- 1, kArrayLayers, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc,
+ 1, kArrayLayers, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc,
kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
@@ -183,7 +183,7 @@
uint32_t layerCount = 1;
wgpu::TextureDescriptor descriptor = CreateTextureDescriptor(
- levelCount, layerCount, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc,
+ levelCount, layerCount, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc,
kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
@@ -228,7 +228,7 @@
uint32_t layerCount = 4;
wgpu::TextureDescriptor descriptor = CreateTextureDescriptor(
- levelCount, layerCount, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc,
+ levelCount, layerCount, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc,
kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
@@ -374,7 +374,7 @@
wgpu::TextureDescriptor dstDescriptor =
CreateTextureDescriptor(1, 1,
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopyDst |
wgpu::TextureUsage::CopySrc,
kColorFormat);
wgpu::Texture dstTexture = device.CreateTexture(&dstDescriptor);
@@ -429,7 +429,7 @@
wgpu::TextureDescriptor dstDescriptor =
CreateTextureDescriptor(1, 1,
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopyDst |
wgpu::TextureUsage::CopySrc,
kColorFormat);
wgpu::Texture dstTexture = device.CreateTexture(&dstDescriptor);
@@ -462,12 +462,12 @@
wgpu::TextureDescriptor srcDescriptor =
CreateTextureDescriptor(1, 1,
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
- wgpu::TextureUsage::OutputAttachment,
+ wgpu::TextureUsage::RenderAttachment,
kColorFormat);
wgpu::Texture srcTexture = device.CreateTexture(&srcDescriptor);
wgpu::TextureDescriptor depthStencilDescriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc,
+ 1, 1, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc,
kDepthStencilFormat);
wgpu::Texture depthStencilTexture = device.CreateTexture(&depthStencilDescriptor);
@@ -504,12 +504,12 @@
wgpu::TextureDescriptor srcDescriptor =
CreateTextureDescriptor(1, 1,
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
- wgpu::TextureUsage::OutputAttachment,
+ wgpu::TextureUsage::RenderAttachment,
kColorFormat);
wgpu::Texture srcTexture = device.CreateTexture(&srcDescriptor);
wgpu::TextureDescriptor depthStencilDescriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc,
+ 1, 1, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc,
kDepthStencilFormat);
wgpu::Texture depthStencilTexture = device.CreateTexture(&depthStencilDescriptor);
@@ -546,12 +546,12 @@
wgpu::TextureDescriptor srcDescriptor =
CreateTextureDescriptor(1, 1,
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
- wgpu::TextureUsage::OutputAttachment,
+ wgpu::TextureUsage::RenderAttachment,
kColorFormat);
wgpu::Texture srcTexture = device.CreateTexture(&srcDescriptor);
wgpu::TextureDescriptor depthStencilDescriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc,
+ 1, 1, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc,
kDepthStencilFormat);
wgpu::Texture depthStencilTexture = device.CreateTexture(&depthStencilDescriptor);
@@ -585,7 +585,7 @@
DAWN_SKIP_TEST_IF(IsMetal() && IsIntel());
wgpu::TextureDescriptor depthStencilDescriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc,
+ 1, 1, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc,
kDepthStencilFormat);
wgpu::Texture depthStencilTexture = device.CreateTexture(&depthStencilDescriptor);
@@ -620,7 +620,7 @@
wgpu::TextureDescriptor colorDescriptor =
CreateTextureDescriptor(1, 1,
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
- wgpu::TextureUsage::OutputAttachment,
+ wgpu::TextureUsage::RenderAttachment,
kColorFormat);
wgpu::Texture colorTexture = device.CreateTexture(&colorDescriptor);
@@ -694,7 +694,7 @@
wgpu::TextureDescriptor colorDescriptor =
CreateTextureDescriptor(1, 1,
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
- wgpu::TextureUsage::OutputAttachment,
+ wgpu::TextureUsage::RenderAttachment,
kColorFormat);
wgpu::Texture colorTexture = device.CreateTexture(&colorDescriptor);
@@ -747,7 +747,7 @@
DAWN_SKIP_TEST_IF(IsMetal() && IsIntel());
wgpu::TextureDescriptor depthStencilDescriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc,
+ 1, 1, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc,
kDepthStencilFormat);
wgpu::Texture depthStencilTexture = device.CreateTexture(&depthStencilDescriptor);
@@ -792,7 +792,7 @@
wgpu::TextureDescriptor colorDescriptor =
CreateTextureDescriptor(1, 1,
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
- wgpu::TextureUsage::OutputAttachment,
+ wgpu::TextureUsage::RenderAttachment,
kColorFormat);
wgpu::Texture colorTexture = device.CreateTexture(&colorDescriptor);
@@ -820,7 +820,7 @@
// This tests the color attachments clear to 0s
TEST_P(TextureZeroInitTest, ColorAttachmentsClear) {
wgpu::TextureDescriptor descriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc, kColorFormat);
+ 1, 1, wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc, kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
utils::BasicRenderPass renderPass = utils::BasicRenderPass(kSize, kSize, texture, kColorFormat);
renderPass.renderPassInfo.cColorAttachments[0].loadOp = wgpu::LoadOp::Load;
@@ -848,7 +848,7 @@
wgpu::Texture texture = device.CreateTexture(&descriptor);
wgpu::TextureDescriptor renderTextureDescriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::OutputAttachment, kColorFormat);
+ 1, 1, wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::RenderAttachment, kColorFormat);
wgpu::Texture renderTexture = device.CreateTexture(&renderTextureDescriptor);
wgpu::SamplerDescriptor samplerDesc = utils::GetDefaultSamplerDescriptor();
@@ -1053,7 +1053,7 @@
wgpu::Texture texture = device.CreateTexture(&descriptor);
wgpu::TextureDescriptor renderTextureDescriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::OutputAttachment, kColorFormat);
+ 1, 1, wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::RenderAttachment, kColorFormat);
wgpu::Texture renderTexture = device.CreateTexture(&renderTextureDescriptor);
wgpu::SamplerDescriptor samplerDesc = utils::GetDefaultSamplerDescriptor();
@@ -1121,13 +1121,13 @@
wgpu::TextureDescriptor srcDescriptor =
CreateTextureDescriptor(1, 1,
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
- wgpu::TextureUsage::OutputAttachment,
+ wgpu::TextureUsage::RenderAttachment,
kColorFormat);
wgpu::Texture srcTexture = device.CreateTexture(&srcDescriptor);
wgpu::TextureDescriptor depthStencilDescriptor =
CreateTextureDescriptor(1, 1,
- wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc |
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc |
wgpu::TextureUsage::CopyDst,
kDepthStencilFormat);
wgpu::Texture depthStencilTexture = device.CreateTexture(&depthStencilDescriptor);
@@ -1203,7 +1203,7 @@
wgpu::Sampler sampler = device.CreateSampler(&samplerDesc);
wgpu::TextureDescriptor renderTextureDescriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::OutputAttachment, kColorFormat);
+ 1, 1, wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::RenderAttachment, kColorFormat);
wgpu::Texture renderTexture = device.CreateTexture(&renderTextureDescriptor);
// Fill the sample texture's second mip with data
@@ -1282,7 +1282,7 @@
wgpu::Sampler sampler = device.CreateSampler(&samplerDesc);
wgpu::TextureDescriptor renderTextureDescriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::OutputAttachment, kColorFormat);
+ 1, 1, wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::RenderAttachment, kColorFormat);
wgpu::Texture renderTexture = device.CreateTexture(&renderTextureDescriptor);
// Fill the sample texture's second array layer with data
diff --git a/src/tests/end2end/ViewportTests.cpp b/src/tests/end2end/ViewportTests.cpp
index bc1ca4f..2b35e28 100644
--- a/src/tests/end2end/ViewportTests.cpp
+++ b/src/tests/end2end/ViewportTests.cpp
@@ -113,7 +113,7 @@
wgpu::TextureDescriptor depthDesc;
depthDesc.size = {3, 1, 1};
depthDesc.format = wgpu::TextureFormat::Depth32Float;
- depthDesc.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ depthDesc.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
wgpu::Texture depthTexture = device.CreateTexture(&depthDesc);
// Render the three points with the viewport call.
diff --git a/src/tests/perf_tests/DrawCallPerf.cpp b/src/tests/perf_tests/DrawCallPerf.cpp
index 1b1fe58..bc7927b 100644
--- a/src/tests/perf_tests/DrawCallPerf.cpp
+++ b/src/tests/perf_tests/DrawCallPerf.cpp
@@ -285,7 +285,7 @@
descriptor.size.width = kTextureSize;
descriptor.size.height = kTextureSize;
descriptor.size.depth = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
mColorAttachment = device.CreateTexture(&descriptor).CreateView();
diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp
index 28d54e4..8b9994d 100644
--- a/src/tests/unittests/validation/BindGroupValidationTests.cpp
+++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp
@@ -287,7 +287,7 @@
// Make an output attachment texture and try to set it for a SampledTexture binding
wgpu::Texture outputTexture =
- CreateTexture(wgpu::TextureUsage::OutputAttachment, wgpu::TextureFormat::RGBA8Unorm, 1);
+ CreateTexture(wgpu::TextureUsage::RenderAttachment, wgpu::TextureFormat::RGBA8Unorm, 1);
wgpu::TextureView outputTextureView = outputTexture.CreateView();
ASSERT_DEVICE_ERROR(utils::MakeBindGroup(device, layout, {{0, outputTextureView}}));
}
diff --git a/src/tests/unittests/validation/CopyCommandsValidationTests.cpp b/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
index b0c6ee7..c91cb8d 100644
--- a/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
+++ b/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
@@ -800,7 +800,7 @@
wgpu::Texture destination =
Create2DTexture(16, 16, 1, 1, wgpu::TextureFormat::Depth24PlusStencil8,
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::OutputAttachment);
+ wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment);
TestB2TCopy(utils::Expectation::Failure, source, 0, 256, 0, destination, 0, {0, 0, 0},
{15, 15, 1}, wgpu::TextureAspect::StencilOnly);
@@ -817,7 +817,7 @@
wgpu::Texture destination =
Create2DTexture(16, 16, 2, 1, wgpu::TextureFormat::Depth24PlusStencil8,
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::OutputAttachment);
+ wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment);
// Whole mip is success
TestB2TCopy(utils::Expectation::Success, source, 0, 256, 0, destination, 1, {0, 0, 0},
@@ -839,7 +839,7 @@
wgpu::Texture destination =
Create2DTexture(17, 17, 2, 1, wgpu::TextureFormat::Depth24PlusStencil8,
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::OutputAttachment);
+ wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment);
// Whole mip is success
TestB2TCopy(utils::Expectation::Success, source, 0, 256, 0, destination, 1, {0, 0, 0},
diff --git a/src/tests/unittests/validation/RenderBundleValidationTests.cpp b/src/tests/unittests/validation/RenderBundleValidationTests.cpp
index 4e372e9..2d73112 100644
--- a/src/tests/unittests/validation/RenderBundleValidationTests.cpp
+++ b/src/tests/unittests/validation/RenderBundleValidationTests.cpp
@@ -851,7 +851,7 @@
wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish();
wgpu::TextureDescriptor textureDesc = {};
- textureDesc.usage = wgpu::TextureUsage::OutputAttachment;
+ textureDesc.usage = wgpu::TextureUsage::RenderAttachment;
textureDesc.size = wgpu::Extent3D({400, 400, 1});
textureDesc.format = wgpu::TextureFormat::RGBA8Unorm;
@@ -921,7 +921,7 @@
wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish();
wgpu::TextureDescriptor textureDesc = {};
- textureDesc.usage = wgpu::TextureUsage::OutputAttachment;
+ textureDesc.usage = wgpu::TextureUsage::RenderAttachment;
textureDesc.size = wgpu::Extent3D({400, 400, 1});
textureDesc.format = wgpu::TextureFormat::RGBA8Unorm;
@@ -978,7 +978,7 @@
wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish();
wgpu::TextureDescriptor textureDesc = {};
- textureDesc.usage = wgpu::TextureUsage::OutputAttachment;
+ textureDesc.usage = wgpu::TextureUsage::RenderAttachment;
textureDesc.size = wgpu::Extent3D({400, 400, 1});
textureDesc.format = wgpu::TextureFormat::RGBA8Unorm;
diff --git a/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp b/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp
index 277c12e..7983c7e 100644
--- a/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp
+++ b/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp
@@ -50,7 +50,7 @@
uint32_t arrayLayerCount,
uint32_t mipLevelCount,
uint32_t sampleCount = 1,
- wgpu::TextureUsage usage = wgpu::TextureUsage::OutputAttachment) {
+ wgpu::TextureUsage usage = wgpu::TextureUsage::RenderAttachment) {
wgpu::TextureDescriptor descriptor;
descriptor.dimension = dimension;
descriptor.size.width = width;
@@ -548,8 +548,8 @@
}
// It is not allowed to use a resolve target which is created from a texture whose usage does
- // not include wgpu::TextureUsage::OutputAttachment.
- TEST_F(MultisampledRenderPassDescriptorValidationTest, ResolveTargetUsageNoOutputAttachment) {
+ // not include wgpu::TextureUsage::RenderAttachment.
+ TEST_F(MultisampledRenderPassDescriptorValidationTest, ResolveTargetUsageNoRenderAttachment) {
constexpr wgpu::TextureUsage kUsage =
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc;
wgpu::Texture nonColorUsageResolveTexture =
diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp
index 13c316e..8c81f5b 100644
--- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp
+++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp
@@ -229,7 +229,7 @@
baseTextureDescriptor.size.depth = 1;
baseTextureDescriptor.mipLevelCount = 1;
baseTextureDescriptor.dimension = wgpu::TextureDimension::e2D;
- baseTextureDescriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ baseTextureDescriptor.usage = wgpu::TextureUsage::RenderAttachment;
utils::ComboRenderPipelineDescriptor nonMultisampledPipelineDescriptor(device);
nonMultisampledPipelineDescriptor.sampleCount = 1;
diff --git a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
index 2bab964..65c787b 100644
--- a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
+++ b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
@@ -900,7 +900,7 @@
{
// Create a texture
wgpu::Texture texture =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment);
+ CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view = texture.CreateView();
// Create a bind group to use the texture as sampled binding
@@ -969,7 +969,7 @@
{
// Create a texture
wgpu::Texture texture =
- CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::OutputAttachment);
+ CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view = texture.CreateView();
// Create a bind group to use the texture as writeonly storage binding
@@ -1059,10 +1059,10 @@
{
// Create textures that will be used as both a sampled texture and a render target
wgpu::Texture t0 =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment);
+ CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView v0 = t0.CreateView();
wgpu::Texture t1 =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment);
+ CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView v1 = t1.CreateView();
// Create bind groups to use the texture as sampled
@@ -1312,7 +1312,7 @@
wgpu::Texture texture0 = CreateTexture(wgpu::TextureUsage::CopySrc);
wgpu::Texture texture1 =
CreateTexture(wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled |
- wgpu::TextureUsage::OutputAttachment);
+ wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view0 = texture0.CreateView();
wgpu::TextureView view1 = texture1.CreateView();
@@ -1353,10 +1353,10 @@
{
// Create textures that will be used as both a sampled texture and a render target
wgpu::Texture texture0 =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment);
+ CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view0 = texture0.CreateView();
wgpu::Texture texture1 =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment);
+ CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view1 = texture1.CreateView();
// Create the bind group to use the texture as sampled
@@ -1516,7 +1516,7 @@
TEST_F(ResourceUsageTrackingTest, TextureUsageConflictWithInvisibleStageInBindGroup) {
// Create texture and texture view
wgpu::Texture texture =
- CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::OutputAttachment);
+ CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view = texture.CreateView();
// Test render pass
diff --git a/src/tests/unittests/validation/StorageTextureValidationTests.cpp b/src/tests/unittests/validation/StorageTextureValidationTests.cpp
index 9ce529a..a6c8830 100644
--- a/src/tests/unittests/validation/StorageTextureValidationTests.cpp
+++ b/src/tests/unittests/validation/StorageTextureValidationTests.cpp
@@ -658,7 +658,7 @@
constexpr std::array<wgpu::TextureUsage, 6> kTextureUsages = {
wgpu::TextureUsage::CopySrc, wgpu::TextureUsage::CopyDst,
wgpu::TextureUsage::Sampled, wgpu::TextureUsage::Storage,
- wgpu::TextureUsage::OutputAttachment, wgpu::TextureUsage::Present};
+ wgpu::TextureUsage::RenderAttachment, wgpu::TextureUsage::Present};
for (wgpu::BindingType storageBindingType : kSupportedStorageTextureBindingTypes) {
// Create a bind group layout.
@@ -800,7 +800,7 @@
constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
wgpu::Texture storageTexture = CreateTexture(wgpu::TextureUsage::Storage, kFormat);
- wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::OutputAttachment, kFormat);
+ wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::RenderAttachment, kFormat);
utils::ComboRenderPassDescriptor renderPassDescriptor({outputAttachment.CreateView()});
for (wgpu::BindingType storageTextureType : kSupportedStorageTextureBindingTypes) {
@@ -831,7 +831,7 @@
wgpu::Texture storageTexture =
CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::Sampled, kFormat);
- wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::OutputAttachment, kFormat);
+ wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::RenderAttachment, kFormat);
utils::ComboRenderPassDescriptor renderPassDescriptor({outputAttachment.CreateView()});
// Create a bind group that contains a storage texture and a sampled texture.
@@ -871,10 +871,10 @@
// Verify it is invalid to use a a texture as both storage texture (either read-only or write-only)
// and output attachment in one render pass.
-TEST_F(StorageTextureValidationTests, StorageTextureAndOutputAttachmentInOneRenderPass) {
+TEST_F(StorageTextureValidationTests, StorageTextureAndRenderAttachmentInOneRenderPass) {
constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
wgpu::Texture storageTexture =
- CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::OutputAttachment, kFormat);
+ CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::RenderAttachment, kFormat);
utils::ComboRenderPassDescriptor renderPassDescriptor({storageTexture.CreateView()});
for (wgpu::BindingType storageTextureType : kSupportedStorageTextureBindingTypes) {
@@ -917,7 +917,7 @@
// It is invalid to use a texture as both read-only storage texture and write-only storage
// texture in one render pass.
- wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::OutputAttachment, kFormat);
+ wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::RenderAttachment, kFormat);
utils::ComboRenderPassDescriptor renderPassDescriptor({outputAttachment.CreateView()});
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder renderPassEncoder = encoder.BeginRenderPass(&renderPassDescriptor);
diff --git a/src/tests/unittests/validation/TextureSubresourceTests.cpp b/src/tests/unittests/validation/TextureSubresourceTests.cpp
index da6d210..e37877d 100644
--- a/src/tests/unittests/validation/TextureSubresourceTests.cpp
+++ b/src/tests/unittests/validation/TextureSubresourceTests.cpp
@@ -129,7 +129,7 @@
// Create texture with 2 mipmap levels and 1 layer
wgpu::Texture texture =
CreateTexture(2, 1,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment |
+ wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::Storage);
// Create two views on different mipmap levels.
@@ -143,7 +143,7 @@
// Create texture with 1 mipmap level and 2 layers
wgpu::Texture texture =
CreateTexture(1, 2,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment |
+ wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::Storage);
// Create two views on different layers.
diff --git a/src/tests/unittests/validation/TextureValidationTests.cpp b/src/tests/unittests/validation/TextureValidationTests.cpp
index d9110b4..61154d7 100644
--- a/src/tests/unittests/validation/TextureValidationTests.cpp
+++ b/src/tests/unittests/validation/TextureValidationTests.cpp
@@ -36,7 +36,7 @@
descriptor.sampleCount = kDefaultSampleCount;
descriptor.dimension = wgpu::TextureDimension::e2D;
descriptor.format = kDefaultTextureFormat;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::Sampled;
return descriptor;
}
@@ -329,11 +329,11 @@
ASSERT_DEVICE_ERROR(queue.Submit(1, &commands));
}
- // Test it is an error to create an OutputAttachment texture with a non-renderable format.
- TEST_F(TextureValidationTest, NonRenderableAndOutputAttachment) {
+ // Test it is an error to create an RenderAttachment texture with a non-renderable format.
+ TEST_F(TextureValidationTest, NonRenderableAndRenderAttachment) {
wgpu::TextureDescriptor descriptor;
descriptor.size = {1, 1, 1};
- descriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment;
// Succeeds because RGBA8Unorm is renderable
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
@@ -457,7 +457,7 @@
// Test that only CopySrc, CopyDst and Sampled are accepted as the texture usage of the
// textures in BC formats.
wgpu::TextureUsage invalidUsages[] = {
- wgpu::TextureUsage::OutputAttachment,
+ wgpu::TextureUsage::RenderAttachment,
wgpu::TextureUsage::Storage,
wgpu::TextureUsage::Present,
};
diff --git a/src/tests/unittests/validation/TextureViewValidationTests.cpp b/src/tests/unittests/validation/TextureViewValidationTests.cpp
index b31439a..10addb2 100644
--- a/src/tests/unittests/validation/TextureViewValidationTests.cpp
+++ b/src/tests/unittests/validation/TextureViewValidationTests.cpp
@@ -348,7 +348,7 @@
TEST_F(TextureViewValidationTest, AspectMustExist) {
wgpu::TextureDescriptor descriptor = {};
descriptor.size = {1, 1, 1};
- descriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment;
+ descriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment;
// Can select: All and DepthOnly from Depth32Float, but not StencilOnly
{
diff --git a/src/tests/unittests/validation/ValidationTest.cpp b/src/tests/unittests/validation/ValidationTest.cpp
index 1713171..5993096 100644
--- a/src/tests/unittests/validation/ValidationTest.cpp
+++ b/src/tests/unittests/validation/ValidationTest.cpp
@@ -130,7 +130,7 @@
descriptor.sampleCount = 1;
descriptor.format = attachmentFormat;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment;
attachment = device.CreateTexture(&descriptor);
wgpu::TextureView view = attachment.CreateView();
diff --git a/src/tests/white_box/D3D12DescriptorHeapTests.cpp b/src/tests/white_box/D3D12DescriptorHeapTests.cpp
index 7293665..341ca3f 100644
--- a/src/tests/white_box/D3D12DescriptorHeapTests.cpp
+++ b/src/tests/white_box/D3D12DescriptorHeapTests.cpp
@@ -69,7 +69,7 @@
descriptor.sampleCount = 1;
descriptor.format = format;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
wgpu::Texture color = device.CreateTexture(&descriptor);
return utils::BasicRenderPass(width, height, color);
@@ -739,7 +739,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment |
+ descriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::CopySrc;
wgpu::Texture texture = device.CreateTexture(&descriptor);
wgpu::TextureView textureView = texture.CreateView();
diff --git a/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp b/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp
index c139b95..529c86e 100644
--- a/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp
+++ b/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp
@@ -50,7 +50,7 @@
defaultDescriptor.size = {1, 1, 1};
defaultDescriptor.sampleCount = 1;
defaultDescriptor.mipLevelCount = 1;
- defaultDescriptor.usage = wgpu::TextureUsage::OutputAttachment |
+ defaultDescriptor.usage = wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst;
}
diff --git a/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp b/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp
index a9b05c5..a01a863 100644
--- a/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp
+++ b/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp
@@ -234,7 +234,7 @@
defaultDescriptor.size = {1, 1, 1};
defaultDescriptor.sampleCount = 1;
defaultDescriptor.mipLevelCount = 1;
- defaultDescriptor.usage = wgpu::TextureUsage::OutputAttachment |
+ defaultDescriptor.usage = wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst;
}
@@ -401,7 +401,7 @@
defaultDescriptor.size = {1, 1, 1};
defaultDescriptor.sampleCount = 1;
defaultDescriptor.mipLevelCount = 1;
- defaultDescriptor.usage = wgpu::TextureUsage::OutputAttachment |
+ defaultDescriptor.usage = wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst;
}
diff --git a/src/utils/MetalBinding.mm b/src/utils/MetalBinding.mm
index d8875d5..1abeb31 100644
--- a/src/utils/MetalBinding.mm
+++ b/src/utils/MetalBinding.mm
@@ -65,7 +65,7 @@
[mLayer setDrawableSize:size];
constexpr uint32_t kFramebufferOnlyTextureUsages =
- WGPUTextureUsage_OutputAttachment | WGPUTextureUsage_Present;
+ WGPUTextureUsage_RenderAttachment | WGPUTextureUsage_Present;
bool hasOnlyFramebufferUsages = !(usage & (~kFramebufferOnlyTextureUsages));
if (hasOnlyFramebufferUsages) {
[mLayer setFramebufferOnly:YES];
diff --git a/src/utils/WGPUHelpers.cpp b/src/utils/WGPUHelpers.cpp
index 4e2f6e8..b4558eb 100644
--- a/src/utils/WGPUHelpers.cpp
+++ b/src/utils/WGPUHelpers.cpp
@@ -262,7 +262,7 @@
descriptor.sampleCount = 1;
descriptor.format = BasicRenderPass::kDefaultColorFormat;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc;
+ descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
wgpu::Texture color = device.CreateTexture(&descriptor);
return BasicRenderPass(width, height, color);