Hash :
4db13081
Author :
Date :
2023-07-04T14:40:31
Make glClearColor/Depth/Stencil entry points lockless These entry points only set state that is entirely accessed by the owning context and thus don't require locking. Bug: angleproject:8224 Change-Id: I6cddee865ffd38e228f8f87dd14adffb916e0fed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4658172 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
//
// Copyright 2023 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.
//
// context_local_call.h:
// Helpers that set/get state that is entirely locally accessed by the context.
#include "libANGLE/context_local_call_autogen.h"
namespace gl
{
void ContextLocalClearColor(Context *context,
GLfloat red,
GLfloat green,
GLfloat blue,
GLfloat alpha)
{
context->getMutableLocalState()->setColorClearValue(red, green, blue, alpha);
}
void ContextLocalClearDepthf(Context *context, GLfloat depth)
{
context->getMutableLocalState()->setDepthClearValue(clamp01(depth));
}
void ContextLocalClearStencil(Context *context, GLint stencil)
{
context->getMutableLocalState()->setStencilClearValue(stencil);
}
void ContextLocalClearColorx(Context *context,
GLfixed red,
GLfixed green,
GLfixed blue,
GLfixed alpha)
{
context->getMutableLocalState()->setColorClearValue(
ConvertFixedToFloat(red), ConvertFixedToFloat(green), ConvertFixedToFloat(blue),
ConvertFixedToFloat(alpha));
}
void ContextLocalClearDepthx(Context *context, GLfixed depth)
{
context->getMutableLocalState()->setDepthClearValue(clamp01(ConvertFixedToFloat(depth)));
}
} // namespace gl