Program Listing for File d3d12-helpers.h

Return to documentation for file (include\reflection\d3d12-helpers.h)

/******************************************************************************
© Intel Corporation.

This software and the related documents are Intel copyrighted materials,
and your use of them is governed by the express license under which they
were provided to you ("License"). Unless the License provides otherwise,
you may not use, modify, copy, publish, distribute, disclose or transmit
this software or the related documents without Intel's prior written
permission.


 This software and the related documents are provided as is, with no express
or implied warranties, other than those that are expressly stated in the
License.

******************************************************************************/

#pragma once

#include "field.h"
#include "struct.h"
#include <string>
#include <vector>
#include <d3d12.h>

namespace gpa {
namespace serialization {
namespace directx {

class ParsedPipelineStreamStructContainer
{
private:
    Field mD3D12_PIPELINE_STATE_STREAM_DESCFields[2] = {};
    Struct mD3D12_PIPELINE_STATE_STREAM_DESCStructDef = {};

    std::vector<Field> mpPipelineStateSubobjectStreamFields;
    Struct mpPipelineStateSubobjectStreamStructDef = {};

    std::string mStructUniqueName;
    std::string mStreamUniqueName;

    bool mIsCompute = false;

public:
    ParsedPipelineStreamStructContainer(const D3D12_PIPELINE_STATE_STREAM_DESC* pDesc);
    Struct const* GetStructDef() const;
    bool IsCompute() const;
};

class ParsedStateObjectStructContainer
{
private:
    Field mD3D12_STATE_OBJECT_DESCFields[3] = {};
    Struct mD3D12_STATE_OBJECT_DESCStructDef = {};

    std::vector<Field> mSubobjectFields;
    Struct mD3D12_STATE_SUBOBJECT_STRUCTStructDef = {};

    Struct const* GetD3D12_STATE_SUBOBJECT_STRUCTDef(const D3D12_STATE_OBJECT_DESC& desc);

public:
    ParsedStateObjectStructContainer(const D3D12_STATE_OBJECT_DESC* pDesc);
    Struct const* GetStructDef() const;
};

class ParsedBuildRasInputsContainer
{
private:
    Field mD3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTSFields[5] = {};
    Struct mD3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTSStructDef = {};

    Field GetAnonymousUnionField(const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS& inputs);

public:
    ParsedBuildRasInputsContainer(const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS& inputs);
    Struct const* GetStructDef() const;
};

class ParsedBuildRasDescContainer
{
private:
    ParsedBuildRasInputsContainer mInputContainer;
    Field mD3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESCFields[4] = {};
    Struct mD3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESCStructDef = {};

public:
    ParsedBuildRasDescContainer(const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC& desc);
    Struct const* GetStructDef() const;
};

}  // namespace directx
}  // namespace serialization
}  // namespace gpa