mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +00:00
s/OutputAttachment/RenderAttachment/g
But also keep OutputAttachment so it can be gradually changed in all dependants. See https://github.com/gpuweb/gpuweb/pull/1168 and https://github.com/gpuweb/gpuweb/pull/1168 Bug: dawn:22 Change-Id: I6a1ec1de6c22ca4deac88b7fffde4b98d9d54a84 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31040 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
25eeaa3d39
commit
6b087819dd
@@ -287,7 +287,7 @@ TEST_F(BindGroupValidationTest, TextureUsage) {
|
||||
|
||||
// Make an output attachment texture and try to set it for a SampledTexture binding
|
||||
wgpu::Texture outputTexture =
|
||||
CreateTexture(wgpu::TextureUsage::OutputAttachment, wgpu::TextureFormat::RGBA8Unorm, 1);
|
||||
CreateTexture(wgpu::TextureUsage::RenderAttachment, wgpu::TextureFormat::RGBA8Unorm, 1);
|
||||
wgpu::TextureView outputTextureView = outputTexture.CreateView();
|
||||
ASSERT_DEVICE_ERROR(utils::MakeBindGroup(device, layout, {{0, outputTextureView}}));
|
||||
}
|
||||
|
||||
@@ -800,7 +800,7 @@ TEST_F(CopyCommandTest_B2T, CopyToStencilAspect) {
|
||||
|
||||
wgpu::Texture destination =
|
||||
Create2DTexture(16, 16, 1, 1, wgpu::TextureFormat::Depth24PlusStencil8,
|
||||
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::OutputAttachment);
|
||||
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment);
|
||||
|
||||
TestB2TCopy(utils::Expectation::Failure, source, 0, 256, 0, destination, 0, {0, 0, 0},
|
||||
{15, 15, 1}, wgpu::TextureAspect::StencilOnly);
|
||||
@@ -817,7 +817,7 @@ TEST_F(CopyCommandTest_B2T, CopyToStencilAspect) {
|
||||
|
||||
wgpu::Texture destination =
|
||||
Create2DTexture(16, 16, 2, 1, wgpu::TextureFormat::Depth24PlusStencil8,
|
||||
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::OutputAttachment);
|
||||
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment);
|
||||
|
||||
// Whole mip is success
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, 256, 0, destination, 1, {0, 0, 0},
|
||||
@@ -839,7 +839,7 @@ TEST_F(CopyCommandTest_B2T, CopyToStencilAspect) {
|
||||
|
||||
wgpu::Texture destination =
|
||||
Create2DTexture(17, 17, 2, 1, wgpu::TextureFormat::Depth24PlusStencil8,
|
||||
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::OutputAttachment);
|
||||
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment);
|
||||
|
||||
// Whole mip is success
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, 256, 0, destination, 1, {0, 0, 0},
|
||||
|
||||
@@ -851,7 +851,7 @@ TEST_F(RenderBundleValidationTest, RenderPassColorFormatMismatch) {
|
||||
wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish();
|
||||
|
||||
wgpu::TextureDescriptor textureDesc = {};
|
||||
textureDesc.usage = wgpu::TextureUsage::OutputAttachment;
|
||||
textureDesc.usage = wgpu::TextureUsage::RenderAttachment;
|
||||
textureDesc.size = wgpu::Extent3D({400, 400, 1});
|
||||
|
||||
textureDesc.format = wgpu::TextureFormat::RGBA8Unorm;
|
||||
@@ -921,7 +921,7 @@ TEST_F(RenderBundleValidationTest, RenderPassDepthStencilFormatMismatch) {
|
||||
wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish();
|
||||
|
||||
wgpu::TextureDescriptor textureDesc = {};
|
||||
textureDesc.usage = wgpu::TextureUsage::OutputAttachment;
|
||||
textureDesc.usage = wgpu::TextureUsage::RenderAttachment;
|
||||
textureDesc.size = wgpu::Extent3D({400, 400, 1});
|
||||
|
||||
textureDesc.format = wgpu::TextureFormat::RGBA8Unorm;
|
||||
@@ -978,7 +978,7 @@ TEST_F(RenderBundleValidationTest, RenderPassSampleCountMismatch) {
|
||||
wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish();
|
||||
|
||||
wgpu::TextureDescriptor textureDesc = {};
|
||||
textureDesc.usage = wgpu::TextureUsage::OutputAttachment;
|
||||
textureDesc.usage = wgpu::TextureUsage::RenderAttachment;
|
||||
textureDesc.size = wgpu::Extent3D({400, 400, 1});
|
||||
|
||||
textureDesc.format = wgpu::TextureFormat::RGBA8Unorm;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace {
|
||||
uint32_t arrayLayerCount,
|
||||
uint32_t mipLevelCount,
|
||||
uint32_t sampleCount = 1,
|
||||
wgpu::TextureUsage usage = wgpu::TextureUsage::OutputAttachment) {
|
||||
wgpu::TextureUsage usage = wgpu::TextureUsage::RenderAttachment) {
|
||||
wgpu::TextureDescriptor descriptor;
|
||||
descriptor.dimension = dimension;
|
||||
descriptor.size.width = width;
|
||||
@@ -548,8 +548,8 @@ namespace {
|
||||
}
|
||||
|
||||
// It is not allowed to use a resolve target which is created from a texture whose usage does
|
||||
// not include wgpu::TextureUsage::OutputAttachment.
|
||||
TEST_F(MultisampledRenderPassDescriptorValidationTest, ResolveTargetUsageNoOutputAttachment) {
|
||||
// not include wgpu::TextureUsage::RenderAttachment.
|
||||
TEST_F(MultisampledRenderPassDescriptorValidationTest, ResolveTargetUsageNoRenderAttachment) {
|
||||
constexpr wgpu::TextureUsage kUsage =
|
||||
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc;
|
||||
wgpu::Texture nonColorUsageResolveTexture =
|
||||
|
||||
@@ -229,7 +229,7 @@ TEST_F(RenderPipelineValidationTest, SampleCountCompatibilityWithRenderPass) {
|
||||
baseTextureDescriptor.size.depth = 1;
|
||||
baseTextureDescriptor.mipLevelCount = 1;
|
||||
baseTextureDescriptor.dimension = wgpu::TextureDimension::e2D;
|
||||
baseTextureDescriptor.usage = wgpu::TextureUsage::OutputAttachment;
|
||||
baseTextureDescriptor.usage = wgpu::TextureUsage::RenderAttachment;
|
||||
|
||||
utils::ComboRenderPipelineDescriptor nonMultisampledPipelineDescriptor(device);
|
||||
nonMultisampledPipelineDescriptor.sampleCount = 1;
|
||||
|
||||
@@ -900,7 +900,7 @@ namespace {
|
||||
{
|
||||
// Create a texture
|
||||
wgpu::Texture texture =
|
||||
CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment);
|
||||
CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
|
||||
wgpu::TextureView view = texture.CreateView();
|
||||
|
||||
// Create a bind group to use the texture as sampled binding
|
||||
@@ -969,7 +969,7 @@ namespace {
|
||||
{
|
||||
// Create a texture
|
||||
wgpu::Texture texture =
|
||||
CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::OutputAttachment);
|
||||
CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::RenderAttachment);
|
||||
wgpu::TextureView view = texture.CreateView();
|
||||
|
||||
// Create a bind group to use the texture as writeonly storage binding
|
||||
@@ -1059,10 +1059,10 @@ namespace {
|
||||
{
|
||||
// Create textures that will be used as both a sampled texture and a render target
|
||||
wgpu::Texture t0 =
|
||||
CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment);
|
||||
CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
|
||||
wgpu::TextureView v0 = t0.CreateView();
|
||||
wgpu::Texture t1 =
|
||||
CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment);
|
||||
CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
|
||||
wgpu::TextureView v1 = t1.CreateView();
|
||||
|
||||
// Create bind groups to use the texture as sampled
|
||||
@@ -1312,7 +1312,7 @@ namespace {
|
||||
wgpu::Texture texture0 = CreateTexture(wgpu::TextureUsage::CopySrc);
|
||||
wgpu::Texture texture1 =
|
||||
CreateTexture(wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled |
|
||||
wgpu::TextureUsage::OutputAttachment);
|
||||
wgpu::TextureUsage::RenderAttachment);
|
||||
wgpu::TextureView view0 = texture0.CreateView();
|
||||
wgpu::TextureView view1 = texture1.CreateView();
|
||||
|
||||
@@ -1353,10 +1353,10 @@ namespace {
|
||||
{
|
||||
// Create textures that will be used as both a sampled texture and a render target
|
||||
wgpu::Texture texture0 =
|
||||
CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment);
|
||||
CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
|
||||
wgpu::TextureView view0 = texture0.CreateView();
|
||||
wgpu::Texture texture1 =
|
||||
CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment);
|
||||
CreateTexture(wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment);
|
||||
wgpu::TextureView view1 = texture1.CreateView();
|
||||
|
||||
// Create the bind group to use the texture as sampled
|
||||
@@ -1516,7 +1516,7 @@ namespace {
|
||||
TEST_F(ResourceUsageTrackingTest, TextureUsageConflictWithInvisibleStageInBindGroup) {
|
||||
// Create texture and texture view
|
||||
wgpu::Texture texture =
|
||||
CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::OutputAttachment);
|
||||
CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::RenderAttachment);
|
||||
wgpu::TextureView view = texture.CreateView();
|
||||
|
||||
// Test render pass
|
||||
|
||||
@@ -658,7 +658,7 @@ TEST_F(StorageTextureValidationTests, StorageTextureUsageInBindGroup) {
|
||||
constexpr std::array<wgpu::TextureUsage, 6> kTextureUsages = {
|
||||
wgpu::TextureUsage::CopySrc, wgpu::TextureUsage::CopyDst,
|
||||
wgpu::TextureUsage::Sampled, wgpu::TextureUsage::Storage,
|
||||
wgpu::TextureUsage::OutputAttachment, wgpu::TextureUsage::Present};
|
||||
wgpu::TextureUsage::RenderAttachment, wgpu::TextureUsage::Present};
|
||||
|
||||
for (wgpu::BindingType storageBindingType : kSupportedStorageTextureBindingTypes) {
|
||||
// Create a bind group layout.
|
||||
@@ -800,7 +800,7 @@ TEST_F(StorageTextureValidationTests, StorageTextureInRenderPass) {
|
||||
constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
|
||||
wgpu::Texture storageTexture = CreateTexture(wgpu::TextureUsage::Storage, kFormat);
|
||||
|
||||
wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::OutputAttachment, kFormat);
|
||||
wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::RenderAttachment, kFormat);
|
||||
utils::ComboRenderPassDescriptor renderPassDescriptor({outputAttachment.CreateView()});
|
||||
|
||||
for (wgpu::BindingType storageTextureType : kSupportedStorageTextureBindingTypes) {
|
||||
@@ -831,7 +831,7 @@ TEST_F(StorageTextureValidationTests, StorageTextureAndSampledTextureInOneRender
|
||||
wgpu::Texture storageTexture =
|
||||
CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::Sampled, kFormat);
|
||||
|
||||
wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::OutputAttachment, kFormat);
|
||||
wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::RenderAttachment, kFormat);
|
||||
utils::ComboRenderPassDescriptor renderPassDescriptor({outputAttachment.CreateView()});
|
||||
|
||||
// Create a bind group that contains a storage texture and a sampled texture.
|
||||
@@ -871,10 +871,10 @@ TEST_F(StorageTextureValidationTests, StorageTextureAndSampledTextureInOneRender
|
||||
|
||||
// Verify it is invalid to use a a texture as both storage texture (either read-only or write-only)
|
||||
// and output attachment in one render pass.
|
||||
TEST_F(StorageTextureValidationTests, StorageTextureAndOutputAttachmentInOneRenderPass) {
|
||||
TEST_F(StorageTextureValidationTests, StorageTextureAndRenderAttachmentInOneRenderPass) {
|
||||
constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
|
||||
wgpu::Texture storageTexture =
|
||||
CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::OutputAttachment, kFormat);
|
||||
CreateTexture(wgpu::TextureUsage::Storage | wgpu::TextureUsage::RenderAttachment, kFormat);
|
||||
utils::ComboRenderPassDescriptor renderPassDescriptor({storageTexture.CreateView()});
|
||||
|
||||
for (wgpu::BindingType storageTextureType : kSupportedStorageTextureBindingTypes) {
|
||||
@@ -917,7 +917,7 @@ TEST_F(StorageTextureValidationTests, ReadOnlyAndWriteOnlyStorageTextureInOneRen
|
||||
|
||||
// It is invalid to use a texture as both read-only storage texture and write-only storage
|
||||
// texture in one render pass.
|
||||
wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::OutputAttachment, kFormat);
|
||||
wgpu::Texture outputAttachment = CreateTexture(wgpu::TextureUsage::RenderAttachment, kFormat);
|
||||
utils::ComboRenderPassDescriptor renderPassDescriptor({outputAttachment.CreateView()});
|
||||
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
wgpu::RenderPassEncoder renderPassEncoder = encoder.BeginRenderPass(&renderPassDescriptor);
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace {
|
||||
// Create texture with 2 mipmap levels and 1 layer
|
||||
wgpu::Texture texture =
|
||||
CreateTexture(2, 1,
|
||||
wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment |
|
||||
wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
|
||||
wgpu::TextureUsage::Storage);
|
||||
|
||||
// Create two views on different mipmap levels.
|
||||
@@ -143,7 +143,7 @@ namespace {
|
||||
// Create texture with 1 mipmap level and 2 layers
|
||||
wgpu::Texture texture =
|
||||
CreateTexture(1, 2,
|
||||
wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment |
|
||||
wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment |
|
||||
wgpu::TextureUsage::Storage);
|
||||
|
||||
// Create two views on different layers.
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace {
|
||||
descriptor.sampleCount = kDefaultSampleCount;
|
||||
descriptor.dimension = wgpu::TextureDimension::e2D;
|
||||
descriptor.format = kDefaultTextureFormat;
|
||||
descriptor.usage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::Sampled;
|
||||
descriptor.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::Sampled;
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
@@ -329,11 +329,11 @@ namespace {
|
||||
ASSERT_DEVICE_ERROR(queue.Submit(1, &commands));
|
||||
}
|
||||
|
||||
// Test it is an error to create an OutputAttachment texture with a non-renderable format.
|
||||
TEST_F(TextureValidationTest, NonRenderableAndOutputAttachment) {
|
||||
// Test it is an error to create an RenderAttachment texture with a non-renderable format.
|
||||
TEST_F(TextureValidationTest, NonRenderableAndRenderAttachment) {
|
||||
wgpu::TextureDescriptor descriptor;
|
||||
descriptor.size = {1, 1, 1};
|
||||
descriptor.usage = wgpu::TextureUsage::OutputAttachment;
|
||||
descriptor.usage = wgpu::TextureUsage::RenderAttachment;
|
||||
|
||||
// Succeeds because RGBA8Unorm is renderable
|
||||
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
|
||||
@@ -457,7 +457,7 @@ namespace {
|
||||
// Test that only CopySrc, CopyDst and Sampled are accepted as the texture usage of the
|
||||
// textures in BC formats.
|
||||
wgpu::TextureUsage invalidUsages[] = {
|
||||
wgpu::TextureUsage::OutputAttachment,
|
||||
wgpu::TextureUsage::RenderAttachment,
|
||||
wgpu::TextureUsage::Storage,
|
||||
wgpu::TextureUsage::Present,
|
||||
};
|
||||
|
||||
@@ -348,7 +348,7 @@ namespace {
|
||||
TEST_F(TextureViewValidationTest, AspectMustExist) {
|
||||
wgpu::TextureDescriptor descriptor = {};
|
||||
descriptor.size = {1, 1, 1};
|
||||
descriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::OutputAttachment;
|
||||
descriptor.usage = wgpu::TextureUsage::Sampled | wgpu::TextureUsage::RenderAttachment;
|
||||
|
||||
// Can select: All and DepthOnly from Depth32Float, but not StencilOnly
|
||||
{
|
||||
|
||||
@@ -130,7 +130,7 @@ ValidationTest::DummyRenderPass::DummyRenderPass(const wgpu::Device& device)
|
||||
descriptor.sampleCount = 1;
|
||||
descriptor.format = attachmentFormat;
|
||||
descriptor.mipLevelCount = 1;
|
||||
descriptor.usage = wgpu::TextureUsage::OutputAttachment;
|
||||
descriptor.usage = wgpu::TextureUsage::RenderAttachment;
|
||||
attachment = device.CreateTexture(&descriptor);
|
||||
|
||||
wgpu::TextureView view = attachment.CreateView();
|
||||
|
||||
Reference in New Issue
Block a user