chromium/third_party/angle/src/libANGLE/renderer/gl/PLSProgramCache.h

//
// Copyright 2022 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.
//

// PLSProgramCache.h: Implements a cache of native programs used to render load/store operations for
// EXT_shader_pixel_local_storage.

#ifndef LIBANGLE_RENDERER_GL_PLS_PROGRAM_CACHE_H_
#define LIBANGLE_RENDERER_GL_PLS_PROGRAM_CACHE_H_

#include "libANGLE/SizedMRUCache.h"
#include "libANGLE/renderer/gl/StateManagerGL.h"

namespace gl
{
class PixelLocalStoragePlane;
struct Caps;
}  // namespace gl

namespace rx
{
class FunctionsGL;
class PLSProgram;
class PLSProgramKey;

// Implements a cache of native PLSPrograms used to render load/store operations for
// EXT_shader_pixel_local_storage.
//
// These programs require no vertex arrays, and draw fullscreen quads from 4-point
// GL_TRIANGLE_STRIPs:
//
//   glDrawArrays(GL_TRIANGLE_STRIP, 0, 4)
//
class PLSProgramCache : angle::NonCopyable
{};

enum class PLSProgramType : uint64_t
{};

// Re-enumerates PLS formats with a 0-based index, for tighter packing in a PLSProgramKey.
enum class PLSFormatKey : uint64_t
{};

// Compact descriptor of an entire PLS load/store program. The LSB says whether the program is load
// or store, and each following run of 5 bits state the format of a specific plane and whether it is
// preserved.
class PLSProgramKey
{};

class PLSProgramKeyBuilder
{};

class PLSProgram : angle::NonCopyable
{};
}  // namespace rx

#endif  // LIBANGLE_RENDERER_GL_PLS_PROGRAM_CACHE_H_