dolphin/Source/Core/VideoBackends/D3D12/DX12VertexFormat.h
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00

33 lines
816 B
C++

// Copyright 2019 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <array>
#include <d3d12.h>
#include "Common/CommonTypes.h"
#include "VideoCommon/NativeVertexFormat.h"
namespace DX12
{
class DXVertexFormat : public NativeVertexFormat
{
public:
static const u32 MAX_VERTEX_ATTRIBUTES = 16;
DXVertexFormat(const PortableVertexDeclaration& vtx_decl);
// Passed to pipeline state creation
void GetInputLayoutDesc(D3D12_INPUT_LAYOUT_DESC* desc) const;
private:
void AddAttribute(const char* semantic_name, u32 semantic_index, u32 slot, DXGI_FORMAT format,
u32 offset);
void MapAttributes();
std::array<D3D12_INPUT_ELEMENT_DESC, MAX_VERTEX_ATTRIBUTES> m_attribute_descriptions = {};
u32 m_num_attributes = 0;
};
} // namespace DX12