Fix readability/todo issues.

This CL adds names to the TODOs which did not have them and enables
the readability/todo lint. The names are based on the git blame for
the TODO lines.

Bug: dawn:1339
Change-Id: I25a2920bc8fa9606f5dda67a629fdef1c10f8948
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87600
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair 2022-04-21 20:48:11 +00:00 committed by Dawn LUCI CQ
parent b0acbd436d
commit a2e94a5ac3
17 changed files with 16 additions and 63 deletions

View File

@ -1,2 +1 @@
filter=-readability/todo
filter=-runtime/indentation_namespace filter=-runtime/indentation_namespace

View File

@ -83,8 +83,6 @@ class StackAllocator : public std::allocator<T> {
// For this constructor, we cannot share storage; there's // For this constructor, we cannot share storage; there's
// no guarantee that the Source buffer of Ts is large enough // no guarantee that the Source buffer of Ts is large enough
// for Us. // for Us.
// TODO: If we were fancy pants, perhaps we could share storage
// iff sizeof(T) == sizeof(U).
template <typename U, size_t other_capacity> template <typename U, size_t other_capacity>
StackAllocator(const StackAllocator<U, other_capacity>& other) : source_(nullptr) { StackAllocator(const StackAllocator<U, other_capacity>& other) : source_(nullptr) {
} }

View File

@ -126,7 +126,7 @@ std::optional<std::string> GetExecutablePath() {
} }
#elif defined(DAWN_PLATFORM_FUCHSIA) #elif defined(DAWN_PLATFORM_FUCHSIA)
std::optional<std::string> GetExecutablePath() { std::optional<std::string> GetExecutablePath() {
// TODO: Implement on Fuchsia UNIMPLEMENTED();
return {}; return {};
} }
#elif defined(DAWN_PLATFORM_EMSCRIPTEN) #elif defined(DAWN_PLATFORM_EMSCRIPTEN)

View File

@ -69,19 +69,9 @@ namespace dawn::native::d3d12 {
} }
// RESOLVE_MODE_AVERAGE is only valid for non-integer formats. // RESOLVE_MODE_AVERAGE is only valid for non-integer formats.
// TODO: Investigate and determine how integer format resolves should work in WebGPU. ASSERT(resolveDestination->GetFormat().GetAspectInfo(Aspect::Color).baseType ==
switch (resolveDestination->GetFormat().GetAspectInfo(Aspect::Color).baseType) { wgpu::TextureComponentType::Float);
case wgpu::TextureComponentType::Sint:
case wgpu::TextureComponentType::Uint:
resolveParameters.ResolveMode = D3D12_RESOLVE_MODE_MAX;
break;
case wgpu::TextureComponentType::Float:
resolveParameters.ResolveMode = D3D12_RESOLVE_MODE_AVERAGE; resolveParameters.ResolveMode = D3D12_RESOLVE_MODE_AVERAGE;
break;
case wgpu::TextureComponentType::DepthComparison:
UNREACHABLE();
}
resolveParameters.SubresourceCount = 1; resolveParameters.SubresourceCount = 1;

View File

@ -327,8 +327,8 @@ namespace dawn::native::metal {
AcquireNSRef([MTLRenderPipelineDescriptor new]); AcquireNSRef([MTLRenderPipelineDescriptor new]);
MTLRenderPipelineDescriptor* descriptorMTL = descriptorMTLRef.Get(); MTLRenderPipelineDescriptor* descriptorMTL = descriptorMTLRef.Get();
// TODO: MakeVertexDesc should be const in the future, so we don't need to call it here when // TODO(dawn:1384): MakeVertexDesc should be const in the future, so we don't need to call
// vertex pulling is enabled // it here when vertex pulling is enabled
NSRef<MTLVertexDescriptor> vertexDesc = MakeVertexDesc(); NSRef<MTLVertexDescriptor> vertexDesc = MakeVertexDesc();
// Calling MakeVertexDesc first is important since it sets indices for packed bindings // Calling MakeVertexDesc first is important since it sets indices for packed bindings

View File

@ -654,8 +654,6 @@ namespace dawn::native::metal {
// Metal only allows format reinterpretation to happen on swizzle pattern or conversion // Metal only allows format reinterpretation to happen on swizzle pattern or conversion
// between linear space and sRGB. For example, creating bgra8Unorm texture view on // between linear space and sRGB. For example, creating bgra8Unorm texture view on
// rgba8Unorm texture or creating rgba8Unorm_srgb texture view on rgab8Unorm texture. // rgba8Unorm texture or creating rgba8Unorm_srgb texture view on rgab8Unorm texture.
// TODO: add MTLTextureUsagePixelFormatView when needed when we support other format
// reinterpretation.
mtlDesc.usage = MetalTextureUsage(GetFormat(), GetInternalUsage(), GetSampleCount()); mtlDesc.usage = MetalTextureUsage(GetFormat(), GetInternalUsage(), GetSampleCount());
mtlDesc.pixelFormat = MetalPixelFormat(GetFormat().format); mtlDesc.pixelFormat = MetalPixelFormat(GetFormat().format);
mtlDesc.mipmapLevelCount = GetNumMipLevels(); mtlDesc.mipmapLevelCount = GetNumMipLevels();

View File

@ -668,7 +668,6 @@ namespace dawn::native::vulkan {
copy->copySize.depthOrArrayLayers)); copy->copySize.depthOrArrayLayers));
} }
// TODO after Yunchao's CL
ToBackend(src.texture) ToBackend(src.texture)
->TransitionUsageNow(recordingContext, wgpu::TextureUsage::CopySrc, ->TransitionUsageNow(recordingContext, wgpu::TextureUsage::CopySrc,
srcRange); srcRange);

