mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +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
@@ -543,11 +543,11 @@ namespace dawn_native {
|
||||
cmd->colorAttachments[index].clearColor =
|
||||
descriptor->colorAttachments[i].clearColor;
|
||||
|
||||
usageTracker.TextureViewUsedAs(view, wgpu::TextureUsage::OutputAttachment);
|
||||
usageTracker.TextureViewUsedAs(view, wgpu::TextureUsage::RenderAttachment);
|
||||
|
||||
if (resolveTarget != nullptr) {
|
||||
usageTracker.TextureViewUsedAs(resolveTarget,
|
||||
wgpu::TextureUsage::OutputAttachment);
|
||||
wgpu::TextureUsage::RenderAttachment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ namespace dawn_native {
|
||||
cmd->depthStencilAttachment.stencilStoreOp =
|
||||
descriptor->depthStencilAttachment->stencilStoreOp;
|
||||
|
||||
usageTracker.TextureViewUsedAs(view, wgpu::TextureUsage::OutputAttachment);
|
||||
usageTracker.TextureViewUsedAs(view, wgpu::TextureUsage::RenderAttachment);
|
||||
}
|
||||
|
||||
cmd->width = width;
|
||||
|
||||
@@ -81,8 +81,8 @@ namespace dawn_native {
|
||||
return DAWN_VALIDATION_ERROR("Format must (currently) be BGRA8Unorm");
|
||||
}
|
||||
|
||||
if (descriptor->usage != wgpu::TextureUsage::OutputAttachment) {
|
||||
return DAWN_VALIDATION_ERROR("Usage must (currently) be OutputAttachment");
|
||||
if (descriptor->usage != wgpu::TextureUsage::RenderAttachment) {
|
||||
return DAWN_VALIDATION_ERROR("Usage must (currently) be RenderAttachment");
|
||||
}
|
||||
|
||||
if (descriptor->width == 0 || descriptor->height == 0) {
|
||||
|
||||
@@ -198,9 +198,9 @@ namespace dawn_native {
|
||||
}
|
||||
|
||||
if (!format->isRenderable &&
|
||||
(descriptor->usage & wgpu::TextureUsage::OutputAttachment)) {
|
||||
(descriptor->usage & wgpu::TextureUsage::RenderAttachment)) {
|
||||
return DAWN_VALIDATION_ERROR(
|
||||
"Non-renderable format used with OutputAttachment usage");
|
||||
"Non-renderable format used with RenderAttachment usage");
|
||||
}
|
||||
|
||||
if (!format->supportsStorageUsage &&
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace dawn_native {
|
||||
|
||||
static constexpr wgpu::TextureUsage kWritableTextureUsages =
|
||||
wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Storage |
|
||||
wgpu::TextureUsage::OutputAttachment;
|
||||
wgpu::TextureUsage::RenderAttachment;
|
||||
|
||||
// Convert the TextureAspect to an Aspect mask for the format. ASSERTs if the aspect
|
||||
// does not exist in the format.
|
||||
|
||||
@@ -629,7 +629,7 @@ namespace dawn_native { namespace d3d12 {
|
||||
// Clear textures that are not output attachments. Output attachments will be
|
||||
// cleared during record render pass if the texture subresource has not been
|
||||
// initialized before the render pass.
|
||||
if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::OutputAttachment)) {
|
||||
if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::RenderAttachment)) {
|
||||
texture->EnsureSubresourceContentInitialized(commandContext,
|
||||
texture->GetAllSubresources());
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace dawn_native { namespace d3d12 {
|
||||
if (allowedUsages & WGPUTextureUsage_Storage) {
|
||||
usage |= DXGI_USAGE_UNORDERED_ACCESS;
|
||||
}
|
||||
if (allowedUsages & WGPUTextureUsage_OutputAttachment) {
|
||||
if (allowedUsages & WGPUTextureUsage_RenderAttachment) {
|
||||
usage |= DXGI_USAGE_RENDER_TARGET_OUTPUT;
|
||||
}
|
||||
return usage;
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace dawn_native { namespace d3d12 {
|
||||
if (usage & wgpu::TextureUsage::Storage) {
|
||||
resourceState |= D3D12_RESOURCE_STATE_UNORDERED_ACCESS;
|
||||
}
|
||||
if (usage & wgpu::TextureUsage::OutputAttachment) {
|
||||
if (usage & wgpu::TextureUsage::RenderAttachment) {
|
||||
if (format.HasDepthOrStencil()) {
|
||||
resourceState |= D3D12_RESOURCE_STATE_DEPTH_WRITE;
|
||||
} else {
|
||||
@@ -79,7 +79,7 @@ namespace dawn_native { namespace d3d12 {
|
||||
// A multisampled resource must have either D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET or
|
||||
// D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL set in D3D12_RESOURCE_DESC::Flags.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/d3d12/ns-d3d12-d3d12_resource_desc
|
||||
if ((usage & wgpu::TextureUsage::OutputAttachment) != 0 || isMultisampledTexture) {
|
||||
if ((usage & wgpu::TextureUsage::RenderAttachment) != 0 || isMultisampledTexture) {
|
||||
if (format.HasDepthOrStencil()) {
|
||||
flags |= D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
|
||||
} else {
|
||||
@@ -864,7 +864,7 @@ namespace dawn_native { namespace d3d12 {
|
||||
uint8_t clearColor = (clearValue == TextureBase::ClearValue::Zero) ? 0 : 1;
|
||||
float fClearColor = (clearValue == TextureBase::ClearValue::Zero) ? 0.f : 1.f;
|
||||
|
||||
if ((GetUsage() & wgpu::TextureUsage::OutputAttachment) != 0) {
|
||||
if ((GetUsage() & wgpu::TextureUsage::RenderAttachment) != 0) {
|
||||
if (GetFormat().HasDepthOrStencil()) {
|
||||
TrackUsageAndTransitionNow(commandContext, D3D12_RESOURCE_STATE_DEPTH_WRITE, range);
|
||||
|
||||
|
||||
@@ -547,7 +547,7 @@ namespace dawn_native { namespace metal {
|
||||
// Clear textures that are not output attachments. Output attachments will be
|
||||
// cleared in CreateMTLRenderPassDescriptor by setting the loadop to clear when the
|
||||
// texture subresource has not been initialized before the render pass.
|
||||
if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::OutputAttachment)) {
|
||||
if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::RenderAttachment)) {
|
||||
texture->EnsureSubresourceContentInitialized(texture->GetAllSubresources());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace dawn_native { namespace metal {
|
||||
size.height = GetHeight();
|
||||
[mLayer setDrawableSize:size];
|
||||
|
||||
[mLayer setFramebufferOnly:(GetUsage() == wgpu::TextureUsage::OutputAttachment)];
|
||||
[mLayer setFramebufferOnly:(GetUsage() == wgpu::TextureUsage::RenderAttachment)];
|
||||
[mLayer setDevice:ToBackend(GetDevice())->GetMTLDevice()];
|
||||
[mLayer setPixelFormat:MetalPixelFormat(GetFormat())];
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace dawn_native { namespace metal {
|
||||
result |= MTLTextureUsageShaderRead;
|
||||
}
|
||||
|
||||
if (usage & (wgpu::TextureUsage::OutputAttachment)) {
|
||||
if (usage & (wgpu::TextureUsage::RenderAttachment)) {
|
||||
result |= MTLTextureUsageRenderTarget;
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ namespace dawn_native { namespace metal {
|
||||
const uint8_t clearColor = (clearValue == TextureBase::ClearValue::Zero) ? 0 : 1;
|
||||
const double dClearColor = (clearValue == TextureBase::ClearValue::Zero) ? 0.0 : 1.0;
|
||||
|
||||
if ((GetUsage() & wgpu::TextureUsage::OutputAttachment) != 0) {
|
||||
if ((GetUsage() & wgpu::TextureUsage::RenderAttachment) != 0) {
|
||||
ASSERT(GetFormat().isRenderable);
|
||||
|
||||
// End the blit encoder if it is open.
|
||||
|
||||
@@ -445,7 +445,7 @@ namespace dawn_native { namespace opengl {
|
||||
// Clear textures that are not output attachments. Output attachments will be
|
||||
// cleared in BeginRenderPass by setting the loadop to clear when the
|
||||
// texture subresource has not been initialized before the render pass.
|
||||
if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::OutputAttachment)) {
|
||||
if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::RenderAttachment)) {
|
||||
texture->EnsureSubresourceContentInitialized(texture->GetAllSubresources());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ namespace dawn_native { namespace vulkan {
|
||||
// Clear textures that are not output attachments. Output attachments will be
|
||||
// cleared in RecordBeginRenderPass by setting the loadop to clear when the
|
||||
// texture subresource has not been initialized before the render pass.
|
||||
if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::OutputAttachment)) {
|
||||
if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::RenderAttachment)) {
|
||||
texture->EnsureSubresourceContentInitialized(recordingContext,
|
||||
texture->GetAllSubresources());
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace dawn_native { namespace vulkan {
|
||||
if (usage & wgpu::TextureUsage::Storage) {
|
||||
flags |= VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
|
||||
}
|
||||
if (usage & wgpu::TextureUsage::OutputAttachment) {
|
||||
if (usage & wgpu::TextureUsage::RenderAttachment) {
|
||||
if (format.HasDepthOrStencil()) {
|
||||
flags |= VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
|
||||
@@ -130,7 +130,7 @@ namespace dawn_native { namespace vulkan {
|
||||
case wgpu::TextureUsage::Storage:
|
||||
case kReadonlyStorageTexture:
|
||||
return VK_IMAGE_LAYOUT_GENERAL;
|
||||
case wgpu::TextureUsage::OutputAttachment:
|
||||
case wgpu::TextureUsage::RenderAttachment:
|
||||
if (format.HasDepthOrStencil()) {
|
||||
return VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||
} else {
|
||||
@@ -168,7 +168,7 @@ namespace dawn_native { namespace vulkan {
|
||||
flags |=
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
|
||||
}
|
||||
if (usage & wgpu::TextureUsage::OutputAttachment) {
|
||||
if (usage & wgpu::TextureUsage::RenderAttachment) {
|
||||
if (format.HasDepthOrStencil()) {
|
||||
flags |= VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
|
||||
VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT;
|
||||
@@ -395,7 +395,7 @@ namespace dawn_native { namespace vulkan {
|
||||
if (usage & wgpu::TextureUsage::Storage) {
|
||||
flags |= VK_IMAGE_USAGE_STORAGE_BIT;
|
||||
}
|
||||
if (usage & wgpu::TextureUsage::OutputAttachment) {
|
||||
if (usage & wgpu::TextureUsage::RenderAttachment) {
|
||||
if (format.HasDepthOrStencil()) {
|
||||
flags |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user