chromium/third_party/vulkan-validation-layers/src/layers/containers/subresource_adapter.cpp

/* Copyright (c) 2019-2024 The Khronos Group Inc.
 * Copyright (c) 2019-2024 Valve Corporation
 * Copyright (c) 2019-2024 LunarG, Inc.
 * Copyright (C) 2019-2024 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * John Zulauf <[email protected]>
 *
 */
#include <cassert>
#include <vulkan/utility/vk_format_utils.h>

#include "subresource_adapter.h"
#include <cmath>
#include "state_tracker/image_state.h"
#include "generated/layer_chassis_dispatch.h"

namespace subresource_adapter {
Subresource::Subresource(const RangeEncoder& encoder, const VkImageSubresource& subres)
    :{}

IndexType RangeEncoder::Encode1AspectArrayOnly(const Subresource& pos) const {}
IndexType RangeEncoder::Encode1AspectMipArray(const Subresource& pos) const {}
IndexType RangeEncoder::Encode1AspectMipOnly(const Subresource& pos) const {}

IndexType RangeEncoder::EncodeAspectArrayOnly(const Subresource& pos) const {}
IndexType RangeEncoder::EncodeAspectMipArray(const Subresource& pos) const {}
IndexType RangeEncoder::EncodeAspectMipOnly(const Subresource& pos) const {}

uint32_t RangeEncoder::LowerBoundImpl1(VkImageAspectFlags aspect_mask) const {}
uint32_t RangeEncoder::LowerBoundWithStartImpl1(VkImageAspectFlags aspect_mask, uint32_t start) const {}

uint32_t RangeEncoder::LowerBoundImpl2(VkImageAspectFlags aspect_mask) const {}
uint32_t RangeEncoder::LowerBoundWithStartImpl2(VkImageAspectFlags aspect_mask, uint32_t start) const {}

uint32_t RangeEncoder::LowerBoundImpl3(VkImageAspectFlags aspect_mask) const {}

uint32_t RangeEncoder::LowerBoundWithStartImpl3(VkImageAspectFlags aspect_mask, uint32_t start) const {}

void RangeEncoder::PopulateFunctionPointers() {}

RangeEncoder::RangeEncoder(const VkImageSubresourceRange& full_range, const AspectParameters* param)
    :{}

#ifndef NDEBUG
static bool IsValid(const RangeEncoder& encoder, const VkImageSubresourceRange& bounds) {}
#endif

// Create an iterator like "generator" that for each increment produces the next index range matching the
// next contiguous (in index space) section of the VkImageSubresourceRange
// Ranges will always span the layerCount layers, and if the layerCount is the full range of the image (as known by
// the encoder) will span the levelCount mip levels as weill.
RangeGenerator::RangeGenerator(const RangeEncoder& encoder, const VkImageSubresourceRange& subres_range)
    :{}

RangeGenerator& RangeGenerator::operator++() {}

ImageRangeEncoder::ImageRangeEncoder(const vvl::Image& image)
    :{}

ImageRangeEncoder::ImageRangeEncoder(const vvl::Image& image, const AspectParameters* param)
    :{}

IndexType ImageRangeEncoder::Encode2D(const VkSubresourceLayout& layout, uint32_t layer, uint32_t aspect_index,
                                      const VkOffset3D& offset) const {}

IndexType ImageRangeEncoder::Encode3D(const VkSubresourceLayout& layout, uint32_t aspect_index, const VkOffset3D& offset) const {}

void ImageRangeEncoder::Decode(const VkImageSubresource& subres, const IndexType& encode, uint32_t& out_layer,
                               VkOffset3D& out_offset) const {}


inline VkImageSubresourceRange GetRemaining(const VkImageSubresourceRange& full_range, VkImageSubresourceRange subres_range) {}
inline bool CoversAllLayers(const VkImageSubresourceRange& full_range, VkImageSubresourceRange subres_range) {}
static bool SubresourceRangeIsEmpty(const VkImageSubresourceRange& range) {}
static bool ExtentIsEmpty(const VkExtent3D& extent) {}

VkOffset3D ImageRangeGenerator::GetOffset(uint32_t aspect_index) const {}

VkExtent3D ImageRangeGenerator::GetExtent(uint32_t aspect_index) const {}

void ImageRangeGenerator::SetInitialPosFullOffset(uint32_t layer, uint32_t aspect_index) {}

void ImageRangeGenerator::SetInitialPosFullWidth(uint32_t layer, uint32_t aspect_index) {}

void ImageRangeGenerator::SetInitialPosFullHeight(uint32_t layer, uint32_t aspect_index) {}

void ImageRangeGenerator::SetInitialPosSomeDepth(uint32_t layer, uint32_t aspect_index) {}

void ImageRangeGenerator::SetInitialPosFullDepth(uint32_t layer, uint32_t aspect_index) {}

void ImageRangeGenerator::SetInitialPosSomeLayers(uint32_t layer, uint32_t aspect_index) {}

void ImageRangeGenerator::SetInitialPosAllLayers(uint32_t layer, uint32_t aspect_index) {}

void ImageRangeGenerator::SetInitialPosOneAspect(uint32_t layer, uint32_t aspect_index) {}

void ImageRangeGenerator::SetInitialPosAllSubres(uint32_t layer, uint32_t aspect_index) {}

bool ImageRangeGenerator::Convert2DCompatibleTo3D() {}
ImageRangeGenerator::ImageRangeGenerator(const ImageRangeEncoder& encoder, const VkImageSubresourceRange& subres_range,
                                         VkDeviceSize base_address, bool is_depth_sliced)
    :{}

ImageRangeGenerator::ImageRangeGenerator(const ImageRangeEncoder& encoder, const VkImageSubresourceRange& subres_range,
                                         const VkOffset3D& offset, const VkExtent3D& extent, VkDeviceSize base_address,
                                         bool is_depth_sliced)
    :{}

void ImageRangeGenerator::SetUpSubresInfo() {}

void ImageRangeGenerator::SetUpIncrementerDefaults() {}

// Assumes full extent in width/height/depth(if present)
void ImageRangeGenerator::SetUpSubresIncrementer() {}

void ImageRangeGenerator::SetUpIncrementer(bool all_width, bool all_height, bool all_depth) {}

ImageRangeGenerator& ImageRangeGenerator::operator++() {}

template <typename AspectTraits>
class AspectParametersImpl : public AspectParameters {};

struct ColorAspectTraits {};

struct DepthAspectTraits {};

struct StencilAspectTraits {};

struct DepthStencilAspectTraits {};

struct Multiplane2AspectTraits {};

struct Multiplane3AspectTraits {};

// Create the encoder parameter suitable to the full range aspect mask (*must* be canonical)
const AspectParameters* AspectParameters::Get(VkImageAspectFlags aspect_mask) {}

inline ImageRangeEncoder::SubresInfo::SubresInfo(const VkSubresourceLayout& layout_, const VkExtent3D& extent_,
                                                 const VkExtent3D& texel_extent, double texel_size)
    :{}

ImageRangeEncoder::SubresInfo::SubresInfo(const SubresInfo&rhs)
    :{}

void ImageRangeGenerator::IncrementerState::Set(uint32_t y_count_, uint32_t layer_z_count_, IndexType base, IndexType span,
                                                IndexType y_step, IndexType z_step) {}

}  // namespace subresource_adapter