View File

@ -309,7 +309,7 @@ namespace dawn::native::vulkan {
DAWN_TRY_ASSIGN(mConfig, ChooseConfig(surfaceInfo)); DAWN_TRY_ASSIGN(mConfig, ChooseConfig(surfaceInfo));
// TODO Choose config instead of hardcoding // TODO(dawn:269): Choose config instead of hardcoding
VkSwapchainCreateInfoKHR createInfo; VkSwapchainCreateInfoKHR createInfo;
createInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; createInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
createInfo.pNext = nullptr; createInfo.pNext = nullptr;
@ -514,7 +514,8 @@ namespace dawn::native::vulkan {
CommandRecordingContext* recordingContext = device->GetPendingRecordingContext(); CommandRecordingContext* recordingContext = device->GetPendingRecordingContext();
if (mConfig.needsBlit) { if (mConfig.needsBlit) {
// TODO ditto same as present below: eagerly transition the blit texture to CopySrc. // TODO(dawn:269): ditto same as present below: eagerly transition the blit texture to
// CopySrc.
mBlitTexture->TransitionUsageNow(recordingContext, wgpu::TextureUsage::CopySrc, mBlitTexture->TransitionUsageNow(recordingContext, wgpu::TextureUsage::CopySrc,
mBlitTexture->GetAllSubresources()); mBlitTexture->GetAllSubresources());
mTexture->TransitionUsageNow(recordingContext, wgpu::TextureUsage::CopyDst, mTexture->TransitionUsageNow(recordingContext, wgpu::TextureUsage::CopyDst,

View File

@ -60,7 +60,7 @@ namespace wgpu::binding {
// wgpu::bindings::GPU // wgpu::bindings::GPU
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
GPU::GPU(Flags flags) : flags_(std::move(flags)) { GPU::GPU(Flags flags) : flags_(std::move(flags)) {
// TODO: Disable in 'release' // TODO(dawn:1123): Disable in 'release'
instance_.EnableBackendValidation(true); instance_.EnableBackendValidation(true);
instance_.SetBackendValidationLevel(dawn::native::BackendValidationLevel::Full); instance_.SetBackendValidationLevel(dawn::native::BackendValidationLevel::Full);

View File

@ -97,8 +97,8 @@ namespace wgpu::binding {
break; break;
case WGPUBufferMapAsyncStatus_Unknown: case WGPUBufferMapAsyncStatus_Unknown:
case WGPUBufferMapAsyncStatus_DeviceLost: case WGPUBufferMapAsyncStatus_DeviceLost:
// TODO: The spec is a bit vague around what the promise should do // TODO(dawn:1123): The spec is a bit vague around what the promise should
// here. // do here.
c->promise.Reject(Errors::UnknownError(c->env)); c->promise.Reject(Errors::UnknownError(c->env));
break; break;
} }

View File

@ -267,7 +267,7 @@ int main(int argc, const char* argv[]) {
} }
// Choose an adapter we like. // Choose an adapter we like.
// TODO: allow switching the window between devices. // TODO(dawn:269): allow switching the window between devices.
DawnProcTable procs = dawn::native::GetProcs(); DawnProcTable procs = dawn::native::GetProcs();
dawnProcSetProcs(&procs); dawnProcSetProcs(&procs);

View File

@ -391,8 +391,8 @@ TEST_P(DeviceLostTest, GetMappedRange_MapAsyncWriting) {
ASSERT_EQ(buffer.GetConstMappedRange(), rangeBeforeLoss); ASSERT_EQ(buffer.GetConstMappedRange(), rangeBeforeLoss);
} }
// TODO mapasync read + resolve + loss getmappedrange != nullptr. // TODO(dawn:929): mapasync read + resolve + loss getmappedrange != nullptr.
// TODO mapasync write + resolve + loss getmappedrange != nullptr. // TODO(dawn:929): mapasync write + resolve + loss getmappedrange != nullptr.
// Test that Command Encoder Finish fails when device lost // Test that Command Encoder Finish fails when device lost
TEST_P(DeviceLostTest, CommandEncoderFinishFails) { TEST_P(DeviceLostTest, CommandEncoderFinishFails) {

View File

@ -158,7 +158,6 @@ class SamplerTest : public DawnTest {
EXPECT_PIXEL_RGBA8_EQ(expectedU3, mRenderPass.color, 3, 0); EXPECT_PIXEL_RGBA8_EQ(expectedU3, mRenderPass.color, 3, 0);
EXPECT_PIXEL_RGBA8_EQ(expectedV2, mRenderPass.color, 0, 2); EXPECT_PIXEL_RGBA8_EQ(expectedV2, mRenderPass.color, 0, 2);
EXPECT_PIXEL_RGBA8_EQ(expectedV3, mRenderPass.color, 0, 3); EXPECT_PIXEL_RGBA8_EQ(expectedV3, mRenderPass.color, 0, 3);
// TODO: add tests for W address mode, once Dawn supports 3D textures
} }
utils::BasicRenderPass mRenderPass; utils::BasicRenderPass mRenderPass;

View File

@ -188,14 +188,6 @@ TEST_P(TextureSubresourceTest, ArrayLayersTest) {
EXPECT_TEXTURE_EQ(&bottomLeft, texture, {0, kSize - 1, 1}, {1, 1}); EXPECT_TEXTURE_EQ(&bottomLeft, texture, {0, kSize - 1, 1}, {1, 1});
} }
// TODO (yunchao.he@intel.com):
// * add tests for storage texture and sampler across miplevel or
// arraylayer dimensions in the same texture
//
// * add tests for copy operation upon texture subresource if needed
//
// * add tests for clear operation upon texture subresource if needed
DAWN_INSTANTIATE_TEST(TextureSubresourceTest, DAWN_INSTANTIATE_TEST(TextureSubresourceTest,
D3D12Backend(), D3D12Backend(),
MetalBackend(), MetalBackend(),

View File

@ -648,14 +648,6 @@ DAWN_INSTANTIATE_TEST(VertexStateTest,
OpenGLESBackend(), OpenGLESBackend(),
VulkanBackend()); VulkanBackend());
// TODO for the input state:
// - Add more vertex formats
// - Add checks that the stride is enough to contain all attributes
// - Add checks stride less than some limit
// - Add checks for alignement of vertex buffers and attributes if needed
// - Check for attribute narrowing
// - Check that the input state and the pipeline vertex input types match
class OptionalVertexStateTest : public DawnTest {}; class OptionalVertexStateTest : public DawnTest {};
// Test that vertex input is not required in render pipeline descriptor. // Test that vertex input is not required in render pipeline descriptor.

View File

@ -1690,11 +1690,4 @@ namespace {
} }
} }
// TODO (yunchao.he@intel.com):
//
// * Add tests for multiple encoders upon the same resource simultaneously. This situation fits
// some cases like VR, multi-threading, etc.
//
// * Add tests for bundle
} // anonymous namespace } // anonymous namespace

View File

@ -133,12 +133,4 @@ namespace {
TestRenderPass(samplerView, renderView); TestRenderPass(samplerView, renderView);
} }
// TODO (yunchao.he@intel.com):
// * Add tests for compute, in which texture subresource is traced per dispatch.
//
// * Add tests for multiple encoders upon the same resource simultaneously. This situation fits
// some cases like VR, multi-threading, etc.
//
// * Add tests for conflicts between usages in two render bundles used in the same pass.
} // anonymous namespace } // anonymous namespace