Hash :
aa0a5446
Author :
Date :
2017-05-25T13:30:23
Ensure gl State structs are zero filled. In some cases we would hash or memcmp against structs with bools or other non-filled data. This could have implementation differences, and may have been causing cache errors on Clang. BUG=chromium:721648 BUG=angleproject:2044 Change-Id: I981a1e6e8d50a33f7fade568497b72b919accfce Reviewed-on: https://chromium-review.googlesource.com/516383 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
//
// Copyright (c) 2012-2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// angletypes.inl : Inline definitions of some functions from angletypes.h
namespace gl
{
inline bool operator==(const Rectangle &a, const Rectangle &b)
{
return a.x == b.x &&
a.y == b.y &&
a.width == b.width &&
a.height == b.height;
}
inline bool operator!=(const Rectangle &a, const Rectangle &b)
{
return !(a == b);
}
inline bool operator==(const SamplerState &a, const SamplerState &b)
{
return memcmp(&a, &b, sizeof(SamplerState)) == 0;
}
inline bool operator!=(const SamplerState &a, const SamplerState &b)
{
return !(a == b);
}
} // namespace gl