chromium/third_party/angle/src/libANGLE/PixelLocalStorage.cpp

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

// PixelLocalStorage.cpp: Defines the renderer-agnostic container classes
// gl::PixelLocalStorage and gl::PixelLocalStoragePlane for
// ANGLE_shader_pixel_local_storage.

#include "libANGLE/PixelLocalStorage.h"

#include <numeric>
#include "common/FixedVector.h"
#include "libANGLE/Context.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/context_private_call_gles_autogen.h"
#include "libANGLE/renderer/ContextImpl.h"
#include "libANGLE/renderer/TextureImpl.h"

namespace gl
{
// RAII utilities for working with GL state.
namespace
{
class ScopedBindTexture2D : angle::NonCopyable
{};

class ScopedRestoreDrawFramebuffer : angle::NonCopyable
{};

class ScopedDisableScissor : angle::NonCopyable
{};

class ScopedEnableColorMask : angle::NonCopyable
{};
}  // namespace

PixelLocalStoragePlane::PixelLocalStoragePlane() :{}

PixelLocalStoragePlane::~PixelLocalStoragePlane()
{}

void PixelLocalStoragePlane::onContextObjectsLost()
{}

void PixelLocalStoragePlane::deinitialize(Context *context)
{}

void PixelLocalStoragePlane::setMemoryless(Context *context, GLenum internalformat)
{}

void PixelLocalStoragePlane::setTextureBacked(Context *context, Texture *tex, int level, int layer)
{}

void PixelLocalStoragePlane::onSubjectStateChange(angle::SubjectIndex index,
                                                  angle::SubjectMessage message)
{}

bool PixelLocalStoragePlane::isDeinitialized() const
{}

GLint PixelLocalStoragePlane::getIntegeri(GLenum target) const
{}

bool PixelLocalStoragePlane::getTextureImageExtents(const Context *context, Extents *extents) const
{}

void PixelLocalStoragePlane::ensureBackingTextureIfMemoryless(Context *context, Extents plsExtents)
{}

void PixelLocalStoragePlane::attachToDrawFramebuffer(Context *context, GLenum colorAttachment) const
{}

// Clears the draw buffer at 0-based index 'drawBufferIdx' on the current framebuffer.
class ClearBufferCommands : public PixelLocalStoragePlane::ClearCommands
{};

template <typename T, size_t N>
void ClampArray(std::array<T, N> &arr, T lo, T hi)
{}

void PixelLocalStoragePlane::issueClearCommand(ClearCommands *clearCommands,
                                               int target,
                                               GLenum loadop) const
{}

void PixelLocalStoragePlane::bindToImage(Context *context, GLuint unit, bool needsR32Packing) const
{}

const Texture *PixelLocalStoragePlane::getBackingTexture(const Context *context) const
{}

PixelLocalStorage::PixelLocalStorage(const ShPixelLocalStorageOptions &plsOptions, const Caps &caps)
    :{}

PixelLocalStorage::~PixelLocalStorage() {}

namespace
{
bool AllPlanesDeinitialized(
    const angle::FixedVector<PixelLocalStoragePlane, IMPLEMENTATION_MAX_PIXEL_LOCAL_STORAGE_PLANES>
        &planes,
    const Context *context)
{}
}  // namespace

void PixelLocalStorage::onFramebufferDestroyed(const Context *context)
{}

void PixelLocalStorage::deleteContextObjects(Context *context)
{}

void PixelLocalStorage::begin(Context *context, GLsizei n, const GLenum loadops[])
{}

void PixelLocalStorage::end(Context *context, const GLenum storeops[])
{}

void PixelLocalStorage::barrier(Context *context)
{}

void PixelLocalStorage::interrupt(Context *context)
{}

void PixelLocalStorage::restore(Context *context)
{}

namespace
{
// Implements pixel local storage with image load/store shader operations.
class PixelLocalStorageImageLoadStore : public PixelLocalStorage
{};

// Implements pixel local storage via framebuffer fetch.
class PixelLocalStorageFramebufferFetch : public PixelLocalStorage
{};

// Implements ANGLE_shader_pixel_local_storage directly via EXT_shader_pixel_local_storage.
class PixelLocalStorageEXT : public PixelLocalStorage
{};
}  // namespace

std::unique_ptr<PixelLocalStorage> PixelLocalStorage::Make(const Context *context)
{}
}  // namespace gl