Edit

kc3-lang/angle/src/libANGLE/angletypes.inl

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2017-05-25 13:30:23
    Hash : aa0a5446
    Message : 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>

  • src/libANGLE/angletypes.inl
  • //
    // 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