Update deprecated TextureUsage flag names
Older names are kept around as an alias for a while. Unfortunately we
have no mechanism for producing deprecation error messages when they
are used.
Bug: dawn:1035
Change-Id: Ic6716fd526ecbedaa8e7925ab93e3ff32f642d97
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61382
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
diff --git a/dawn.json b/dawn.json
index 649c08e..a63d2b6 100644
--- a/dawn.json
+++ b/dawn.json
@@ -1995,10 +1995,13 @@
{"value": 0, "name": "none"},
{"value": 1, "name": "copy src"},
{"value": 2, "name": "copy dst"},
- {"value": 4, "name": "sampled"},
- {"value": 8, "name": "storage"},
+ {"value": 4, "name": "texture binding"},
+ {"value": 8, "name": "storage binding"},
{"value": 16, "name": "render attachment"},
- {"value": 32, "name": "present"}
+ {"value": 32, "name": "present"},
+
+ {"value": 4, "name": "sampled", "deprecated": true},
+ {"value": 8, "name": "storage", "deprecated": true}
]
},
"texture view descriptor": {
diff --git a/examples/CppHelloTriangle.cpp b/examples/CppHelloTriangle.cpp
index cf5f73c..b32757a 100644
--- a/examples/CppHelloTriangle.cpp
+++ b/examples/CppHelloTriangle.cpp
@@ -60,7 +60,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding;
texture = device.CreateTexture(&descriptor);
sampler = device.CreateSampler();
diff --git a/src/dawn_native/BindGroup.cpp b/src/dawn_native/BindGroup.cpp
index 9ad5b32..4f5f904 100644
--- a/src/dawn_native/BindGroup.cpp
+++ b/src/dawn_native/BindGroup.cpp
@@ -141,7 +141,7 @@
SampleTypeBit requiredType =
SampleTypeToSampleTypeBit(bindingInfo.texture.sampleType);
- if (!(texture->GetUsage() & wgpu::TextureUsage::Sampled)) {
+ if (!(texture->GetUsage() & wgpu::TextureUsage::TextureBinding)) {
return DAWN_VALIDATION_ERROR("Texture binding usage mismatch");
}
@@ -167,7 +167,7 @@
break;
}
case BindingInfoType::StorageTexture: {
- if (!(texture->GetUsage() & wgpu::TextureUsage::Storage)) {
+ if (!(texture->GetUsage() & wgpu::TextureUsage::StorageBinding)) {
return DAWN_VALIDATION_ERROR("Storage Texture binding usage mismatch");
}
ASSERT(!texture->IsMultisampledTexture());
diff --git a/src/dawn_native/CommandValidation.cpp b/src/dawn_native/CommandValidation.cpp
index d61a619..7e3b8ee 100644
--- a/src/dawn_native/CommandValidation.cpp
+++ b/src/dawn_native/CommandValidation.cpp
@@ -401,7 +401,7 @@
MaybeError ValidateCopyTextureForBrowserRestrictions(const ImageCopyTexture& src,
const ImageCopyTexture& dst,
const Extent3D& copySize) {
- if (!(src.texture->GetUsage() & wgpu::TextureUsage::Sampled)) {
+ if (!(src.texture->GetUsage() & wgpu::TextureUsage::TextureBinding)) {
return DAWN_VALIDATION_ERROR("Source texture must have sampled usage");
}
diff --git a/src/dawn_native/CopyTextureForBrowserHelper.cpp b/src/dawn_native/CopyTextureForBrowserHelper.cpp
index d64870c..e177baa 100644
--- a/src/dawn_native/CopyTextureForBrowserHelper.cpp
+++ b/src/dawn_native/CopyTextureForBrowserHelper.cpp
@@ -289,7 +289,7 @@
DAWN_TRY(ValidateTextureCopyRange(device, *destination, *copySize));
DAWN_TRY(ValidateCanUseAs(source->texture, wgpu::TextureUsage::CopySrc));
- DAWN_TRY(ValidateCanUseAs(source->texture, wgpu::TextureUsage::Sampled));
+ DAWN_TRY(ValidateCanUseAs(source->texture, wgpu::TextureUsage::TextureBinding));
DAWN_TRY(ValidateCanUseAs(destination->texture, wgpu::TextureUsage::CopyDst));
DAWN_TRY(ValidateCanUseAs(destination->texture, wgpu::TextureUsage::RenderAttachment));
diff --git a/src/dawn_native/ExternalTexture.cpp b/src/dawn_native/ExternalTexture.cpp
index 254a556..1ff5330 100644
--- a/src/dawn_native/ExternalTexture.cpp
+++ b/src/dawn_native/ExternalTexture.cpp
@@ -29,11 +29,11 @@
"at least one of the passed texture views.");
}
- if ((textureView->GetTexture()->GetUsage() & wgpu::TextureUsage::Sampled) !=
- wgpu::TextureUsage::Sampled) {
+ if ((textureView->GetTexture()->GetUsage() & wgpu::TextureUsage::TextureBinding) !=
+ wgpu::TextureUsage::TextureBinding) {
return DAWN_VALIDATION_ERROR(
"The external texture descriptor specifies a texture that was not created with "
- "TextureUsage::Sampled.");
+ "TextureUsage::TextureBinding.");
}
if (textureView->GetDimension() != wgpu::TextureViewDimension::e2D) {
diff --git a/src/dawn_native/PassResourceUsageTracker.cpp b/src/dawn_native/PassResourceUsageTracker.cpp
index c9b8e97..2ebdc02 100644
--- a/src/dawn_native/PassResourceUsageTracker.cpp
+++ b/src/dawn_native/PassResourceUsageTracker.cpp
@@ -108,7 +108,7 @@
case BindingInfoType::Texture: {
TextureViewBase* view = group->GetBindingAsTextureView(bindingIndex);
- TextureViewUsedAs(view, wgpu::TextureUsage::Sampled);
+ TextureViewUsedAs(view, wgpu::TextureUsage::TextureBinding);
break;
}
@@ -119,7 +119,7 @@
TextureViewUsedAs(view, kReadOnlyStorageTexture);
break;
case wgpu::StorageTextureAccess::WriteOnly:
- TextureViewUsedAs(view, wgpu::TextureUsage::Storage);
+ TextureViewUsedAs(view, wgpu::TextureUsage::StorageBinding);
break;
case wgpu::StorageTextureAccess::Undefined:
UNREACHABLE();
@@ -140,7 +140,7 @@
ASSERT(textureViews[2].Get() == nullptr);
mExternalTextureUsages.insert(externalTexture);
- TextureViewUsedAs(textureViews[0].Get(), wgpu::TextureUsage::Sampled);
+ TextureViewUsedAs(textureViews[0].Get(), wgpu::TextureUsage::TextureBinding);
break;
}
diff --git a/src/dawn_native/Texture.cpp b/src/dawn_native/Texture.cpp
index 2c43bc1..bf1ccff 100644
--- a/src/dawn_native/Texture.cpp
+++ b/src/dawn_native/Texture.cpp
@@ -135,7 +135,7 @@
// Compressed formats are not renderable. They cannot support multisample.
ASSERT(!format->isCompressed);
- if (usage & wgpu::TextureUsage::Storage) {
+ if (usage & wgpu::TextureUsage::StorageBinding) {
return DAWN_VALIDATION_ERROR(
"The sample counts of the storage textures must be 1.");
}
@@ -225,9 +225,9 @@
const Format* format) {
DAWN_TRY(dawn_native::ValidateTextureUsage(usage));
- constexpr wgpu::TextureUsage kValidCompressedUsages = wgpu::TextureUsage::Sampled |
- wgpu::TextureUsage::CopySrc |
- wgpu::TextureUsage::CopyDst;
+ constexpr wgpu::TextureUsage kValidCompressedUsages =
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopySrc |
+ wgpu::TextureUsage::CopyDst;
if (format->isCompressed && !IsSubset(usage, kValidCompressedUsages)) {
return DAWN_VALIDATION_ERROR(
"Compressed texture format is incompatible with the texture usage");
@@ -238,11 +238,12 @@
"Non-renderable format used with RenderAttachment usage");
}
- if (!format->supportsStorageUsage && (usage & wgpu::TextureUsage::Storage)) {
+ if (!format->supportsStorageUsage && (usage & wgpu::TextureUsage::StorageBinding)) {
return DAWN_VALIDATION_ERROR("Format cannot be used in storage textures");
}
- constexpr wgpu::TextureUsage kValidMultiPlanarUsages = wgpu::TextureUsage::Sampled;
+ constexpr wgpu::TextureUsage kValidMultiPlanarUsages =
+ wgpu::TextureUsage::TextureBinding;
if (format->IsMultiPlanar() && !IsSubset(usage, kValidMultiPlanarUsages)) {
return DAWN_VALIDATION_ERROR("Multi-planar format doesn't have valid usage.");
}
@@ -453,7 +454,7 @@
// Add readonly storage usage if the texture has a storage usage. The validation rules in
// ValidateSyncScopeResourceUsage will make sure we don't use both at the same time.
- if (mInternalUsage & wgpu::TextureUsage::Storage) {
+ if (mInternalUsage & wgpu::TextureUsage::StorageBinding) {
mInternalUsage |= kReadOnlyStorageTexture;
}
}
diff --git a/src/dawn_native/Texture.h b/src/dawn_native/Texture.h
index 093a94d..c3e161d 100644
--- a/src/dawn_native/Texture.h
+++ b/src/dawn_native/Texture.h
@@ -40,7 +40,7 @@
bool IsValidSampleCount(uint32_t sampleCount);
static constexpr wgpu::TextureUsage kReadOnlyTextureUsages =
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::Sampled | kReadOnlyStorageTexture;
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::TextureBinding | kReadOnlyStorageTexture;
class TextureBase : public ObjectBase {
public:
diff --git a/src/dawn_native/d3d12/CommandBufferD3D12.cpp b/src/dawn_native/d3d12/CommandBufferD3D12.cpp
index cf93b20..302d981 100644
--- a/src/dawn_native/d3d12/CommandBufferD3D12.cpp
+++ b/src/dawn_native/d3d12/CommandBufferD3D12.cpp
@@ -306,7 +306,7 @@
}
return (bufferUsages & wgpu::BufferUsage::Storage ||
- textureUsages & wgpu::TextureUsage::Storage);
+ textureUsages & wgpu::TextureUsage::StorageBinding);
}
} // anonymous namespace
diff --git a/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp b/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp
index db11862..f4ef120 100644
--- a/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp
+++ b/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp
@@ -23,10 +23,10 @@
namespace {
DXGI_USAGE D3D12SwapChainBufferUsage(WGPUTextureUsage allowedUsages) {
DXGI_USAGE usage = DXGI_CPU_ACCESS_NONE;
- if (allowedUsages & WGPUTextureUsage_Sampled) {
+ if (allowedUsages & WGPUTextureUsage_TextureBinding) {
usage |= DXGI_USAGE_SHADER_INPUT;
}
- if (allowedUsages & WGPUTextureUsage_Storage) {
+ if (allowedUsages & WGPUTextureUsage_StorageBinding) {
usage |= DXGI_USAGE_UNORDERED_ACCESS;
}
if (allowedUsages & WGPUTextureUsage_RenderAttachment) {
diff --git a/src/dawn_native/d3d12/SwapChainD3D12.cpp b/src/dawn_native/d3d12/SwapChainD3D12.cpp
index 3950988..4554bcc 100644
--- a/src/dawn_native/d3d12/SwapChainD3D12.cpp
+++ b/src/dawn_native/d3d12/SwapChainD3D12.cpp
@@ -58,10 +58,10 @@
DXGI_USAGE ToDXGIUsage(wgpu::TextureUsage usage) {
DXGI_USAGE dxgiUsage = DXGI_CPU_ACCESS_NONE;
- if (usage & wgpu::TextureUsage::Sampled) {
+ if (usage & wgpu::TextureUsage::TextureBinding) {
dxgiUsage |= DXGI_USAGE_SHADER_INPUT;
}
- if (usage & wgpu::TextureUsage::Storage) {
+ if (usage & wgpu::TextureUsage::StorageBinding) {
dxgiUsage |= DXGI_USAGE_UNORDERED_ACCESS;
}
if (usage & wgpu::TextureUsage::RenderAttachment) {
diff --git a/src/dawn_native/d3d12/TextureD3D12.cpp b/src/dawn_native/d3d12/TextureD3D12.cpp
index e269daf..d9671c6 100644
--- a/src/dawn_native/d3d12/TextureD3D12.cpp
+++ b/src/dawn_native/d3d12/TextureD3D12.cpp
@@ -49,11 +49,11 @@
if (usage & wgpu::TextureUsage::CopyDst) {
resourceState |= D3D12_RESOURCE_STATE_COPY_DEST;
}
- if (usage & (wgpu::TextureUsage::Sampled | kReadOnlyStorageTexture)) {
+ if (usage & (wgpu::TextureUsage::TextureBinding | kReadOnlyStorageTexture)) {
resourceState |= (D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE |
D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
}
- if (usage & wgpu::TextureUsage::Storage) {
+ if (usage & wgpu::TextureUsage::StorageBinding) {
resourceState |= D3D12_RESOURCE_STATE_UNORDERED_ACCESS;
}
if (usage & wgpu::TextureUsage::RenderAttachment) {
@@ -72,7 +72,7 @@
bool isMultisampledTexture) {
D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE;
- if (usage & wgpu::TextureUsage::Storage) {
+ if (usage & wgpu::TextureUsage::StorageBinding) {
flags |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
}
@@ -498,8 +498,9 @@
// This will need to be much more nuanced when WebGPU has
// texture view compatibility rules.
- const bool needsTypelessFormat = GetFormat().HasDepthOrStencil() &&
- (GetInternalUsage() & wgpu::TextureUsage::Sampled) != 0;
+ const bool needsTypelessFormat =
+ GetFormat().HasDepthOrStencil() &&
+ (GetInternalUsage() & wgpu::TextureUsage::TextureBinding) != 0;
DXGI_FORMAT dxgiFormat = needsTypelessFormat
? D3D12TypelessTextureFormat(GetFormat().format)
diff --git a/src/dawn_native/metal/TextureMTL.mm b/src/dawn_native/metal/TextureMTL.mm
index bcc1652..120b214 100644
--- a/src/dawn_native/metal/TextureMTL.mm
+++ b/src/dawn_native/metal/TextureMTL.mm
@@ -30,7 +30,7 @@
namespace {
bool UsageNeedsTextureView(wgpu::TextureUsage usage) {
constexpr wgpu::TextureUsage kUsageNeedsTextureView =
- wgpu::TextureUsage::Storage | wgpu::TextureUsage::Sampled;
+ wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::TextureBinding;
return usage & kUsageNeedsTextureView;
}
@@ -39,11 +39,11 @@
uint32_t sampleCount) {
MTLTextureUsage result = MTLTextureUsageUnknown; // This is 0
- if (usage & (wgpu::TextureUsage::Storage)) {
+ if (usage & (wgpu::TextureUsage::StorageBinding)) {
result |= MTLTextureUsageShaderWrite | MTLTextureUsageShaderRead;
}
- if (usage & (wgpu::TextureUsage::Sampled)) {
+ if (usage & (wgpu::TextureUsage::TextureBinding)) {
result |= MTLTextureUsageShaderRead;
// For sampling stencil aspect of combined depth/stencil. See TextureView
diff --git a/src/dawn_native/opengl/DeviceGL.cpp b/src/dawn_native/opengl/DeviceGL.cpp
index fb7b4ea..5d9ef31 100644
--- a/src/dawn_native/opengl/DeviceGL.cpp
+++ b/src/dawn_native/opengl/DeviceGL.cpp
@@ -182,7 +182,8 @@
return DAWN_VALIDATION_ERROR("EGLImage texture must be 2D");
}
- if (descriptor->usage & (wgpu::TextureUsage::Sampled | wgpu::TextureUsage::Storage)) {
+ if (descriptor->usage &
+ (wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::StorageBinding)) {
return DAWN_VALIDATION_ERROR("EGLImage texture cannot have sampled or storage usage");
}
diff --git a/src/dawn_native/opengl/TextureGL.cpp b/src/dawn_native/opengl/TextureGL.cpp
index f58030e..1f40f96 100644
--- a/src/dawn_native/opengl/TextureGL.cpp
+++ b/src/dawn_native/opengl/TextureGL.cpp
@@ -81,7 +81,7 @@
bool UsageNeedsTextureView(wgpu::TextureUsage usage) {
constexpr wgpu::TextureUsage kUsageNeedingTextureView =
- wgpu::TextureUsage::Storage | wgpu::TextureUsage::Sampled;
+ wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::TextureBinding;
return usage & kUsageNeedingTextureView;
}
@@ -100,7 +100,7 @@
}
if (ToBackend(texture)->GetGLFormat().format == GL_DEPTH_STENCIL &&
- (texture->GetUsage() & wgpu::TextureUsage::Sampled) != 0 &&
+ (texture->GetUsage() & wgpu::TextureUsage::TextureBinding) != 0 &&
textureViewDescriptor->aspect == wgpu::TextureAspect::StencilOnly) {
// We need a separate view for one of the depth or stencil planes
// because each glTextureView needs it's own handle to set
diff --git a/src/dawn_native/vulkan/BindGroupVk.cpp b/src/dawn_native/vulkan/BindGroupVk.cpp
index 54db30d..85bd151 100644
--- a/src/dawn_native/vulkan/BindGroupVk.cpp
+++ b/src/dawn_native/vulkan/BindGroupVk.cpp
@@ -105,7 +105,7 @@
// The layout may be GENERAL here because of interactions between the Sampled
// and ReadOnlyStorage usages. See the logic in VulkanImageLayout.
writeImageInfo[numWrites].imageLayout = VulkanImageLayout(
- ToBackend(view->GetTexture()), wgpu::TextureUsage::Sampled);
+ ToBackend(view->GetTexture()), wgpu::TextureUsage::TextureBinding);
write.pImageInfo = &writeImageInfo[numWrites];
break;
@@ -143,7 +143,7 @@
writeImageInfo[numWrites].imageView = view->GetHandle();
writeImageInfo[numWrites].imageLayout = VulkanImageLayout(
- ToBackend(view->GetTexture()), wgpu::TextureUsage::Sampled);
+ ToBackend(view->GetTexture()), wgpu::TextureUsage::TextureBinding);
write.pImageInfo = &writeImageInfo[numWrites];
break;
diff --git a/src/dawn_native/vulkan/TextureVk.cpp b/src/dawn_native/vulkan/TextureVk.cpp
index 36c296e..cbb2f2ce 100644
--- a/src/dawn_native/vulkan/TextureVk.cpp
+++ b/src/dawn_native/vulkan/TextureVk.cpp
@@ -67,10 +67,10 @@
if (usage & wgpu::TextureUsage::CopyDst) {
flags |= VK_ACCESS_TRANSFER_WRITE_BIT;
}
- if (usage & wgpu::TextureUsage::Sampled) {
+ if (usage & wgpu::TextureUsage::TextureBinding) {
flags |= VK_ACCESS_SHADER_READ_BIT;
}
- if (usage & wgpu::TextureUsage::Storage) {
+ if (usage & wgpu::TextureUsage::StorageBinding) {
flags |= VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
}
if (usage & kReadOnlyStorageTexture) {
@@ -119,7 +119,7 @@
if (usage & (wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst)) {
flags |= VK_PIPELINE_STAGE_TRANSFER_BIT;
}
- if (usage & (wgpu::TextureUsage::Sampled | kReadOnlyStorageTexture)) {
+ if (usage & (wgpu::TextureUsage::TextureBinding | kReadOnlyStorageTexture)) {
// TODO(crbug.com/dawn/851): Only transition to the usage we care about to avoid
// introducing FS -> VS dependencies that would prevent parallelization on tiler
// GPUs
@@ -127,7 +127,7 @@
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT |
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
}
- if (usage & wgpu::TextureUsage::Storage) {
+ if (usage & wgpu::TextureUsage::StorageBinding) {
flags |=
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
}
@@ -355,10 +355,10 @@
if (usage & wgpu::TextureUsage::CopyDst) {
flags |= VK_IMAGE_USAGE_TRANSFER_DST_BIT;
}
- if (usage & wgpu::TextureUsage::Sampled) {
+ if (usage & wgpu::TextureUsage::TextureBinding) {
flags |= VK_IMAGE_USAGE_SAMPLED_BIT;
}
- if (usage & (wgpu::TextureUsage::Storage | kReadOnlyStorageTexture)) {
+ if (usage & (wgpu::TextureUsage::StorageBinding | kReadOnlyStorageTexture)) {
flags |= VK_IMAGE_USAGE_STORAGE_BIT;
}
if (usage & wgpu::TextureUsage::RenderAttachment) {
@@ -383,7 +383,7 @@
if (!wgpu::HasZeroOrOneBits(usage)) {
// Sampled | ReadOnlyStorage is the only possible multi-bit usage, if more appear we
// might need additional special-casing.
- ASSERT(usage == (wgpu::TextureUsage::Sampled | kReadOnlyStorageTexture));
+ ASSERT(usage == (wgpu::TextureUsage::TextureBinding | kReadOnlyStorageTexture));
return VK_IMAGE_LAYOUT_GENERAL;
}
@@ -397,8 +397,8 @@
// the storage usage. We can't know at bindgroup creation time if that case will
// happen so we must prepare for the pessimistic case and always use the GENERAL
// layout.
- case wgpu::TextureUsage::Sampled:
- if (texture->GetInternalUsage() & wgpu::TextureUsage::Storage) {
+ case wgpu::TextureUsage::TextureBinding:
+ if (texture->GetInternalUsage() & wgpu::TextureUsage::StorageBinding) {
return VK_IMAGE_LAYOUT_GENERAL;
} else {
return VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
@@ -415,7 +415,7 @@
// Read-only and write-only storage textures must use general layout because load
// and store operations on storage images can only be done on the images in
// VK_IMAGE_LAYOUT_GENERAL layout.
- case wgpu::TextureUsage::Storage:
+ case wgpu::TextureUsage::StorageBinding:
case kReadOnlyStorageTexture:
return VK_IMAGE_LAYOUT_GENERAL;
diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp
index 5465227..5e323a6 100644
--- a/src/tests/DawnTest.cpp
+++ b/src/tests/DawnTest.cpp
@@ -1263,7 +1263,7 @@
wgpu::TextureDescriptor depthDataDesc = {};
depthDataDesc.size = {width, height, 1};
depthDataDesc.format = wgpu::TextureFormat::R32Float;
- depthDataDesc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopyDst;
+ depthDataDesc.usage = wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopyDst;
depthDataTexture = device.CreateTexture(&depthDataDesc);
// Upload the depth data.
diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp
index 314713f..5b8c5fe 100644
--- a/src/tests/end2end/BindGroupTests.cpp
+++ b/src/tests/end2end/BindGroupTests.cpp
@@ -289,7 +289,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding;
wgpu::Texture texture = device.CreateTexture(&descriptor);
wgpu::TextureView textureView = texture.CreateView();
@@ -1258,7 +1258,7 @@
"Please update this test");
for (uint32_t i = 0; i < kMaxSampledTexturesPerShaderStage; ++i) {
wgpu::Texture texture = CreateTextureWithRedData(
- wgpu::TextureFormat::R8Unorm, expectedValue, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8Unorm, expectedValue, wgpu::TextureUsage::TextureBinding);
bgEntries.push_back({nullptr, binding, nullptr, 0, 0, nullptr, texture.CreateView()});
interface << "[[group(0), binding(" << binding++ << ")]] "
@@ -1277,7 +1277,7 @@
}
for (uint32_t i = 0; i < kMaxStorageTexturesPerShaderStage; ++i) {
wgpu::Texture texture = CreateTextureWithRedData(
- wgpu::TextureFormat::R32Uint, expectedValue, wgpu::TextureUsage::Storage);
+ wgpu::TextureFormat::R32Uint, expectedValue, wgpu::TextureUsage::StorageBinding);
bgEntries.push_back({nullptr, binding, nullptr, 0, 0, nullptr, texture.CreateView()});
interface << "[[group(0), binding(" << binding++ << ")]] "
@@ -1391,7 +1391,7 @@
device, {{0, wgpu::ShaderStage::Fragment, wgpu::TextureSampleType::Float}});
wgpu::TextureDescriptor textureDesc;
- textureDesc.usage = wgpu::TextureUsage::Sampled;
+ textureDesc.usage = wgpu::TextureUsage::TextureBinding;
textureDesc.size = {1, 1, 1};
textureDesc.format = wgpu::TextureFormat::BGRA8Unorm;
@@ -1424,7 +1424,7 @@
wgpu::TextureFormat::R32Uint}}));
wgpu::TextureDescriptor textureDesc;
- textureDesc.usage = wgpu::TextureUsage::Storage;
+ textureDesc.usage = wgpu::TextureUsage::StorageBinding;
textureDesc.size = {1, 1, 1};
textureDesc.format = wgpu::TextureFormat::R32Uint;
diff --git a/src/tests/end2end/BufferZeroInitTests.cpp b/src/tests/end2end/BufferZeroInitTests.cpp
index 2fd8741..57be4d5 100644
--- a/src/tests/end2end/BufferZeroInitTests.cpp
+++ b/src/tests/end2end/BufferZeroInitTests.cpp
@@ -91,7 +91,8 @@
descriptor.size = size;
descriptor.format = format;
descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc |
- wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::Storage;
+ wgpu::TextureUsage::RenderAttachment |
+ wgpu::TextureUsage::StorageBinding;
wgpu::Texture texture = device.CreateTexture(&descriptor);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
diff --git a/src/tests/end2end/CompressedTextureFormatTests.cpp b/src/tests/end2end/CompressedTextureFormatTests.cpp
index fb129bc..82b5c64 100644
--- a/src/tests/end2end/CompressedTextureFormatTests.cpp
+++ b/src/tests/end2end/CompressedTextureFormatTests.cpp
@@ -423,7 +423,7 @@
static constexpr uint32_t kBCBlockHeightInTexels = 4;
static constexpr wgpu::TextureUsage kDefaultBCFormatTextureUsage =
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopyDst;
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopyDst;
bool mIsBCFormatSupported = false;
};
@@ -567,8 +567,8 @@
config.textureDescriptor.format = format;
// Add the usage bit for both source and destination textures so that we don't need to
// create two copy configs.
- config.textureDescriptor.usage =
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ config.textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::TextureBinding;
wgpu::Texture bcTextureSrc = CreateTextureWithCompressedData(config);
diff --git a/src/tests/end2end/CopyTextureForBrowserTests.cpp b/src/tests/end2end/CopyTextureForBrowserTests.cpp
index 768e36a..0b8e497 100644
--- a/src/tests/end2end/CopyTextureForBrowserTests.cpp
+++ b/src/tests/end2end/CopyTextureForBrowserTests.cpp
@@ -301,8 +301,8 @@
srcDescriptor.size = srcSpec.textureSize;
srcDescriptor.format = srcSpec.format;
srcDescriptor.mipLevelCount = srcSpec.level + 1;
- srcDescriptor.usage =
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ srcDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::TextureBinding;
wgpu::Texture srcTexture = device.CreateTexture(&srcDescriptor);
const utils::TextureDataCopyLayout srcCopyLayout =
@@ -346,7 +346,7 @@
dstDescriptor.size = dstSpec.textureSize;
dstDescriptor.format = dstSpec.format;
dstDescriptor.mipLevelCount = dstSpec.level + 1;
- dstDescriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled |
+ dstDescriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding |
wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc;
dstTexture = device.CreateTexture(&dstDescriptor);
diff --git a/src/tests/end2end/D3D12ResourceWrappingTests.cpp b/src/tests/end2end/D3D12ResourceWrappingTests.cpp
index 7050dfe..ed6b165 100644
--- a/src/tests/end2end/D3D12ResourceWrappingTests.cpp
+++ b/src/tests/end2end/D3D12ResourceWrappingTests.cpp
@@ -64,9 +64,9 @@
baseDawnDescriptor.size = {kTestWidth, kTestHeight, 1};
baseDawnDescriptor.sampleCount = 1;
baseDawnDescriptor.mipLevelCount = 1;
- baseDawnDescriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc |
- wgpu::TextureUsage::RenderAttachment |
- wgpu::TextureUsage::CopyDst;
+ baseDawnDescriptor.usage =
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopySrc |
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopyDst;
baseD3dDescriptor.Width = kTestWidth;
baseD3dDescriptor.Height = kTestHeight;
@@ -620,12 +620,12 @@
&externalImage);
ASSERT_NE(texture.Get(), nullptr);
- externalAccessDesc.usage = WGPUTextureUsage_Storage;
+ externalAccessDesc.usage = WGPUTextureUsage_StorageBinding;
texture =
wgpu::Texture::Acquire(externalImage->ProduceTexture(device.Get(), &externalAccessDesc));
ASSERT_EQ(texture.Get(), nullptr);
- externalAccessDesc.usage = WGPUTextureUsage_Sampled;
+ externalAccessDesc.usage = WGPUTextureUsage_TextureBinding;
texture =
wgpu::Texture::Acquire(externalImage->ProduceTexture(device.Get(), &externalAccessDesc));
ASSERT_NE(texture.Get(), nullptr);
diff --git a/src/tests/end2end/D3D12VideoViewsTests.cpp b/src/tests/end2end/D3D12VideoViewsTests.cpp
index 165b700..f4fedb9 100644
--- a/src/tests/end2end/D3D12VideoViewsTests.cpp
+++ b/src/tests/end2end/D3D12VideoViewsTests.cpp
@@ -287,7 +287,8 @@
TEST_P(D3D12VideoViewsTests, NV12SampleYtoR) {
wgpu::Texture wgpuTexture;
CreateVideoTextureForTest(wgpu::TextureFormat::R8BG8Biplanar420Unorm,
- wgpu::TextureUsage::Sampled, /*isCheckerboard*/ false, &wgpuTexture);
+ wgpu::TextureUsage::TextureBinding, /*isCheckerboard*/ false,
+ &wgpuTexture);
ASSERT_NE(wgpuTexture.Get(), nullptr);
wgpu::TextureViewDescriptor viewDesc;
@@ -338,7 +339,8 @@
TEST_P(D3D12VideoViewsTests, NV12SampleUVtoRG) {
wgpu::Texture wgpuTexture;
CreateVideoTextureForTest(wgpu::TextureFormat::R8BG8Biplanar420Unorm,
- wgpu::TextureUsage::Sampled, /*isCheckerboard*/ false, &wgpuTexture);
+ wgpu::TextureUsage::TextureBinding, /*isCheckerboard*/ false,
+ &wgpuTexture);
ASSERT_NE(wgpuTexture.Get(), nullptr);
wgpu::TextureViewDescriptor viewDesc;
@@ -394,7 +396,8 @@
wgpu::Texture wgpuTexture;
CreateVideoTextureForTest(wgpu::TextureFormat::R8BG8Biplanar420Unorm,
- wgpu::TextureUsage::Sampled, /*isCheckerboard*/ true, &wgpuTexture);
+ wgpu::TextureUsage::TextureBinding, /*isCheckerboard*/ true,
+ &wgpuTexture);
ASSERT_NE(wgpuTexture.Get(), nullptr);
wgpu::TextureViewDescriptor lumaViewDesc;
diff --git a/src/tests/end2end/DepthStencilLoadOpTests.cpp b/src/tests/end2end/DepthStencilLoadOpTests.cpp
index be89597..e8c96b2 100644
--- a/src/tests/end2end/DepthStencilLoadOpTests.cpp
+++ b/src/tests/end2end/DepthStencilLoadOpTests.cpp
@@ -70,7 +70,7 @@
descriptor.format = GetParam().mFormat;
descriptor.mipLevelCount = kMipLevelCount;
descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc |
- wgpu::TextureUsage::Sampled;
+ wgpu::TextureUsage::TextureBinding;
texture = device.CreateTexture(&descriptor);
diff --git a/src/tests/end2end/DepthStencilSamplingTests.cpp b/src/tests/end2end/DepthStencilSamplingTests.cpp
index aa65cd1..a0bd6d5 100644
--- a/src/tests/end2end/DepthStencilSamplingTests.cpp
+++ b/src/tests/end2end/DepthStencilSamplingTests.cpp
@@ -225,7 +225,8 @@
wgpu::Texture CreateInputTexture(wgpu::TextureFormat format) {
wgpu::TextureDescriptor inputTextureDesc;
- inputTextureDesc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment;
+ inputTextureDesc.usage =
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment;
inputTextureDesc.size = {1, 1, 1};
inputTextureDesc.format = format;
return device.CreateTexture(&inputTextureDesc);
diff --git a/src/tests/end2end/ExternalTextureTests.cpp b/src/tests/end2end/ExternalTextureTests.cpp
index c1c134d..a29c9aa 100644
--- a/src/tests/end2end/ExternalTextureTests.cpp
+++ b/src/tests/end2end/ExternalTextureTests.cpp
@@ -40,7 +40,7 @@
static constexpr uint32_t kWidth = 4;
static constexpr uint32_t kHeight = 4;
static constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
- static constexpr wgpu::TextureUsage kSampledUsage = wgpu::TextureUsage::Sampled;
+ static constexpr wgpu::TextureUsage kSampledUsage = wgpu::TextureUsage::TextureBinding;
};
} // anonymous namespace
@@ -87,7 +87,7 @@
wgpu::Texture sampledTexture =
Create2DTexture(device, kWidth, kHeight, kFormat,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment);
wgpu::Texture renderTexture =
Create2DTexture(device, kWidth, kHeight, kFormat,
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::RenderAttachment);
diff --git a/src/tests/end2end/GpuMemorySynchronizationTests.cpp b/src/tests/end2end/GpuMemorySynchronizationTests.cpp
index 6c5d7bb..5a57cc1 100644
--- a/src/tests/end2end/GpuMemorySynchronizationTests.cpp
+++ b/src/tests/end2end/GpuMemorySynchronizationTests.cpp
@@ -236,8 +236,8 @@
wgpu::TextureDescriptor texDesc;
texDesc.format = wgpu::TextureFormat::R32Uint;
texDesc.size = {1, 1, 1};
- texDesc.usage =
- wgpu::TextureUsage::Storage | wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopyDst;
+ texDesc.usage = wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::CopyDst;
wgpu::Texture tex = device.CreateTexture(&texDesc);
wgpu::ImageCopyTexture copyDst;
diff --git a/src/tests/end2end/IOSurfaceWrappingTests.cpp b/src/tests/end2end/IOSurfaceWrappingTests.cpp
index 11334bc..f8af8a0 100644
--- a/src/tests/end2end/IOSurfaceWrappingTests.cpp
+++ b/src/tests/end2end/IOSurfaceWrappingTests.cpp
@@ -304,7 +304,7 @@
textureDescriptor.size = {1, 1, 1};
textureDescriptor.sampleCount = 1;
textureDescriptor.mipLevelCount = 1;
- textureDescriptor.usage = wgpu::TextureUsage::Sampled;
+ textureDescriptor.usage = wgpu::TextureUsage::TextureBinding;
wgpu::Texture wrappingTexture = WrapIOSurface(&textureDescriptor, ioSurface, 0);
wgpu::TextureView textureView = wrappingTexture.CreateView();
diff --git a/src/tests/end2end/MultisampledSamplingTests.cpp b/src/tests/end2end/MultisampledSamplingTests.cpp
index 5ad3e8b..5a3acd5 100644
--- a/src/tests/end2end/MultisampledSamplingTests.cpp
+++ b/src/tests/end2end/MultisampledSamplingTests.cpp
@@ -133,7 +133,7 @@
wgpu::Texture colorTexture;
{
wgpu::TextureDescriptor desc = {};
- desc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment;
+ desc.usage = wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment;
desc.size = kTextureSize;
desc.format = kColorFormat;
desc.sampleCount = kSampleCount;
@@ -143,7 +143,7 @@
wgpu::Texture depthTexture;
{
wgpu::TextureDescriptor desc = {};
- desc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment;
+ desc.usage = wgpu::TextureUsage::TextureBinding | 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 4903e35..783c3ec 100644
--- a/src/tests/end2end/NonzeroTextureCreationTests.cpp
+++ b/src/tests/end2end/NonzeroTextureCreationTests.cpp
@@ -398,8 +398,8 @@
{wgpu::TextureFormat::Depth24PlusStencil8},
{wgpu::TextureAspect::DepthOnly, wgpu::TextureAspect::StencilOnly},
{wgpu::TextureUsage(wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopySrc |
- wgpu::TextureUsage::Sampled),
- wgpu::TextureUsage(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc)},
+ wgpu::TextureUsage::TextureBinding),
+ wgpu::TextureUsage(wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopySrc)},
{wgpu::TextureDimension::e2D},
{1u, 7u}, // depth or array layers
{4u}, // mip count
@@ -421,8 +421,8 @@
{"lazy_clear_resource_on_first_use"})},
{wgpu::TextureFormat::R8Unorm, wgpu::TextureFormat::RG8Unorm, wgpu::TextureFormat::RGBA8Unorm},
{wgpu::TextureAspect::All},
- {wgpu::TextureUsage(wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::Sampled),
- wgpu::TextureUsage::Sampled},
+ {wgpu::TextureUsage(wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::TextureBinding),
+ wgpu::TextureUsage::TextureBinding},
{wgpu::TextureDimension::e2D},
{1u}, // depth or array layers
{1u}, // mip count
diff --git a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
index 27de344..22679d3 100644
--- a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
+++ b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
@@ -108,7 +108,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = mipLevelCount;
- descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding;
wgpu::Texture texture = device.CreateTexture(&descriptor);
const uint32_t rowPixels = kTextureBytesPerRowAlignment / sizeof(RGBA8);
diff --git a/src/tests/end2end/SamplerTests.cpp b/src/tests/end2end/SamplerTests.cpp
index cf6624e..dc8d204 100644
--- a/src/tests/end2end/SamplerTests.cpp
+++ b/src/tests/end2end/SamplerTests.cpp
@@ -92,7 +92,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding;
wgpu::Texture texture = device.CreateTexture(&descriptor);
// Create a 2x2 checkerboard texture, with black in the top left and bottom right corners.
diff --git a/src/tests/end2end/StorageTextureTests.cpp b/src/tests/end2end/StorageTextureTests.cpp
index 5a03e08..68e9138 100644
--- a/src/tests/end2end/StorageTextureTests.cpp
+++ b/src/tests/end2end/StorageTextureTests.cpp
@@ -519,9 +519,9 @@
utils::CreateBufferFromData(device, uploadBufferData.data(), uploadBufferSize,
wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopyDst);
- wgpu::Texture outputTexture =
- CreateTexture(format, wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopyDst, kWidth,
- kHeight, sliceCount, utils::ViewDimensionToTextureDimension(dimension));
+ wgpu::Texture outputTexture = CreateTexture(
+ format, wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::CopyDst, kWidth,
+ kHeight, sliceCount, utils::ViewDimensionToTextureDimension(dimension));
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
@@ -894,7 +894,7 @@
// Prepare the write-only storage texture.
wgpu::Texture writeonlyStorageTexture =
- CreateTexture(format, wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopySrc);
+ CreateTexture(format, wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::CopySrc);
// Write the expected pixel values into the write-only storage texture.
const std::string computeShader = CommonWriteOnlyTestCode("compute", format);
@@ -932,7 +932,7 @@
// Prepare the write-only storage texture.
wgpu::Texture writeonlyStorageTexture =
- CreateTexture(format, wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopySrc);
+ CreateTexture(format, wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::CopySrc);
// Write the expected pixel values into the write-only storage texture.
const std::string computeShader = CommonReadWriteTestCode(format);
@@ -973,7 +973,7 @@
// Prepare the write-only storage texture.
wgpu::Texture writeonlyStorageTexture =
- CreateTexture(format, wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopySrc);
+ CreateTexture(format, wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::CopySrc);
// Write the expected pixel values into the write-only storage texture.
const std::string fragmentShader = CommonWriteOnlyTestCode("fragment", format);
@@ -1048,8 +1048,8 @@
// Prepare the write-only storage texture.
for (wgpu::TextureViewDimension dimension : dimensions) {
wgpu::Texture writeonlyStorageTexture = CreateTexture(
- kTextureFormat, wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopySrc, kWidth,
- kHeight, kSliceCount, utils::ViewDimensionToTextureDimension(dimension));
+ kTextureFormat, wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::CopySrc,
+ kWidth, kHeight, kSliceCount, utils::ViewDimensionToTextureDimension(dimension));
// Write the expected pixel values into the write-only storage texture.
const std::string computeShader =
@@ -1084,8 +1084,8 @@
CreateTextureWithTestData(initialTextureData, kTextureFormat, dimension);
// Prepare the write-only storage texture.
wgpu::Texture writeonlyStorageTexture = CreateTexture(
- kTextureFormat, wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopySrc, kWidth,
- kHeight, kSliceCount, utils::ViewDimensionToTextureDimension(dimension));
+ kTextureFormat, wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::CopySrc,
+ kWidth, kHeight, kSliceCount, utils::ViewDimensionToTextureDimension(dimension));
// Read values from read-only storage texture and write into the write-only storage texture.
const std::string computeShader = CommonReadWriteTestCode(kTextureFormat, dimension);
@@ -1109,9 +1109,9 @@
constexpr wgpu::TextureFormat kTextureFormat = wgpu::TextureFormat::R32Uint;
wgpu::Texture storageTexture1 = CreateTexture(
- kTextureFormat, wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopySrc, 1u, 1u);
+ kTextureFormat, wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::CopySrc, 1u, 1u);
wgpu::Texture storageTexture2 = CreateTexture(
- kTextureFormat, wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopySrc, 1u, 1u);
+ kTextureFormat, wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::CopySrc, 1u, 1u);
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var Src : texture_storage_2d<r32uint, read>;
@@ -1183,12 +1183,14 @@
// a write-only storage texture are synchronized in one pass.
TEST_P(StorageTextureTests, SampledAndWriteonlyStorageTexturePingPong) {
constexpr wgpu::TextureFormat kTextureFormat = wgpu::TextureFormat::R32Uint;
- wgpu::Texture storageTexture1 = CreateTexture(
- kTextureFormat,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopySrc, 1u,
- 1u);
+ wgpu::Texture storageTexture1 =
+ CreateTexture(kTextureFormat,
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::StorageBinding |
+ wgpu::TextureUsage::CopySrc,
+ 1u, 1u);
wgpu::Texture storageTexture2 = CreateTexture(
- kTextureFormat, wgpu::TextureUsage::Sampled | wgpu::TextureUsage::Storage, 1u, 1u);
+ kTextureFormat, wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::StorageBinding, 1u,
+ 1u);
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var Src : texture_2d<u32>;
[[group(0), binding(1)]] var Dst : texture_storage_2d<r32uint, write>;
@@ -1307,7 +1309,7 @@
// texture in a render pass.
TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInRenderPass) {
wgpu::Texture readonlyStorageTexture =
- CreateTexture(wgpu::TextureFormat::R32Uint, wgpu::TextureUsage::Storage);
+ CreateTexture(wgpu::TextureFormat::R32Uint, wgpu::TextureUsage::StorageBinding);
// Create a rendering pipeline that reads the pixels from the read-only storage texture and uses
// green as the output color, otherwise uses red instead.
@@ -1331,7 +1333,7 @@
// texture in a compute pass.
TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInComputePass) {
wgpu::Texture readonlyStorageTexture =
- CreateTexture(wgpu::TextureFormat::R32Uint, wgpu::TextureUsage::Storage);
+ CreateTexture(wgpu::TextureFormat::R32Uint, wgpu::TextureUsage::StorageBinding);
// Create a compute shader that reads the pixels from the read-only storage texture and writes 1
// to DstBuffer if they all have the expected value.
@@ -1360,8 +1362,9 @@
TEST_P(StorageTextureZeroInitTests, WriteonlyStorageTextureClearsToZeroInRenderPass) {
// Prepare the write-only storage texture.
constexpr uint32_t kTexelSizeR32Uint = 4u;
- wgpu::Texture writeonlyStorageTexture = CreateTexture(
- wgpu::TextureFormat::R32Uint, wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopySrc);
+ wgpu::Texture writeonlyStorageTexture =
+ CreateTexture(wgpu::TextureFormat::R32Uint,
+ wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::CopySrc);
WriteIntoStorageTextureInRenderPass(writeonlyStorageTexture, kSimpleVertexShader,
kCommonWriteOnlyZeroInitTestCodeFragment);
@@ -1373,8 +1376,9 @@
TEST_P(StorageTextureZeroInitTests, WriteonlyStorageTextureClearsToZeroInComputePass) {
// Prepare the write-only storage texture.
constexpr uint32_t kTexelSizeR32Uint = 4u;
- wgpu::Texture writeonlyStorageTexture = CreateTexture(
- wgpu::TextureFormat::R32Uint, wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopySrc);
+ wgpu::Texture writeonlyStorageTexture =
+ CreateTexture(wgpu::TextureFormat::R32Uint,
+ wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::CopySrc);
WriteIntoStorageTextureInComputePass(writeonlyStorageTexture,
kCommonWriteOnlyZeroInitTestCodeCompute);
diff --git a/src/tests/end2end/SwapChainValidationTests.cpp b/src/tests/end2end/SwapChainValidationTests.cpp
index 624b09d..77180db 100644
--- a/src/tests/end2end/SwapChainValidationTests.cpp
+++ b/src/tests/end2end/SwapChainValidationTests.cpp
@@ -152,7 +152,7 @@
// Checks that the creation usage must be RenderAttachment
TEST_P(SwapChainValidationTests, InvalidCreationUsage) {
wgpu::SwapChainDescriptor desc = goodDescriptor;
- desc.usage = wgpu::TextureUsage::Sampled;
+ desc.usage = wgpu::TextureUsage::TextureBinding;
ASSERT_DEVICE_ERROR(device.CreateSwapChain(surface, &desc));
}
diff --git a/src/tests/end2end/Texture3DTests.cpp b/src/tests/end2end/Texture3DTests.cpp
index 307f698..95b94c2 100644
--- a/src/tests/end2end/Texture3DTests.cpp
+++ b/src/tests/end2end/Texture3DTests.cpp
@@ -67,7 +67,7 @@
descriptor.dimension = wgpu::TextureDimension::e3D;
descriptor.size = copySize;
descriptor.format = kFormat;
- descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding;
wgpu::Texture texture = device.CreateTexture(&descriptor);
wgpu::TextureView textureView = texture.CreateView();
diff --git a/src/tests/end2end/TextureFormatTests.cpp b/src/tests/end2end/TextureFormatTests.cpp
index 31ba1dc..f24d309 100644
--- a/src/tests/end2end/TextureFormatTests.cpp
+++ b/src/tests/end2end/TextureFormatTests.cpp
@@ -198,7 +198,7 @@
// Create the texture we will sample from
wgpu::TextureDescriptor sampleTextureDesc;
- sampleTextureDesc.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ sampleTextureDesc.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding;
sampleTextureDesc.size = {width, 1, 1};
sampleTextureDesc.format = sampleFormatInfo.format;
wgpu::Texture sampleTexture = device.CreateTexture(&sampleTextureDesc);
diff --git a/src/tests/end2end/TextureSubresourceTests.cpp b/src/tests/end2end/TextureSubresourceTests.cpp
index 16e6b40..0dba5c0 100644
--- a/src/tests/end2end/TextureSubresourceTests.cpp
+++ b/src/tests/end2end/TextureSubresourceTests.cpp
@@ -144,7 +144,7 @@
// Create a texture with 2 mipmap levels and 1 layer
wgpu::Texture texture =
CreateTexture(2, 1,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::CopySrc);
// Create two views on different mipmap levels.
@@ -172,7 +172,7 @@
// Create a texture with 1 mipmap level and 2 layers
wgpu::Texture texture =
CreateTexture(1, 2,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
+ wgpu::TextureUsage::TextureBinding | 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 f38a4d9..494ddc9 100644
--- a/src/tests/end2end/TextureViewTests.cpp
+++ b/src/tests/end2end/TextureViewTests.cpp
@@ -125,7 +125,7 @@
const uint32_t textureWidthLevel0 = 1 << mipLevelCount;
const uint32_t textureHeightLevel0 = 1 << mipLevelCount;
constexpr wgpu::TextureUsage kUsage =
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding;
mTexture = Create2DTexture(device, textureWidthLevel0, textureHeightLevel0, arrayLayerCount,
mipLevelCount, kUsage);
@@ -684,7 +684,7 @@
TEST_P(TextureViewTest, DestroyedTexture) {
wgpu::TextureDescriptor descriptor;
descriptor.size = {4, 4, 2};
- descriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopyDst;
+ descriptor.usage = wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopyDst;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
wgpu::Texture texture = device.CreateTexture(&descriptor);
@@ -707,7 +707,8 @@
// Test that 3D textures and 3D texture views can be created successfully
TEST_P(TextureView3DTest, BasicTest) {
- wgpu::Texture texture = Create3DTexture(device, {4, 4, 4}, 3, wgpu::TextureUsage::Sampled);
+ wgpu::Texture texture =
+ Create3DTexture(device, {4, 4, 4}, 3, wgpu::TextureUsage::TextureBinding);
wgpu::TextureView view = texture.CreateView();
}
diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp
index 78cbc43..56084a3 100644
--- a/src/tests/end2end/TextureZeroInitTests.cpp
+++ b/src/tests/end2end/TextureZeroInitTests.cpp
@@ -269,10 +269,11 @@
// This tests CopyBufferToTexture fully overwrites copy so lazy init is not needed.
TEST_P(TextureZeroInitTest, CopyBufferToTexture) {
- wgpu::TextureDescriptor descriptor = CreateTextureDescriptor(
- 4, 1,
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc,
- kColorFormat);
+ wgpu::TextureDescriptor descriptor =
+ CreateTextureDescriptor(4, 1,
+ wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::CopySrc,
+ kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
std::vector<uint8_t> data(kFormatBlockByteSize * kSize * kSize, 100);
@@ -300,10 +301,11 @@
// Test for a copy only to a subset of the subresource, lazy init is necessary to clear the other
// half.
TEST_P(TextureZeroInitTest, CopyBufferToTextureHalf) {
- wgpu::TextureDescriptor descriptor = CreateTextureDescriptor(
- 4, 1,
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc,
- kColorFormat);
+ wgpu::TextureDescriptor descriptor =
+ CreateTextureDescriptor(4, 1,
+ wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::CopySrc,
+ kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
std::vector<uint8_t> data(kFormatBlockByteSize * kSize * kSize, 100);
@@ -371,7 +373,7 @@
// This tests CopyTextureToTexture fully overwrites copy so lazy init is not needed.
TEST_P(TextureZeroInitTest, CopyTextureToTexture) {
wgpu::TextureDescriptor srcDescriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc, kColorFormat);
+ 1, 1, wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopySrc, kColorFormat);
wgpu::Texture srcTexture = device.CreateTexture(&srcDescriptor);
wgpu::ImageCopyTexture srcImageCopyTexture =
@@ -407,10 +409,11 @@
// This Tests the CopyTextureToTexture's copy only to a subset of the subresource, lazy init is
// necessary to clear the other half.
TEST_P(TextureZeroInitTest, CopyTextureToTextureHalf) {
- wgpu::TextureDescriptor srcDescriptor = CreateTextureDescriptor(
- 1, 1,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst,
- kColorFormat);
+ wgpu::TextureDescriptor srcDescriptor =
+ CreateTextureDescriptor(1, 1,
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopySrc |
+ wgpu::TextureUsage::CopyDst,
+ kColorFormat);
wgpu::Texture srcTexture = device.CreateTexture(&srcDescriptor);
// fill srcTexture with 100
@@ -850,7 +853,7 @@
TEST_P(TextureZeroInitTest, RenderPassSampledTextureClear) {
// Create needed resources
wgpu::TextureDescriptor descriptor =
- CreateTextureDescriptor(1, 1, wgpu::TextureUsage::Sampled, kColorFormat);
+ CreateTextureDescriptor(1, 1, wgpu::TextureUsage::TextureBinding, kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
wgpu::TextureDescriptor renderTextureDescriptor = CreateTextureDescriptor(
@@ -900,7 +903,7 @@
// Create a 2D array texture, layer 0 will be used as attachment, layer 1 as sampled.
wgpu::TextureDescriptor texDesc;
- texDesc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
+ texDesc.usage = wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::CopySrc;
texDesc.size = {1, 1, 2};
texDesc.format = wgpu::TextureFormat::RGBA8Unorm;
@@ -954,7 +957,7 @@
TEST_P(TextureZeroInitTest, ComputePassSampledTextureClear) {
// Create needed resources
wgpu::TextureDescriptor descriptor =
- CreateTextureDescriptor(1, 1, wgpu::TextureUsage::Sampled, kColorFormat);
+ CreateTextureDescriptor(1, 1, wgpu::TextureUsage::TextureBinding, kColorFormat);
descriptor.size.width = 1;
descriptor.size.height = 1;
wgpu::Texture texture = device.CreateTexture(&descriptor);
@@ -1121,7 +1124,7 @@
TEST_P(TextureZeroInitTest, RenderPassStoreOpClear) {
// Create needed resources
wgpu::TextureDescriptor descriptor = CreateTextureDescriptor(
- 1, 1, wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopyDst, kColorFormat);
+ 1, 1, wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopyDst, kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
wgpu::TextureDescriptor renderTextureDescriptor = CreateTextureDescriptor(
@@ -1262,10 +1265,11 @@
// Test that if one mip of a texture is initialized and another is uninitialized, lazy clearing the
// uninitialized mip does not clear the initialized mip.
TEST_P(TextureZeroInitTest, PreservesInitializedMip) {
- wgpu::TextureDescriptor sampleTextureDescriptor = CreateTextureDescriptor(
- 2, 1,
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled,
- kColorFormat);
+ wgpu::TextureDescriptor sampleTextureDescriptor =
+ CreateTextureDescriptor(2, 1,
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::TextureBinding,
+ kColorFormat);
wgpu::Texture sampleTexture = device.CreateTexture(&sampleTextureDescriptor);
wgpu::TextureDescriptor renderTextureDescriptor = CreateTextureDescriptor(
@@ -1340,10 +1344,11 @@
// TODO(crbug.com/dawn/593): This test uses glTextureView() which is not supported on OpenGL ES.
DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES());
- wgpu::TextureDescriptor sampleTextureDescriptor = CreateTextureDescriptor(
- 1, 2,
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled,
- kColorFormat);
+ wgpu::TextureDescriptor sampleTextureDescriptor =
+ CreateTextureDescriptor(1, 2,
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::TextureBinding,
+ kColorFormat);
wgpu::Texture sampleTexture = device.CreateTexture(&sampleTextureDescriptor);
wgpu::TextureDescriptor renderTextureDescriptor = CreateTextureDescriptor(
@@ -1493,10 +1498,11 @@
// Test WriteTexture to a subset of the texture, lazy init is necessary to clear the other
// half.
TEST_P(TextureZeroInitTest, WriteTextureHalf) {
- wgpu::TextureDescriptor descriptor = CreateTextureDescriptor(
- 4, 1,
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc,
- kColorFormat);
+ wgpu::TextureDescriptor descriptor =
+ CreateTextureDescriptor(4, 1,
+ wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::CopySrc,
+ kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
@@ -1570,10 +1576,11 @@
// Test WriteTexture to a subset of the subresource, lazy init is necessary to clear the other
// half.
TEST_P(TextureZeroInitTest, WriteTextureArrayHalf) {
- wgpu::TextureDescriptor descriptor = CreateTextureDescriptor(
- 4, 6,
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc,
- kColorFormat);
+ wgpu::TextureDescriptor descriptor =
+ CreateTextureDescriptor(4, 6,
+ wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::CopySrc,
+ kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
constexpr uint32_t kBaseArrayLayer = 2u;
@@ -1649,10 +1656,11 @@
// Test WriteTexture to a subset of the texture at mip level, lazy init is necessary to clear the
// other half.
TEST_P(TextureZeroInitTest, WriteTextureHalfAtMipLevel) {
- wgpu::TextureDescriptor descriptor = CreateTextureDescriptor(
- 4, 1,
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc,
- kColorFormat);
+ wgpu::TextureDescriptor descriptor =
+ CreateTextureDescriptor(4, 1,
+ wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::CopySrc,
+ kColorFormat);
wgpu::Texture texture = device.CreateTexture(&descriptor);
constexpr uint32_t kMipLevel = 2;
@@ -1834,8 +1842,8 @@
// than the virtual mip size)
TEST_P(CompressedTextureZeroInitTest, FullMipCopy) {
wgpu::TextureDescriptor textureDescriptor;
- textureDescriptor.usage =
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::TextureBinding;
textureDescriptor.size = {60, 60, 1};
textureDescriptor.mipLevelCount = 1;
textureDescriptor.format = utils::kBCFormats[0];
@@ -1850,8 +1858,8 @@
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
wgpu::TextureDescriptor textureDescriptor;
- textureDescriptor.usage =
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::TextureBinding;
constexpr static uint32_t kSize = 16;
textureDescriptor.size = {kSize, kSize, 1};
textureDescriptor.mipLevelCount = 1;
@@ -1870,8 +1878,8 @@
DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES());
wgpu::TextureDescriptor textureDescriptor;
- textureDescriptor.usage =
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::TextureBinding;
constexpr static uint32_t kSize = 60;
textureDescriptor.size = {kSize, kSize, 1};
textureDescriptor.mipLevelCount = 3;
@@ -1895,8 +1903,8 @@
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
wgpu::TextureDescriptor textureDescriptor;
- textureDescriptor.usage =
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::TextureBinding;
constexpr static uint32_t kSize = 60;
textureDescriptor.size = {kSize, kSize, 1};
textureDescriptor.mipLevelCount = 3;
@@ -1919,8 +1927,8 @@
DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES());
wgpu::TextureDescriptor textureDescriptor;
- textureDescriptor.usage =
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::TextureBinding;
constexpr static uint32_t kSize = 16;
constexpr static uint32_t kArrayLayers = 4;
textureDescriptor.size = {kSize, kSize, kArrayLayers};
@@ -1939,8 +1947,8 @@
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
wgpu::TextureDescriptor textureDescriptor;
- textureDescriptor.usage =
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled;
+ textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::TextureBinding;
constexpr static uint32_t kSize = 16;
constexpr static uint32_t kArrayLayers = 4;
textureDescriptor.size = {kSize, kSize, kArrayLayers};
@@ -1959,10 +1967,11 @@
DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES());
// create srcTexture and fill it with data
- wgpu::TextureDescriptor srcDescriptor = CreateTextureDescriptor(
- 3, 1,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst,
- utils::kBCFormats[0]);
+ wgpu::TextureDescriptor srcDescriptor =
+ CreateTextureDescriptor(3, 1,
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopySrc |
+ wgpu::TextureUsage::CopyDst,
+ utils::kBCFormats[0]);
wgpu::Texture srcTexture = device.CreateTexture(&srcDescriptor);
const uint32_t kViewMipLevel = 2;
@@ -1980,10 +1989,11 @@
utils::CreateImageCopyTexture(srcTexture, kViewMipLevel, {0, 0, 0});
// create dstTexture that we will copy to
- wgpu::TextureDescriptor dstDescriptor = CreateTextureDescriptor(
- 3, 1,
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::Sampled,
- utils::kBCFormats[0]);
+ wgpu::TextureDescriptor dstDescriptor =
+ CreateTextureDescriptor(3, 1,
+ wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc |
+ wgpu::TextureUsage::TextureBinding,
+ utils::kBCFormats[0]);
wgpu::Texture dstTexture = device.CreateTexture(&dstDescriptor);
wgpu::ImageCopyTexture dstImageCopyTexture =
@@ -2006,10 +2016,11 @@
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
// create srcTexture with data
- wgpu::TextureDescriptor srcDescriptor = CreateTextureDescriptor(
- 3, 1,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst,
- utils::kBCFormats[0]);
+ wgpu::TextureDescriptor srcDescriptor =
+ CreateTextureDescriptor(3, 1,
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopySrc |
+ wgpu::TextureUsage::CopyDst,
+ utils::kBCFormats[0]);
wgpu::Texture srcTexture = device.CreateTexture(&srcDescriptor);
const uint32_t kViewMipLevel = 2;
@@ -2027,10 +2038,11 @@
utils::CreateImageCopyTexture(srcTexture, kViewMipLevel, {0, 0, 0});
// create dstTexture that we will copy to
- wgpu::TextureDescriptor dstDescriptor = CreateTextureDescriptor(
- 3, 1,
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::Sampled,
- utils::kBCFormats[0]);
+ wgpu::TextureDescriptor dstDescriptor =
+ CreateTextureDescriptor(3, 1,
+ wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc |
+ wgpu::TextureUsage::TextureBinding,
+ utils::kBCFormats[0]);
wgpu::Texture dstTexture = device.CreateTexture(&dstDescriptor);
wgpu::ImageCopyTexture dstImageCopyTexture =
diff --git a/src/tests/perf_tests/SubresourceTrackingPerf.cpp b/src/tests/perf_tests/SubresourceTrackingPerf.cpp
index c238a49..adabd54 100644
--- a/src/tests/perf_tests/SubresourceTrackingPerf.cpp
+++ b/src/tests/perf_tests/SubresourceTrackingPerf.cpp
@@ -57,8 +57,8 @@
materialDesc.size = {1u << (params.mipLevelCount - 1), 1u << (params.mipLevelCount - 1),
params.arrayLayerCount};
materialDesc.mipLevelCount = params.mipLevelCount;
- materialDesc.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
- wgpu::TextureUsage::CopyDst;
+ materialDesc.usage = wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::CopyDst;
materialDesc.format = wgpu::TextureFormat::RGBA8Unorm;
mMaterials = device.CreateTexture(&materialDesc);
diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp
index 305e229..ca469c1 100644
--- a/src/tests/unittests/validation/BindGroupValidationTests.cpp
+++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp
@@ -53,7 +53,8 @@
}
{ mSampler = device.CreateSampler(); }
{
- mSampledTexture = CreateTexture(wgpu::TextureUsage::Sampled, kDefaultTextureFormat, 1);
+ mSampledTexture =
+ CreateTexture(wgpu::TextureUsage::TextureBinding, kDefaultTextureFormat, 1);
mSampledTextureView = mSampledTexture.CreateView();
wgpu::ExternalTextureDescriptor externalTextureDesc;
@@ -306,7 +307,8 @@
// Check that an external texture binding must contain exactly an external texture
TEST_F(BindGroupValidationTest, ExternalTextureBindingType) {
// Create an external texture
- wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::Sampled, kDefaultTextureFormat, 1);
+ wgpu::Texture texture =
+ CreateTexture(wgpu::TextureUsage::TextureBinding, kDefaultTextureFormat, 1);
wgpu::ExternalTextureDescriptor externalDesc;
externalDesc.plane0 = texture.CreateView();
externalDesc.format = kDefaultTextureFormat;
@@ -414,7 +416,7 @@
descriptor.size = {16, 16, 1};
descriptor.sampleCount = 1;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::Storage;
+ descriptor.usage = wgpu::TextureUsage::StorageBinding;
descriptor.format = wgpu::TextureFormat::RGBA8Uint;
wgpu::TextureView view = device.CreateTexture(&descriptor).CreateView();
@@ -423,7 +425,7 @@
utils::MakeBindGroup(device, layout, {{0, view}});
// Sampled texture is invalid with storage buffer binding
- descriptor.usage = wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::TextureBinding;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
view = device.CreateTexture(&descriptor).CreateView();
ASSERT_DEVICE_ERROR(utils::MakeBindGroup(device, layout, {{0, view}}));
@@ -444,7 +446,7 @@
wgpu::TextureDescriptor descriptor;
descriptor.size = {4, 4, 1};
- descriptor.usage = wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::TextureBinding;
descriptor.format = format;
wgpu::TextureView view = device.CreateTexture(&descriptor).CreateView();
@@ -502,7 +504,7 @@
wgpu::TextureDescriptor desc;
desc.size = {1, 1, 1};
- desc.usage = wgpu::TextureUsage::Sampled;
+ desc.usage = wgpu::TextureUsage::TextureBinding;
// Depth32Float is allowed to be sampled.
{
@@ -547,7 +549,7 @@
// Make a 2DArray texture and try to set it to a 2D binding.
wgpu::Texture arrayTexture =
- CreateTexture(wgpu::TextureUsage::Sampled, wgpu::TextureFormat::RGBA8Uint, 2);
+ CreateTexture(wgpu::TextureUsage::TextureBinding, wgpu::TextureFormat::RGBA8Uint, 2);
wgpu::TextureView arrayTextureView = arrayTexture.CreateView();
ASSERT_DEVICE_ERROR(utils::MakeBindGroup(device, layout, {{0, arrayTextureView}}));
@@ -649,7 +651,7 @@
// Control case: setting a multisampled 2D texture works
wgpu::TextureDescriptor textureDesc;
textureDesc.sampleCount = 4;
- textureDesc.usage = wgpu::TextureUsage::Sampled;
+ textureDesc.usage = wgpu::TextureUsage::TextureBinding;
textureDesc.dimension = wgpu::TextureDimension::e2D;
textureDesc.format = wgpu::TextureFormat::RGBA8Unorm;
textureDesc.size = {1, 1, 1};
diff --git a/src/tests/unittests/validation/CopyCommandsValidationTests.cpp b/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
index 061b58e..ac885a5 100644
--- a/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
+++ b/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
@@ -548,8 +548,8 @@
wgpu::Buffer vertex = CreateBuffer(16 * 4, wgpu::BufferUsage::Vertex);
wgpu::Texture destination =
Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm, wgpu::TextureUsage::CopyDst);
- wgpu::Texture sampled =
- Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::Texture sampled = Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm,
+ wgpu::TextureUsage::TextureBinding);
// Incorrect source usage
TestB2TCopy(utils::Expectation::Failure, vertex, 0, 256, 4, destination, 0, {0, 0, 0},
@@ -1161,8 +1161,8 @@
uint64_t bufferSize = BufferSizeForTextureCopy(4, 4, 1);
wgpu::Texture source =
Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm, wgpu::TextureUsage::CopySrc);
- wgpu::Texture sampled =
- Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::Texture sampled = Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm,
+ wgpu::TextureUsage::TextureBinding);
wgpu::Buffer destination = CreateBuffer(bufferSize, wgpu::BufferUsage::CopyDst);
wgpu::Buffer vertex = CreateBuffer(bufferSize, wgpu::BufferUsage::Vertex);
@@ -2028,8 +2028,9 @@
uint32_t mipmapLevels = 1,
uint32_t width = kWidth,
uint32_t height = kHeight) {
- constexpr wgpu::TextureUsage kUsage =
- wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::Sampled;
+ constexpr wgpu::TextureUsage kUsage = wgpu::TextureUsage::CopyDst |
+ wgpu::TextureUsage::CopySrc |
+ wgpu::TextureUsage::TextureBinding;
constexpr uint32_t kArrayLayers = 1;
return CopyCommandTest::Create2DTexture(width, height, mipmapLevels, kArrayLayers, format,
kUsage, 1);
diff --git a/src/tests/unittests/validation/CopyTextureForBrowserTests.cpp b/src/tests/unittests/validation/CopyTextureForBrowserTests.cpp
index ad93f7d..a242625 100644
--- a/src/tests/unittests/validation/CopyTextureForBrowserTests.cpp
+++ b/src/tests/unittests/validation/CopyTextureForBrowserTests.cpp
@@ -71,7 +71,7 @@
TEST_F(CopyTextureForBrowserTest, Success) {
wgpu::Texture source =
Create2DTexture(16, 16, 5, 4, wgpu::TextureFormat::RGBA8Unorm,
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::Sampled);
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::TextureBinding);
wgpu::Texture destination =
Create2DTexture(16, 16, 5, 4, wgpu::TextureFormat::RGBA8Unorm,
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment);
@@ -127,7 +127,7 @@
TEST_F(CopyTextureForBrowserTest, IncorrectUsage) {
wgpu::Texture validSource =
Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm,
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::Sampled);
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::TextureBinding);
wgpu::Texture validDestination =
Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm,
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment);
@@ -135,8 +135,8 @@
Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm, wgpu::TextureUsage::CopySrc);
wgpu::Texture noRenderAttachmentUsageDestination =
Create2DTexture(16, 16, 5, 2, wgpu::TextureFormat::RGBA8Unorm, wgpu::TextureUsage::CopyDst);
- wgpu::Texture noCopySrcUsageSource =
- Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::Texture noCopySrcUsageSource = Create2DTexture(
+ 16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::Texture noCopyDstUsageSource = Create2DTexture(
16, 16, 5, 2, wgpu::TextureFormat::RGBA8Unorm, wgpu::TextureUsage::RenderAttachment);
@@ -161,7 +161,7 @@
TEST_F(CopyTextureForBrowserTest, OutOfBounds) {
wgpu::Texture source =
Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm,
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::Sampled);
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::TextureBinding);
wgpu::Texture destination =
Create2DTexture(16, 16, 5, 4, wgpu::TextureFormat::RGBA8Unorm,
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment);
@@ -221,7 +221,7 @@
TEST_F(CopyTextureForBrowserTest, InvalidDstFormat) {
wgpu::Texture source =
Create2DTexture(16, 16, 5, 1, wgpu::TextureFormat::RGBA8Unorm,
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::Sampled);
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::TextureBinding);
wgpu::Texture destination =
Create2DTexture(16, 16, 5, 2, wgpu::TextureFormat::RG8Uint,
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment);
@@ -235,13 +235,13 @@
TEST_F(CopyTextureForBrowserTest, InvalidSampleCount) {
wgpu::Texture sourceMultiSampled1x =
Create2DTexture(16, 16, 1, 1, wgpu::TextureFormat::RGBA8Unorm,
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::Sampled, 1);
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::TextureBinding, 1);
wgpu::Texture destinationMultiSampled1x =
Create2DTexture(16, 16, 1, 1, wgpu::TextureFormat::RGBA8Unorm,
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment, 1);
wgpu::Texture sourceMultiSampled4x =
Create2DTexture(16, 16, 1, 1, wgpu::TextureFormat::RGBA8Unorm,
- wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::Sampled, 4);
+ wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::TextureBinding, 4);
wgpu::Texture destinationMultiSampled4x =
Create2DTexture(16, 16, 1, 1, wgpu::TextureFormat::RGBA8Unorm,
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment, 4);
diff --git a/src/tests/unittests/validation/ExternalTextureTests.cpp b/src/tests/unittests/validation/ExternalTextureTests.cpp
index 6eb8f36..c484d5c 100644
--- a/src/tests/unittests/validation/ExternalTextureTests.cpp
+++ b/src/tests/unittests/validation/ExternalTextureTests.cpp
@@ -29,7 +29,8 @@
descriptor.sampleCount = kDefaultSampleCount;
descriptor.dimension = wgpu::TextureDimension::e2D;
descriptor.format = kDefaultTextureFormat;
- descriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment;
+ descriptor.usage =
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment;
return descriptor;
}
@@ -88,7 +89,8 @@
ASSERT_DEVICE_ERROR(device.CreateExternalTexture(&externalDesc));
}
- // Creating an external texture from a texture without TextureUsage::Sampled should fail.
+ // Creating an external texture from a texture without TextureUsage::TextureBinding should
+ // fail.
{
textureDescriptor.mipLevelCount = 2;
wgpu::Texture internalTexture = device.CreateTexture(&textureDescriptor);
diff --git a/src/tests/unittests/validation/InternalUsageValidationTests.cpp b/src/tests/unittests/validation/InternalUsageValidationTests.cpp
index e640e63..27ca9fc 100644
--- a/src/tests/unittests/validation/InternalUsageValidationTests.cpp
+++ b/src/tests/unittests/validation/InternalUsageValidationTests.cpp
@@ -108,7 +108,7 @@
// Internal usage adds storage usage which is invalid
// with multisampling.
- internalDesc.internalUsage = wgpu::TextureUsage::Storage;
+ internalDesc.internalUsage = wgpu::TextureUsage::StorageBinding;
ASSERT_DEVICE_ERROR(device.CreateTexture(&textureDesc));
}
}
diff --git a/src/tests/unittests/validation/QueueSubmitValidationTests.cpp b/src/tests/unittests/validation/QueueSubmitValidationTests.cpp
index 3f5ad4b..684670e 100644
--- a/src/tests/unittests/validation/QueueSubmitValidationTests.cpp
+++ b/src/tests/unittests/validation/QueueSubmitValidationTests.cpp
@@ -309,7 +309,7 @@
wgpu::TextureDescriptor texDesc;
texDesc.size = {1, 1, 1};
- texDesc.usage = wgpu::TextureUsage::Sampled;
+ texDesc.usage = wgpu::TextureUsage::TextureBinding;
texDesc.format = wgpu::TextureFormat::RGBA8Unorm;
// Test that completely unused bindgroups still have their buffers checked.
diff --git a/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp b/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp
index 6cbcfa5..d5eb8e8 100644
--- a/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp
+++ b/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp
@@ -225,7 +225,7 @@
const uint64_t dataSize =
utils::RequiredBytesInCopy(256, 0, {4, 4, 1}, wgpu::TextureFormat::RGBA8Unorm);
wgpu::Texture sampled = Create2DTexture({16, 16, 1}, 5, wgpu::TextureFormat::RGBA8Unorm,
- wgpu::TextureUsage::Sampled);
+ wgpu::TextureUsage::TextureBinding);
// Incorrect destination usage
ASSERT_DEVICE_ERROR(
diff --git a/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp b/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp
index abbc379..db47704 100644
--- a/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp
+++ b/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp
@@ -144,7 +144,7 @@
// Error case: using a texture with Sampled is invalid.
{
wgpu::TextureDescriptor texDesc;
- texDesc.usage = wgpu::TextureUsage::Sampled;
+ texDesc.usage = wgpu::TextureUsage::TextureBinding;
texDesc.size = {1, 1, 1};
texDesc.format = wgpu::TextureFormat::RGBA8Unorm;
wgpu::Texture sampledTex = device.CreateTexture(&texDesc);
@@ -365,7 +365,7 @@
// Error case: using a texture with Sampled is invalid.
{
wgpu::TextureDescriptor texDesc;
- texDesc.usage = wgpu::TextureUsage::Sampled;
+ texDesc.usage = wgpu::TextureUsage::TextureBinding;
texDesc.size = {1, 1, 1};
texDesc.format = wgpu::TextureFormat::Depth32Float;
wgpu::Texture sampledTex = device.CreateTexture(&texDesc);
diff --git a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
index 77e0df1..58ab3ed 100644
--- a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
+++ b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
@@ -818,7 +818,7 @@
TEST_F(ResourceUsageTrackingTest, TextureWithMultipleReadUsages) {
// Create a texture that will be used as both sampled and readonly storage texture
wgpu::Texture texture =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::Storage);
+ CreateTexture(wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::StorageBinding);
wgpu::TextureView view = texture.CreateView();
// Create a bind group to use the texture as sampled and readonly storage bindings
@@ -865,8 +865,8 @@
// Test render pass
{
// Create a texture
- wgpu::Texture texture =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
+ wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view = texture.CreateView();
// Create a bind group to use the texture as sampled binding
@@ -888,8 +888,8 @@
// Test compute pass
{
// Create a texture
- wgpu::Texture texture =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::Storage);
+ wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::StorageBinding);
wgpu::TextureView view = texture.CreateView();
// Create a bind group to use the texture as sampled and writeonly bindings
@@ -931,8 +931,8 @@
// Test render pass
{
// Create a texture
- wgpu::Texture texture =
- CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::RenderAttachment);
+ wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::StorageBinding |
+ wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view = texture.CreateView();
// Create a bind group to use the texture as writeonly storage binding
@@ -971,7 +971,7 @@
// Test compute pass
{
// Create a texture
- wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::Storage);
+ wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::StorageBinding);
wgpu::TextureView view = texture.CreateView();
// Create a bind group to use the texture as sampled and writeonly bindings
@@ -1066,11 +1066,11 @@
// Test render pass
{
// Create textures that will be used as both a sampled texture and a render target
- wgpu::Texture t0 =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
+ wgpu::Texture t0 = CreateTexture(wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView v0 = t0.CreateView();
- wgpu::Texture t1 =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
+ wgpu::Texture t1 = CreateTexture(wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView v1 = t1.CreateView();
// Create bind groups to use the texture as sampled
@@ -1100,7 +1100,7 @@
// Test compute pass
{
// Create a texture that will be used storage texture
- wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::Storage);
+ wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::StorageBinding);
wgpu::TextureView view = texture.CreateView();
// Create bind groups to use the texture as readonly and writeonly bindings
@@ -1134,7 +1134,7 @@
// Test compute pass and render pass mixed together with resource dependency
{
// Create a texture that will be used a storage texture
- wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::Storage);
+ wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::StorageBinding);
wgpu::TextureView view = texture.CreateView();
// Create bind groups to use the texture as readonly and writeonly bindings
@@ -1174,7 +1174,7 @@
TEST_F(ResourceUsageTrackingTest, TextureWithReadAndWriteUsageOnDifferentDrawsOrDispatches) {
// Create a texture that will be used both as a sampled texture and a storage texture
wgpu::Texture texture =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::Storage);
+ CreateTexture(wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::StorageBinding);
wgpu::TextureView view = texture.CreateView();
// Test render pass
@@ -1251,7 +1251,7 @@
TEST_F(ResourceUsageTrackingTest, TextureWithReadAndWriteUsageInSingleDrawOrDispatch) {
// Create a texture that will be used both as a sampled texture and a storage texture
wgpu::Texture texture =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::Storage);
+ CreateTexture(wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::StorageBinding);
wgpu::TextureView view = texture.CreateView();
// Test render pass
@@ -1323,7 +1323,7 @@
// Create textures that will be used as both a sampled texture and a render target
wgpu::Texture texture0 = CreateTexture(wgpu::TextureUsage::CopySrc);
wgpu::Texture texture1 =
- CreateTexture(wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled |
+ CreateTexture(wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::TextureBinding |
wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view0 = texture0.CreateView();
wgpu::TextureView view1 = texture1.CreateView();
@@ -1368,11 +1368,11 @@
// Test render pass
{
// Create textures that will be used as both a sampled texture and a render target
- wgpu::Texture texture0 =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
+ wgpu::Texture texture0 = CreateTexture(wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view0 = texture0.CreateView();
- wgpu::Texture texture1 =
- CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
+ wgpu::Texture texture1 = CreateTexture(wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view1 = texture1.CreateView();
// Create the bind group to use the texture as sampled
@@ -1411,9 +1411,9 @@
// Test compute pass
{
// Create a texture that will be used both as storage texture
- wgpu::Texture texture0 = CreateTexture(wgpu::TextureUsage::Storage);
+ wgpu::Texture texture0 = CreateTexture(wgpu::TextureUsage::StorageBinding);
wgpu::TextureView view0 = texture0.CreateView();
- wgpu::Texture texture1 = CreateTexture(wgpu::TextureUsage::Storage);
+ wgpu::Texture texture1 = CreateTexture(wgpu::TextureUsage::StorageBinding);
wgpu::TextureView view1 = texture1.CreateView();
// Create the bind group to use the texture as readonly and writeonly bindings
@@ -1472,7 +1472,7 @@
// visible to the programmable pass where it is used.
TEST_F(ResourceUsageTrackingTest, TextureUsageConflictBetweenInvisibleStagesInBindGroup) {
// Create texture and texture view
- wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::Storage);
+ wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::StorageBinding);
wgpu::TextureView view = texture.CreateView();
// Test render pass for bind group. The conflict of readonly storage and writeonly storage
@@ -1532,8 +1532,8 @@
// visible to the programmable pass where it is used.
TEST_F(ResourceUsageTrackingTest, TextureUsageConflictWithInvisibleStageInBindGroup) {
// Create texture and texture view
- wgpu::Texture texture =
- CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::RenderAttachment);
+ wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::StorageBinding |
+ wgpu::TextureUsage::RenderAttachment);
wgpu::TextureView view = texture.CreateView();
// Test render pass
@@ -1595,7 +1595,7 @@
// used in the pipeline.
TEST_F(ResourceUsageTrackingTest, TextureUsageConflictWithUnusedPipelineBindings) {
// Create texture and texture view
- wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::Storage);
+ wgpu::Texture texture = CreateTexture(wgpu::TextureUsage::StorageBinding);
wgpu::TextureView view = texture.CreateView();
// Create bind groups.
diff --git a/src/tests/unittests/validation/StorageTextureValidationTests.cpp b/src/tests/unittests/validation/StorageTextureValidationTests.cpp
index 3ad1d1d..3a671a2 100644
--- a/src/tests/unittests/validation/StorageTextureValidationTests.cpp
+++ b/src/tests/unittests/validation/StorageTextureValidationTests.cpp
@@ -305,7 +305,7 @@
}
// Validate it is an error to declare a read-only or write-only storage texture in shaders with any
-// format that doesn't support TextureUsage::Storage texture usages.
+// format that doesn't support TextureUsage::StorageBinding texture usages.
TEST_F(StorageTextureValidationTests, StorageTextureFormatInShaders) {
// Not include RGBA8UnormSrgb, BGRA8Unorm, BGRA8UnormSrgb because they are not related to any
// SPIR-V Image Formats.
@@ -625,19 +625,20 @@
// Texture views are allowed to be used as storage textures in a bind group.
{
wgpu::TextureView textureView =
- CreateTexture(wgpu::TextureUsage::Storage, kStorageTextureFormat).CreateView();
+ CreateTexture(wgpu::TextureUsage::StorageBinding, kStorageTextureFormat)
+ .CreateView();
utils::MakeBindGroup(device, bindGroupLayout, {{0, textureView}});
}
}
}
// Verify that a texture used as read-only or write-only storage texture in a bind group must be
-// created with the texture usage wgpu::TextureUsage::STORAGE.
+// created with the texture usage wgpu::TextureUsage::StorageBinding.
TEST_F(StorageTextureValidationTests, StorageTextureUsageInBindGroup) {
constexpr wgpu::TextureFormat kStorageTextureFormat = wgpu::TextureFormat::R32Float;
constexpr std::array<wgpu::TextureUsage, 6> kTextureUsages = {
wgpu::TextureUsage::CopySrc, wgpu::TextureUsage::CopyDst,
- wgpu::TextureUsage::Sampled, wgpu::TextureUsage::Storage,
+ wgpu::TextureUsage::TextureBinding, wgpu::TextureUsage::StorageBinding,
wgpu::TextureUsage::RenderAttachment, wgpu::TextureUsage::Present};
for (wgpu::StorageTextureAccess storageBindingType : kSupportedStorageTextureAccess) {
@@ -658,8 +659,8 @@
CreateTexture(usage, kStorageTextureFormat).CreateView();
// Verify that the texture used as storage texture must be created with the texture
- // usage wgpu::TextureUsage::STORAGE.
- if (usage & wgpu::TextureUsage::Storage) {
+ // usage wgpu::TextureUsage::StorageBinding.
+ if (usage & wgpu::TextureUsage::StorageBinding) {
utils::MakeBindGroup(device, bindGroupLayout, {{0, textureView}});
} else {
ASSERT_DEVICE_ERROR(
@@ -698,7 +699,8 @@
// Create texture views with different texture formats.
wgpu::TextureView storageTextureView =
- CreateTexture(wgpu::TextureUsage::Storage, textureViewFormat).CreateView();
+ CreateTexture(wgpu::TextureUsage::StorageBinding, textureViewFormat)
+ .CreateView();
// Verify that the format of the texture view used as storage texture in a bind
// group must match the storage texture format declaration in the bind group layout.
@@ -750,9 +752,10 @@
for (wgpu::TextureViewDimension dimensionOfTextureView : kSupportedDimensions) {
// Create a texture view with given texture view dimension.
- wgpu::Texture texture = CreateTexture(
- wgpu::TextureUsage::Storage, kStorageTextureFormat, 1, kDepthOrArrayLayers,
- utils::ViewDimensionToTextureDimension(dimensionOfTextureView));
+ wgpu::Texture texture =
+ CreateTexture(wgpu::TextureUsage::StorageBinding, kStorageTextureFormat, 1,
+ kDepthOrArrayLayers,
+ utils::ViewDimensionToTextureDimension(dimensionOfTextureView));
wgpu::TextureViewDescriptor textureViewDescriptor = kDefaultTextureViewDescriptor;
textureViewDescriptor.dimension = dimensionOfTextureView;
@@ -784,7 +787,7 @@
// texture in a render pass.
TEST_F(StorageTextureValidationTests, StorageTextureInRenderPass) {
constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
- wgpu::Texture storageTexture = CreateTexture(wgpu::TextureUsage::Storage, kFormat);
+ wgpu::Texture storageTexture = CreateTexture(wgpu::TextureUsage::StorageBinding, kFormat);
wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::RenderAttachment, kFormat);
utils::ComboRenderPassDescriptor renderPassDescriptor({outputAttachment.CreateView()});
@@ -815,8 +818,8 @@
// sampled texture in one render pass.
TEST_F(StorageTextureValidationTests, StorageTextureAndSampledTextureInOneRenderPass) {
constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
- wgpu::Texture storageTexture =
- CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::Sampled, kFormat);
+ wgpu::Texture storageTexture = CreateTexture(
+ wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::TextureBinding, kFormat);
wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::RenderAttachment, kFormat);
utils::ComboRenderPassDescriptor renderPassDescriptor({outputAttachment.CreateView()});
@@ -860,8 +863,8 @@
// and render attachment in one render pass.
TEST_F(StorageTextureValidationTests, StorageTextureAndRenderAttachmentInOneRenderPass) {
constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
- wgpu::Texture storageTexture =
- CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::RenderAttachment, kFormat);
+ wgpu::Texture storageTexture = CreateTexture(
+ wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::RenderAttachment, kFormat);
utils::ComboRenderPassDescriptor renderPassDescriptor({storageTexture.CreateView()});
for (wgpu::StorageTextureAccess storageTextureType : kSupportedStorageTextureAccess) {
@@ -888,7 +891,7 @@
// texture in one render pass.
TEST_F(StorageTextureValidationTests, ReadOnlyAndWriteOnlyStorageTextureInOneRenderPass) {
constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
- wgpu::Texture storageTexture = CreateTexture(wgpu::TextureUsage::Storage, kFormat);
+ wgpu::Texture storageTexture = CreateTexture(wgpu::TextureUsage::StorageBinding, kFormat);
// Create a bind group that uses the same texture as both read-only and write-only storage
// texture.
@@ -918,8 +921,8 @@
// sampled texture in one compute pass.
TEST_F(StorageTextureValidationTests, StorageTextureAndSampledTextureInOneComputePass) {
constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
- wgpu::Texture storageTexture =
- CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::Sampled, kFormat);
+ wgpu::Texture storageTexture = CreateTexture(
+ wgpu::TextureUsage::StorageBinding | wgpu::TextureUsage::TextureBinding, kFormat);
for (wgpu::StorageTextureAccess storageTextureType : kSupportedStorageTextureAccess) {
// Create a bind group that binds the same texture as both storage texture and sampled
@@ -948,7 +951,7 @@
// texture in one compute pass.
TEST_F(StorageTextureValidationTests, ReadOnlyAndWriteOnlyStorageTextureInOneComputePass) {
constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
- wgpu::Texture storageTexture = CreateTexture(wgpu::TextureUsage::Storage, kFormat);
+ wgpu::Texture storageTexture = CreateTexture(wgpu::TextureUsage::StorageBinding, kFormat);
// Create a bind group that uses the same texture as both read-only and write-only storage
// texture.
diff --git a/src/tests/unittests/validation/TextureSubresourceTests.cpp b/src/tests/unittests/validation/TextureSubresourceTests.cpp
index 2169fed..87c0d43 100644
--- a/src/tests/unittests/validation/TextureSubresourceTests.cpp
+++ b/src/tests/unittests/validation/TextureSubresourceTests.cpp
@@ -125,10 +125,10 @@
// Test different mipmap levels
TEST_F(TextureSubresourceTest, MipmapLevelsTest) {
// Create texture with 2 mipmap levels and 1 layer
- wgpu::Texture texture =
- CreateTexture(2, 1,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
- wgpu::TextureUsage::Storage);
+ wgpu::Texture texture = CreateTexture(2, 1,
+ wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::RenderAttachment |
+ wgpu::TextureUsage::StorageBinding);
// Create two views on different mipmap levels.
wgpu::TextureView samplerView = CreateTextureView(texture, 0, 0);
@@ -139,10 +139,10 @@
// Test different array layers
TEST_F(TextureSubresourceTest, ArrayLayersTest) {
// Create texture with 1 mipmap level and 2 layers
- wgpu::Texture texture =
- CreateTexture(1, 2,
- wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
- wgpu::TextureUsage::Storage);
+ wgpu::Texture texture = CreateTexture(1, 2,
+ wgpu::TextureUsage::TextureBinding |
+ wgpu::TextureUsage::RenderAttachment |
+ wgpu::TextureUsage::StorageBinding);
// Create two views on different layers.
wgpu::TextureView samplerView = CreateTextureView(texture, 0, 0);
diff --git a/src/tests/unittests/validation/TextureValidationTests.cpp b/src/tests/unittests/validation/TextureValidationTests.cpp
index 2bdfaa7..8036517 100644
--- a/src/tests/unittests/validation/TextureValidationTests.cpp
+++ b/src/tests/unittests/validation/TextureValidationTests.cpp
@@ -44,7 +44,8 @@
descriptor.sampleCount = kDefaultSampleCount;
descriptor.dimension = wgpu::TextureDimension::e2D;
descriptor.format = kDefaultTextureFormat;
- descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::Sampled;
+ descriptor.usage =
+ wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::TextureBinding;
return descriptor;
}
@@ -133,11 +134,11 @@
ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor));
}
- // It is an error to set TextureUsage::Storage when sampleCount > 1.
+ // It is an error to set TextureUsage::StorageBinding when sampleCount > 1.
{
wgpu::TextureDescriptor descriptor = defaultDescriptor;
descriptor.sampleCount = 4;
- descriptor.usage |= wgpu::TextureUsage::Storage;
+ descriptor.usage |= wgpu::TextureUsage::StorageBinding;
ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor));
}
@@ -507,11 +508,11 @@
}
// Test it is an error to create a Storage texture with any format that doesn't support
- // TextureUsage::Storage texture usages.
+ // TextureUsage::StorageBinding texture usages.
TEST_F(TextureValidationTest, TextureFormatNotSupportTextureUsageStorage) {
wgpu::TextureDescriptor descriptor;
descriptor.size = {1, 1, 1};
- descriptor.usage = wgpu::TextureUsage::Storage;
+ descriptor.usage = wgpu::TextureUsage::StorageBinding;
for (wgpu::TextureFormat format : utils::kAllTextureFormats) {
descriptor.format = format;
@@ -554,7 +555,7 @@
wgpu::TextureDescriptor descriptor =
TextureValidationTest::CreateDefaultTextureDescriptor();
descriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst |
- wgpu::TextureUsage::Sampled;
+ wgpu::TextureUsage::TextureBinding;
return descriptor;
}
};
@@ -601,7 +602,7 @@
TEST_F(CompressedTextureFormatsValidationTests, TextureUsage) {
wgpu::TextureUsage invalidUsages[] = {
wgpu::TextureUsage::RenderAttachment,
- wgpu::TextureUsage::Storage,
+ wgpu::TextureUsage::StorageBinding,
wgpu::TextureUsage::Present,
};
for (wgpu::TextureFormat format : utils::kBCFormats) {
diff --git a/src/tests/unittests/validation/TextureViewValidationTests.cpp b/src/tests/unittests/validation/TextureViewValidationTests.cpp
index 7f633bf..110062a 100644
--- a/src/tests/unittests/validation/TextureViewValidationTests.cpp
+++ b/src/tests/unittests/validation/TextureViewValidationTests.cpp
@@ -39,7 +39,7 @@
descriptor.sampleCount = sampleCount;
descriptor.format = kDefaultTextureFormat;
descriptor.mipLevelCount = mipLevelCount;
- descriptor.usage = wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::TextureBinding;
return device.CreateTexture(&descriptor);
}
@@ -50,7 +50,7 @@
descriptor.sampleCount = 1;
descriptor.format = kDefaultTextureFormat;
descriptor.mipLevelCount = kDefaultMipLevels;
- descriptor.usage = wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::TextureBinding;
return device.CreateTexture(&descriptor);
}
@@ -523,7 +523,8 @@
TEST_F(TextureViewValidationTest, AspectMustExist) {
wgpu::TextureDescriptor descriptor = {};
descriptor.size = {1, 1, 1};
- descriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment;
+ descriptor.usage =
+ wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment;
// Can select: All and DepthOnly from Depth32Float, but not StencilOnly
{
diff --git a/src/tests/unittests/validation/VideoViewsValidationTests.cpp b/src/tests/unittests/validation/VideoViewsValidationTests.cpp
index 7f346cc..0e313c7 100644
--- a/src/tests/unittests/validation/VideoViewsValidationTests.cpp
+++ b/src/tests/unittests/validation/VideoViewsValidationTests.cpp
@@ -118,10 +118,10 @@
// Test copying from one multi-planar format into another fails.
TEST_F(VideoViewsValidation, T2TCopyAllAspectsFails) {
wgpu::Texture srcTexture = CreateVideoTextureForTest(
- wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::Texture dstTexture = CreateVideoTextureForTest(
- wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::ImageCopyTexture copySrc = utils::CreateImageCopyTexture(srcTexture, 0, {0, 0, 0});
@@ -137,10 +137,10 @@
// Test copying from one multi-planar format into another per plane fails.
TEST_F(VideoViewsValidation, T2TCopyPlaneAspectFails) {
wgpu::Texture srcTexture = CreateVideoTextureForTest(
- wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::Texture dstTexture = CreateVideoTextureForTest(
- wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::ImageCopyTexture copySrc = utils::CreateImageCopyTexture(
srcTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane0Only);
@@ -169,7 +169,7 @@
// Test copying from a multi-planar format to a buffer fails.
TEST_F(VideoViewsValidation, T2BCopyAllAspectsFails) {
wgpu::Texture srcTexture = CreateVideoTextureForTest(
- wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::BufferDescriptor bufferDescriptor;
bufferDescriptor.size = 1;
@@ -190,7 +190,7 @@
// Test copying from multi-planar format per plane to a buffer fails.
TEST_F(VideoViewsValidation, T2BCopyPlaneAspectsFails) {
wgpu::Texture srcTexture = CreateVideoTextureForTest(
- wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::BufferDescriptor bufferDescriptor;
bufferDescriptor.size = 1;
@@ -228,7 +228,7 @@
device, dummyData.data(), dummyData.size(), wgpu::BufferUsage::CopySrc);
wgpu::Texture dstTexture = CreateVideoTextureForTest(
- wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::ImageCopyBuffer copySrc = utils::CreateImageCopyBuffer(srcBuffer, 0, 12, 4);
@@ -249,7 +249,7 @@
device, dummyData.data(), dummyData.size(), wgpu::BufferUsage::CopySrc);
wgpu::Texture dstTexture = CreateVideoTextureForTest(
- wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::ImageCopyBuffer copySrc = utils::CreateImageCopyBuffer(srcBuffer, 0, 12, 4);
@@ -281,7 +281,7 @@
// R8BG8Biplanar420Unorm is allowed to be sampled, if plane 0 or plane 1 is selected.
wgpu::Texture texture = CreateVideoTextureForTest(
- wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::TextureViewDescriptor desc = {};
@@ -302,7 +302,7 @@
// Tests writing into a multi-planar format fails.
TEST_F(VideoViewsValidation, WriteTextureAllAspectsFails) {
wgpu::Texture texture = CreateVideoTextureForTest(
- wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::TextureDataLayout textureDataLayout = utils::CreateTextureDataLayout(0, 4, 4);
@@ -321,7 +321,7 @@
// Tests writing into a multi-planar format per plane fails.
TEST_F(VideoViewsValidation, WriteTexturePlaneAspectsFails) {
wgpu::Texture texture = CreateVideoTextureForTest(
- wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
+ wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::TextureBinding);
wgpu::TextureDataLayout textureDataLayout = utils::CreateTextureDataLayout(0, 12, 4);
wgpu::ImageCopyTexture imageCopyTexture =
diff --git a/src/tests/white_box/D3D12DescriptorHeapTests.cpp b/src/tests/white_box/D3D12DescriptorHeapTests.cpp
index 8d957af..2bd94ed 100644
--- a/src/tests/white_box/D3D12DescriptorHeapTests.cpp
+++ b/src/tests/white_box/D3D12DescriptorHeapTests.cpp
@@ -752,7 +752,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
+ descriptor.usage = wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment |
wgpu::TextureUsage::CopySrc;
wgpu::Texture texture = device.CreateTexture(&descriptor);
wgpu::TextureView textureView = texture.CreateView();
diff --git a/src/tests/white_box/D3D12ResourceHeapTests.cpp b/src/tests/white_box/D3D12ResourceHeapTests.cpp
index 9d38173..722203d 100644
--- a/src/tests/white_box/D3D12ResourceHeapTests.cpp
+++ b/src/tests/white_box/D3D12ResourceHeapTests.cpp
@@ -58,7 +58,7 @@
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::BC1RGBAUnorm;
descriptor.mipLevelCount = 1;
- descriptor.usage = wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::TextureBinding;
// Create a smaller one that allows use of the smaller alignment.
wgpu::Texture texture = device.CreateTexture(&descriptor);
diff --git a/src/tests/white_box/EGLImageWrappingTests.cpp b/src/tests/white_box/EGLImageWrappingTests.cpp
index eeda24a..fdc4a42 100644
--- a/src/tests/white_box/EGLImageWrappingTests.cpp
+++ b/src/tests/white_box/EGLImageWrappingTests.cpp
@@ -203,14 +203,14 @@
// Test an error occurs if the texture usage is not RenderAttachment
TEST_P(EGLImageValidationTests, InvalidTextureUsage) {
DAWN_TEST_UNSUPPORTED_IF(UsesWire());
- descriptor.usage = wgpu::TextureUsage::Sampled;
+ descriptor.usage = wgpu::TextureUsage::TextureBinding;
ScopedEGLImage image = CreateDefaultEGLImage();
wgpu::Texture texture;
ASSERT_DEVICE_ERROR(texture = WrapEGLImage(&descriptor, image.getImage()));
ASSERT_EQ(texture.Get(), nullptr);
- descriptor.usage = wgpu::TextureUsage::Storage;
+ descriptor.usage = wgpu::TextureUsage::StorageBinding;
ASSERT_DEVICE_ERROR(texture = WrapEGLImage(&descriptor, image.getImage()));