mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +00:00
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>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
f99d5aa7d4
commit
27e17a6aad
@@ -53,7 +53,8 @@ class BindGroupValidationTest : public ValidationTest {
|
||||
}
|
||||
{ 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 @@ TEST_F(BindGroupValidationTest, BufferBindingType) {
|
||||
// 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 @@ TEST_F(BindGroupValidationTest, StorageTextureUsage) {
|
||||
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 @@ TEST_F(BindGroupValidationTest, StorageTextureUsage) {
|
||||
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 @@ TEST_F(BindGroupValidationTest, TextureSampleType) {
|
||||
|
||||
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 @@ TEST_F(BindGroupValidationTest, SamplingDepthStencilTexture) {
|
||||
|
||||
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 @@ TEST_F(BindGroupValidationTest, TextureDimension) {
|
||||
|
||||
// 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 @@ TEST_F(BindGroupValidationTest, MultisampledTexture) {
|
||||
// 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};
|
||||
|
||||
@@ -548,8 +548,8 @@ TEST_F(CopyCommandTest_B2T, IncorrectUsage) {
|
||||
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 @@ TEST_F(CopyCommandTest_T2B, IncorrectUsage) {
|
||||
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 @@ class CopyCommandTest_CompressedTextureFormats : public CopyCommandTest {
|
||||
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);
|
||||
|
||||
@@ -71,7 +71,7 @@ class CopyTextureForBrowserTest : public ValidationTest {
|
||||
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, Success) {
|
||||
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 @@ TEST_F(CopyTextureForBrowserTest, IncorrectUsage) {
|
||||
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, IncorrectUsage) {
|
||||
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, OutOfBounds) {
|
||||
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, InvalidDstFormat) {
|
||||
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);
|
||||
|
||||
@@ -29,7 +29,8 @@ namespace {
|
||||
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 @@ namespace {
|
||||
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);
|
||||
|
||||
@@ -108,7 +108,7 @@ TEST_F(TextureInternalUsageValidationTest, UsageValidation) {
|
||||
|
||||
// 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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ namespace {
|
||||
|
||||
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.
|
||||
|
||||
@@ -225,7 +225,7 @@ namespace {
|
||||
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(
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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);
|
||||
|
||||
@@ -818,7 +818,7 @@ namespace {
|
||||
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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
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 @@ namespace {
|
||||
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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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.
|
||||
|
||||
@@ -305,7 +305,7 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutWithStorageTextureBindingTy
|
||||
}
|
||||
|
||||
// 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 @@ TEST_F(StorageTextureValidationTests, StorageTextureBindingTypeInBindGroup) {
|
||||
// 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 @@ TEST_F(StorageTextureValidationTests, StorageTextureUsageInBindGroup) {
|
||||
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 @@ TEST_F(StorageTextureValidationTests, StorageTextureFormatInBindGroup) {
|
||||
|
||||
// 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 @@ TEST_F(StorageTextureValidationTests, StorageTextureViewDimensionInBindGroup) {
|
||||
|
||||
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 @@ TEST_F(StorageTextureValidationTests, MultisampledStorageTexture) {
|
||||
// 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 @@ TEST_F(StorageTextureValidationTests, StorageTextureInRenderPass) {
|
||||
// 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 @@ TEST_F(StorageTextureValidationTests, StorageTextureAndSampledTextureInOneRender
|
||||
// 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 @@ TEST_F(StorageTextureValidationTests, StorageTextureAndRenderAttachmentInOneRend
|
||||
// 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 @@ TEST_F(StorageTextureValidationTests, ReadOnlyAndWriteOnlyStorageTextureInOneRen
|
||||
// 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 @@ TEST_F(StorageTextureValidationTests, StorageTextureAndSampledTextureInOneComput
|
||||
// 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.
|
||||
|
||||
@@ -125,10 +125,10 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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);
|
||||
|
||||
@@ -44,7 +44,8 @@ namespace {
|
||||
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 @@ namespace {
|
||||
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 @@ namespace {
|
||||
}
|
||||
|
||||
// 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 @@ namespace {
|
||||
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 @@ namespace {
|
||||
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) {
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace {
|
||||
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 @@ namespace {
|
||||
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 @@ namespace {
|
||||
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
|
||||
{
|
||||
|
||||
@@ -118,10 +118,10 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
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 @@ namespace {
|
||||
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 @@ namespace {
|
||||
|
||||
// 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 @@ namespace {
|
||||
// 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 @@ namespace {
|
||||
// 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 =
|
||||
|
||||
Reference in New Issue
Block a user