Enable "-Wmissing-field-initializers".
This is another warning required by Skia. This one didn't find
anything that surprising. Enabling the warning does help enforce
code consistency and avoids a bit of possible undefined behaviour.
Bug: angleproject:4046
Change-Id: Ifec7f4afad49cd820bf3c0a79df3f46559473ee2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1877477
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 48ac549..48936c9 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -139,6 +139,7 @@
cflags += [
"-Wextra-semi-stmt",
"-Wfloat-conversion",
+ "-Wmissing-field-initializers",
"-Wnon-virtual-dtor",
"-Wshadow-field",
"-Wtautological-type-limit-compare",
diff --git a/src/libANGLE/renderer/d3d/ProgramD3D.cpp b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
index ac9d385..4ef8c19 100644
--- a/src/libANGLE/renderer/d3d/ProgramD3D.cpp
+++ b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
@@ -947,7 +947,7 @@
reset();
- DeviceIdentifier binaryDeviceIdentifier = {0};
+ DeviceIdentifier binaryDeviceIdentifier = {};
stream->readBytes(reinterpret_cast<unsigned char *>(&binaryDeviceIdentifier),
sizeof(DeviceIdentifier));
diff --git a/src/libANGLE/renderer/d3d/RendererD3D.cpp b/src/libANGLE/renderer/d3d/RendererD3D.cpp
index 00c57f0..237bde3 100644
--- a/src/libANGLE/renderer/d3d/RendererD3D.cpp
+++ b/src/libANGLE/renderer/d3d/RendererD3D.cpp
@@ -100,7 +100,7 @@
std::string RendererD3D::getVendorString() const
{
- LUID adapterLuid = {0};
+ LUID adapterLuid = {};
if (getLUID(&adapterLuid))
{
diff --git a/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp b/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp
index c945cc5..e5c55a8 100644
--- a/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp
@@ -87,7 +87,7 @@
ANGLE_TRY(mRenderer->allocateResource(context11, depthStencilDesc, &mCopyDepthStencilState));
- D3D11_BUFFER_DESC constantBufferDesc = {0};
+ D3D11_BUFFER_DESC constantBufferDesc = {};
constantBufferDesc.ByteWidth = roundUp<UINT>(sizeof(CopyShaderParams), 32u);
constantBufferDesc.Usage = D3D11_USAGE_DYNAMIC;
constantBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
diff --git a/src/libANGLE/renderer/d3d/d3d11/Query11.cpp b/src/libANGLE/renderer/d3d/d3d11/Query11.cpp
index 50fd008..f2368e9 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Query11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/Query11.cpp
@@ -241,7 +241,7 @@
case gl::QueryType::TransformFeedbackPrimitivesWritten:
{
ASSERT(queryState->query.valid());
- D3D11_QUERY_DATA_SO_STATISTICS soStats = {0};
+ D3D11_QUERY_DATA_SO_STATISTICS soStats = {};
HRESULT result =
context->GetData(queryState->query.get(), &soStats, sizeof(soStats), 0);
ANGLE_TRY_HR(context11, result, "Failed to get the data of an internal query");
@@ -259,7 +259,7 @@
ASSERT(queryState->query.valid());
ASSERT(queryState->beginTimestamp.valid());
ASSERT(queryState->endTimestamp.valid());
- D3D11_QUERY_DATA_TIMESTAMP_DISJOINT timeStats = {0};
+ D3D11_QUERY_DATA_TIMESTAMP_DISJOINT timeStats = {};
HRESULT result =
context->GetData(queryState->query.get(), &timeStats, sizeof(timeStats), 0);
ANGLE_TRY_HR(context11, result, "Failed to get the data of an internal query");
diff --git a/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp b/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp
index 022769b..52cc1b5 100644
--- a/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp
@@ -195,7 +195,7 @@
TrimCache(kMaxStates, kGCLimit, "depth stencil state", &mDepthStencilStateCache);
- D3D11_DEPTH_STENCIL_DESC dsDesc = {0};
+ D3D11_DEPTH_STENCIL_DESC dsDesc = {};
dsDesc.DepthEnable = glState.depthTest ? TRUE : FALSE;
dsDesc.DepthWriteMask = ConvertDepthMask(glState.depthMask);
dsDesc.DepthFunc = ConvertComparison(glState.depthFunc);
diff --git a/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
index 6e94f69..a3f7ac6 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
@@ -1375,7 +1375,7 @@
return egl::EglBadParameter() << "Texture's device does not match.";
}
- D3D11_TEXTURE2D_DESC desc = {0};
+ D3D11_TEXTURE2D_DESC desc = {};
d3dTexture->GetDesc(&desc);
if (width)
@@ -1497,7 +1497,7 @@
<< "Failed to query ID3D11Texture2D object from share handle.";
}
- D3D11_TEXTURE2D_DESC desc = {0};
+ D3D11_TEXTURE2D_DESC desc = {};
texture2D->GetDesc(&desc);
SafeRelease(texture2D);
@@ -2131,7 +2131,7 @@
DeviceIdentifier Renderer11::getAdapterIdentifier() const
{
// Don't use the AdapterLuid here, since that doesn't persist across reboot.
- DeviceIdentifier deviceIdentifier = {0};
+ DeviceIdentifier deviceIdentifier = {};
deviceIdentifier.VendorId = mAdapterDescription.VendorId;
deviceIdentifier.DeviceId = mAdapterDescription.DeviceId;
deviceIdentifier.SubSysId = mAdapterDescription.SubSysId;
@@ -2865,7 +2865,7 @@
for (const auto &streamOutVarying : streamOutVaryings)
{
- D3D11_SO_DECLARATION_ENTRY entry = {0};
+ D3D11_SO_DECLARATION_ENTRY entry = {};
entry.Stream = 0;
entry.SemanticName = streamOutVarying.semanticName.c_str();
entry.SemanticIndex = streamOutVarying.semanticIndex;
diff --git a/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp b/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp
index 529fa36..a30ca41 100644
--- a/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp
@@ -100,7 +100,7 @@
{
if (size() > 0 && !mConstantBuffer.valid())
{
- D3D11_BUFFER_DESC desc = {0};
+ D3D11_BUFFER_DESC desc = {};
desc.ByteWidth = static_cast<unsigned int>(size());
desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
diff --git a/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp b/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp
index ac40084..1b6f8af 100644
--- a/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp
@@ -428,7 +428,7 @@
}
const angle::ColorGeneric &borderColor(samplerState.getBorderColor());
- constexpr int kBlack[4] = {0};
+ constexpr int kBlack[4] = {};
const void *const intBorderColor = (borderColor.type == angle::ColorGeneric::Type::Float)
? kBlack
: borderColor.colorI.data();
@@ -644,7 +644,7 @@
}
// Previous buffer contents are discarded, so we need to refresh the whole buffer.
- D3D11_MAPPED_SUBRESOURCE mapping = {0};
+ D3D11_MAPPED_SUBRESOURCE mapping = {};
ANGLE_TRY(renderer->mapResource(context, driverConstantBuffer.get(), 0, D3D11_MAP_WRITE_DISCARD,
0, &mapping));
@@ -3368,7 +3368,7 @@
{
size_t requiredSize = mShaderConstants.getRequiredBufferSize(shaderType);
- D3D11_BUFFER_DESC constantBufferDescription = {0};
+ D3D11_BUFFER_DESC constantBufferDescription = {};
d3d11::InitConstantBufferDesc(&constantBufferDescription, requiredSize);
ANGLE_TRY(mRenderer->allocateResource(
GetImplAs<Context11>(context), constantBufferDescription, &shaderDriverConstantBuffer));
@@ -3464,7 +3464,7 @@
{
size_t requiredSize = mShaderConstants.getRequiredBufferSize(gl::ShaderType::Compute);
- D3D11_BUFFER_DESC constantBufferDescription = {0};
+ D3D11_BUFFER_DESC constantBufferDescription = {};
d3d11::InitConstantBufferDesc(&constantBufferDescription, requiredSize);
ANGLE_TRY(
mRenderer->allocateResource(GetImplAs<Context11>(context), constantBufferDescription,
diff --git a/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
index d364af4..444b934 100644
--- a/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
@@ -204,7 +204,7 @@
const d3d11::Format &backbufferFormatInfo =
d3d11::Format::Get(mOffscreenRenderTargetFormat, mRenderer->getRenderer11DeviceCaps());
- D3D11_TEXTURE2D_DESC offscreenTextureDesc = {0};
+ D3D11_TEXTURE2D_DESC offscreenTextureDesc = {};
// If the app passed in a share handle or D3D texture, open the resource
// See EGL_ANGLE_d3d_share_handle_client_buffer and EGL_ANGLE_d3d_texture_client_buffer
@@ -338,7 +338,7 @@
if (previousOffscreenTexture.valid())
{
- D3D11_BOX sourceBox = {0};
+ D3D11_BOX sourceBox = {};
sourceBox.left = 0;
sourceBox.right = std::min(previousWidth, backbufferWidth);
sourceBox.top = std::max(previousHeight - backbufferHeight, 0);
@@ -385,7 +385,7 @@
// must also have the same quality value.
if (mOffscreenTexture.valid() && getD3DSamples() > 1)
{
- D3D11_TEXTURE2D_DESC offscreenTextureDesc = {0};
+ D3D11_TEXTURE2D_DESC offscreenTextureDesc = {};
mOffscreenTexture.getDesc(&offscreenTextureDesc);
depthStencilTextureDesc.SampleDesc.Quality = offscreenTextureDesc.SampleDesc.Quality;
}
diff --git a/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.cpp b/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.cpp
index 496f7c4..8903ca9 100644
--- a/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.cpp
@@ -105,7 +105,7 @@
ComPtr<IDXGIFactory2> factory2;
factory2.Attach(d3d11::DynamicCastComObject<IDXGIFactory2>(factory));
- DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
+ DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {};
swapChainDesc.Width = width;
swapChainDesc.Height = height;
swapChainDesc.Format = format;
diff --git a/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp b/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
index 6c31e3c..722510a 100644
--- a/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
@@ -117,7 +117,7 @@
}
IDXGIFactory2 *factory2 = d3d11::DynamicCastComObject<IDXGIFactory2>(factory);
- DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
+ DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {};
swapChainDesc.Width = width;
swapChainDesc.Height = height;
swapChainDesc.Format = format;
@@ -150,7 +150,7 @@
IDXGIFactory2 *factory2 = d3d11::DynamicCastComObject<IDXGIFactory2>(factory);
if (factory2 != nullptr)
{
- DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
+ DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {};
swapChainDesc.Width = width;
swapChainDesc.Height = height;
swapChainDesc.Format = format;
diff --git a/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp b/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
index 601e3cd..6c02390 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
@@ -667,8 +667,8 @@
device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
- RECT scissorRect = {0}; // Scissoring is disabled for flipping, but we need this to capture and
- // restore the old rectangle
+ RECT scissorRect = {}; // Scissoring is disabled for flipping, but we need this to capture and
+ // restore the old rectangle
device->SetScissorRect(&scissorRect);
for (int i = 0; i < gl::MAX_VERTEX_ATTRIBS; i++)
diff --git a/src/libANGLE/renderer/d3d/d3d9/Image9.cpp b/src/libANGLE/renderer/d3d/d3d9/Image9.cpp
index 27c7803..7b6da2c 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Image9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/Image9.cpp
@@ -66,12 +66,12 @@
const d3d9::D3DFormat &d3dFormatInfo = d3d9::GetD3DFormatInfo(sourceDesc.Format);
ASSERT(d3dFormatInfo.info().mipGenerationFunction != nullptr);
- D3DLOCKED_RECT sourceLocked = {0};
+ D3DLOCKED_RECT sourceLocked = {};
result = sourceSurface->LockRect(&sourceLocked, nullptr, D3DLOCK_READONLY);
ASSERT(SUCCEEDED(result));
ANGLE_TRY_HR(context9, result, "Failed to lock the source surface for mipmap generation");
- D3DLOCKED_RECT destLocked = {0};
+ D3DLOCKED_RECT destLocked = {};
result = destSurface->LockRect(&destLocked, nullptr, 0);
ASSERT(SUCCEEDED(result));
ANGLE_TRY_HR(context9, result, "Failed to lock the destination surface for mipmap generation");
@@ -112,8 +112,8 @@
IDirect3DSurface9 *dest,
IDirect3DSurface9 *source)
{
- D3DLOCKED_RECT sourceLock = {0};
- D3DLOCKED_RECT destLock = {0};
+ D3DLOCKED_RECT sourceLock = {};
+ D3DLOCKED_RECT destLock = {};
HRESULT result;
@@ -182,12 +182,12 @@
"Failed to query the destination surface description for CopyImage");
const d3d9::D3DFormat &sourceD3DFormatInfo = d3d9::GetD3DFormatInfo(sourceDesc.Format);
- D3DLOCKED_RECT sourceLocked = {0};
+ D3DLOCKED_RECT sourceLocked = {};
result = sourceSurface->LockRect(&sourceLocked, nullptr, D3DLOCK_READONLY);
ASSERT(SUCCEEDED(result));
ANGLE_TRY_HR(context9, result, "Failed to lock the source surface for CopyImage");
- D3DLOCKED_RECT destLocked = {0};
+ D3DLOCKED_RECT destLocked = {};
result = destSurface->LockRect(&destLocked, nullptr, 0);
ASSERT(SUCCEEDED(result));
if (FAILED(result))
@@ -587,12 +587,12 @@
RECT sourceRect = {sourceArea.x, sourceArea.y, sourceArea.x + width, sourceArea.y + height};
RECT destRect = {destOffset.x, destOffset.y, destOffset.x + width, destOffset.y + height};
- D3DLOCKED_RECT sourceLock = {0};
+ D3DLOCKED_RECT sourceLock = {};
hr = renderTargetData->LockRect(&sourceLock, &sourceRect, 0);
ANGLE_TRY_HR(context9, hr, "Failed to lock the source surface (rectangle might be invalid)");
- D3DLOCKED_RECT destLock = {0};
+ D3DLOCKED_RECT destLock = {};
angle::Result result = lock(context9, &destLock, destRect);
if (result == angle::Result::Stop)
{
diff --git a/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp b/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
index 497e7e5..d021151 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
@@ -404,7 +404,7 @@
D3DPRESENT_PARAMETERS Renderer9::getDefaultPresentParameters()
{
- D3DPRESENT_PARAMETERS presentParameters = {0};
+ D3DPRESENT_PARAMETERS presentParameters = {};
// The default swap chain is never actually used. Surface will create a new swap chain with the
// proper parameters.
@@ -2350,7 +2350,7 @@
DeviceIdentifier Renderer9::getAdapterIdentifier() const
{
- DeviceIdentifier deviceIdentifier = {0};
+ DeviceIdentifier deviceIdentifier = {};
deviceIdentifier.VendorId = static_cast<UINT>(mAdapterIdentifier.VendorId);
deviceIdentifier.DeviceId = static_cast<UINT>(mAdapterIdentifier.DeviceId);
deviceIdentifier.SubSysId = static_cast<UINT>(mAdapterIdentifier.SubSysId);
diff --git a/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp b/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp
index d21fa9c..c8abac7 100644
--- a/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp
@@ -185,7 +185,7 @@
EGLNativeWindowType window = mNativeWindow->getNativeWindow();
if (window && deviceType != D3DDEVTYPE_NULLREF)
{
- D3DPRESENT_PARAMETERS presentParameters = {0};
+ D3DPRESENT_PARAMETERS presentParameters = {};
presentParameters.AutoDepthStencilFormat = depthBufferd3dFormatInfo.renderFormat;
presentParameters.BackBufferCount = 1;
presentParameters.BackBufferFormat = backBufferd3dFormatInfo.renderFormat;
diff --git a/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp b/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
index 6eebac9..01b6fed 100644
--- a/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
+++ b/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
@@ -429,7 +429,7 @@
{
ASSERT(dxgiFactory2 != nullptr);
- DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
+ DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {};
swapChainDesc.BufferCount = 1;
swapChainDesc.Format = mSwapChainFormat;
swapChainDesc.Width = static_cast<UINT>(mWidth);
diff --git a/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp b/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
index 563ad68..55b8ef8 100644
--- a/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
+++ b/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
@@ -147,7 +147,7 @@
stream << "ANGLE DisplayWGL " << gl::FmtHex(display) << " Intermediate Window Class";
std::string className = stream.str();
- WNDCLASSA intermediateClassDesc = {0};
+ WNDCLASSA intermediateClassDesc = {};
intermediateClassDesc.style = CS_OWNDC;
intermediateClassDesc.lpfnWndProc = DefWindowProcA;
intermediateClassDesc.cbClsExtra = 0;
diff --git a/src/libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp b/src/libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp
index b83479a..9c856a1 100644
--- a/src/libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp
+++ b/src/libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp
@@ -53,7 +53,7 @@
int windowPixelFormat = GetPixelFormat(mDeviceContext);
if (windowPixelFormat == 0)
{
- PIXELFORMATDESCRIPTOR pixelFormatDescriptor = {0};
+ PIXELFORMATDESCRIPTOR pixelFormatDescriptor = {};
if (!DescribePixelFormat(mDeviceContext, mPixelFormat, sizeof(pixelFormatDescriptor),
&pixelFormatDescriptor))
{
diff --git a/src/libANGLE/renderer/gl/wgl/wgl_utils.cpp b/src/libANGLE/renderer/gl/wgl/wgl_utils.cpp
index d7d642a..96d49ba 100644
--- a/src/libANGLE/renderer/gl/wgl/wgl_utils.cpp
+++ b/src/libANGLE/renderer/gl/wgl/wgl_utils.cpp
@@ -18,7 +18,7 @@
PIXELFORMATDESCRIPTOR GetDefaultPixelFormatDescriptor()
{
- PIXELFORMATDESCRIPTOR pixelFormatDescriptor = {0};
+ PIXELFORMATDESCRIPTOR pixelFormatDescriptor = {};
pixelFormatDescriptor.nSize = sizeof(pixelFormatDescriptor);
pixelFormatDescriptor.nVersion = 1;
pixelFormatDescriptor.dwFlags =
diff --git a/src/libANGLE/renderer/vulkan/RendererVk.cpp b/src/libANGLE/renderer/vulkan/RendererVk.cpp
index 643b63a..9a29360 100644
--- a/src/libANGLE/renderer/vulkan/RendererVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -531,7 +531,7 @@
mDebugUtilsMessenger(VK_NULL_HANDLE),
mDebugReportCallback(VK_NULL_HANDLE),
mPhysicalDevice(VK_NULL_HANDLE),
- mPhysicalDeviceSubgroupProperties{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES},
+ mPhysicalDeviceSubgroupProperties{},
mQueue(VK_NULL_HANDLE),
mCurrentQueueFamilyIndex(std::numeric_limits<uint32_t>::max()),
mMaxVertexAttribDivisor(1),
@@ -543,6 +543,8 @@
mPipelineCacheDirty(false),
mPipelineCacheInitialized(false)
{
+ mPhysicalDeviceSubgroupProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
+
VkFormatProperties invalid = {0, 0, kInvalidFormatFeatureFlags};
mFormatProperties.fill(invalid);
}
diff --git a/src/libANGLE/renderer/vulkan/TextureVk.cpp b/src/libANGLE/renderer/vulkan/TextureVk.cpp
index 6c391fd..33e979c 100644
--- a/src/libANGLE/renderer/vulkan/TextureVk.cpp
+++ b/src/libANGLE/renderer/vulkan/TextureVk.cpp
@@ -1088,7 +1088,7 @@
const gl::InternalFormat &baseLevelFormat = *desc.format.info;
VkExtent3D updatedExtents;
- VkOffset3D offset = {0};
+ VkOffset3D offset = {};
uint32_t layerCount;
gl_vk::GetExtentsAndLayerCount(mState.getType(), baseLevelExtents, &updatedExtents,
&layerCount);
diff --git a/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp b/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp
index 539eb1a..191fb8c 100644
--- a/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp
+++ b/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp
@@ -203,7 +203,8 @@
{
// Unpack the packed and split representation into the format required by Vulkan.
gl::DrawBuffersVector<VkAttachmentReference> colorAttachmentRefs;
- VkAttachmentReference depthStencilAttachmentRef = {VK_ATTACHMENT_UNUSED};
+ VkAttachmentReference depthStencilAttachmentRef = {VK_ATTACHMENT_UNUSED,
+ VK_IMAGE_LAYOUT_UNDEFINED};
gl::AttachmentArray<VkAttachmentDescription> attachmentDescs;
uint32_t colorAttachmentCount = 0;
diff --git a/src/libANGLE/renderer/vulkan/vk_helpers.cpp b/src/libANGLE/renderer/vulkan/vk_helpers.cpp
index eee34f7..d5668a7 100644
--- a/src/libANGLE/renderer/vulkan/vk_helpers.cpp
+++ b/src/libANGLE/renderer/vulkan/vk_helpers.cpp
@@ -2926,8 +2926,7 @@
}
// ImageHelper::SubresourceUpdate implementation
-ImageHelper::SubresourceUpdate::SubresourceUpdate()
- : updateSource(UpdateSource::Buffer), buffer{VK_NULL_HANDLE}
+ImageHelper::SubresourceUpdate::SubresourceUpdate() : updateSource(UpdateSource::Buffer), buffer{}
{}
ImageHelper::SubresourceUpdate::SubresourceUpdate(BufferHelper *bufferHelperIn,
diff --git a/src/libANGLE/renderer/vulkan/vk_utils.cpp b/src/libANGLE/renderer/vulkan/vk_utils.cpp
index c7093f9..1fcffc0 100644
--- a/src/libANGLE/renderer/vulkan/vk_utils.cpp
+++ b/src/libANGLE/renderer/vulkan/vk_utils.cpp
@@ -296,7 +296,7 @@
}
// MemoryProperties implementation.
-MemoryProperties::MemoryProperties() : mMemoryProperties{0} {}
+MemoryProperties::MemoryProperties() : mMemoryProperties{} {}
void MemoryProperties::init(VkPhysicalDevice physicalDevice)
{
@@ -307,7 +307,7 @@
void MemoryProperties::destroy()
{
- mMemoryProperties = {0};
+ mMemoryProperties = {};
}
angle::Result MemoryProperties::findCompatibleMemoryIndex(
diff --git a/src/tests/test_expectations/GPUTestConfig.cpp b/src/tests/test_expectations/GPUTestConfig.cpp
index 096c8f6..f845c03 100644
--- a/src/tests/test_expectations/GPUTestConfig.cpp
+++ b/src/tests/test_expectations/GPUTestConfig.cpp
@@ -36,7 +36,8 @@
if (sSavedMajorVersion == -1 || sSavedMinorVersion == -1)
{
#if defined(ANGLE_PLATFORM_WINDOWS)
- OSVERSIONINFOEX version_info = {sizeof version_info};
+ OSVERSIONINFOEX version_info = {};
+ version_info.dwOSVersionInfoSize = sizeof(version_info);
::GetVersionEx(reinterpret_cast<OSVERSIONINFO *>(&version_info));
sSavedMajorVersion = version_info.dwMajorVersion;
*majorVersion = sSavedMajorVersion;
diff --git a/src/tests/test_expectations/GPUTestExpectationsParser.cpp b/src/tests/test_expectations/GPUTestExpectationsParser.cpp
index bf009d9..1d75f6e 100644
--- a/src/tests/test_expectations/GPUTestExpectationsParser.cpp
+++ b/src/tests/test_expectations/GPUTestExpectationsParser.cpp
@@ -108,12 +108,28 @@
struct TokenInfo
{
+ constexpr TokenInfo()
+ : name(nullptr),
+ condition(GPUTestConfig::kConditionNone),
+ expectation(GPUTestExpectationsParser::kGpuTestPass)
+ {}
+
+ constexpr TokenInfo(const char *nameIn,
+ GPUTestConfig::Condition conditionIn,
+ GPUTestExpectationsParser::GPUTestExpectation expectationIn)
+ : name(nameIn), condition(conditionIn), expectation(expectationIn)
+ {}
+
+ constexpr TokenInfo(const char *nameIn, GPUTestConfig::Condition conditionIn)
+ : TokenInfo(nameIn, conditionIn, GPUTestExpectationsParser::kGpuTestPass)
+ {}
+
const char *name;
GPUTestConfig::Condition condition;
GPUTestExpectationsParser::GPUTestExpectation expectation;
};
-const TokenInfo kTokenData[kNumberOfTokens] = {
+constexpr TokenInfo kTokenData[kNumberOfTokens] = {
{"xp", GPUTestConfig::kConditionWinXP},
{"vista", GPUTestConfig::kConditionWinVista},
{"win7", GPUTestConfig::kConditionWin7},
@@ -132,7 +148,7 @@
{"mojave", GPUTestConfig::kConditionMacMojave},
{"mac", GPUTestConfig::kConditionMac},
{"linux", GPUTestConfig::kConditionLinux},
- {"chromeos"}, // (https://anglebug.com/3363) ChromeOS not supported yet
+ {"chromeos", GPUTestConfig::kConditionNone}, // https://anglebug.com/3363 CrOS not supported
{"android", GPUTestConfig::kConditionAndroid},
{"nvidia", GPUTestConfig::kConditionNVIDIA},
{"amd", GPUTestConfig::kConditionAMD},
@@ -154,11 +170,11 @@
{"flaky", GPUTestConfig::kConditionNone, GPUTestExpectationsParser::kGpuTestFlaky},
{"timeout", GPUTestConfig::kConditionNone, GPUTestExpectationsParser::kGpuTestTimeout},
{"skip", GPUTestConfig::kConditionNone, GPUTestExpectationsParser::kGpuTestSkip},
- {":"}, // kSeparatorColon
- {"="}, // kSeparatorEqual
- {}, // kNumberOfExactMatchTokens
- {}, // kTokenComment
- {}, // kTokenWord
+ {":", GPUTestConfig::kConditionNone}, // kSeparatorColon
+ {"=", GPUTestConfig::kConditionNone}, // kSeparatorEqual
+ {}, // kNumberOfExactMatchTokens
+ {}, // kTokenComment
+ {}, // kTokenWord
};
const char *kErrorMessage[kNumberOfErrors] = {
diff --git a/util/windows/WGLWindow.cpp b/util/windows/WGLWindow.cpp
index 96c4d42..a9e82e1 100644
--- a/util/windows/WGLWindow.cpp
+++ b/util/windows/WGLWindow.cpp
@@ -19,7 +19,7 @@
{
PIXELFORMATDESCRIPTOR GetDefaultPixelFormatDescriptor()
{
- PIXELFORMATDESCRIPTOR pixelFormatDescriptor = {0};
+ PIXELFORMATDESCRIPTOR pixelFormatDescriptor = {};
pixelFormatDescriptor.nSize = sizeof(pixelFormatDescriptor);
pixelFormatDescriptor.nVersion = 1;
pixelFormatDescriptor.dwFlags =
diff --git a/util/windows/win32/Win32Window.cpp b/util/windows/win32/Win32Window.cpp
index c422915..d48192e 100644
--- a/util/windows/win32/Win32Window.cpp
+++ b/util/windows/win32/Win32Window.cpp
@@ -513,7 +513,7 @@
// Work around compile error from not defining "UNICODE" while Chromium does
const LPSTR idcArrow = MAKEINTRESOURCEA(32512);
- WNDCLASSEXA parentWindowClass = {0};
+ WNDCLASSEXA parentWindowClass = {};
parentWindowClass.cbSize = sizeof(WNDCLASSEXA);
parentWindowClass.style = 0;
parentWindowClass.lpfnWndProc = WndProc;
@@ -530,7 +530,7 @@
return false;
}
- WNDCLASSEXA childWindowClass = {0};
+ WNDCLASSEXA childWindowClass = {};
childWindowClass.cbSize = sizeof(WNDCLASSEXA);
childWindowClass.style = CS_OWNDC;
childWindowClass.lpfnWndProc = WndProc;