dolphin/Source/Core/VideoBackends/D3D12/DX12VertexFormat.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
857 B
C
Raw Permalink Normal View History

2019-03-28 10:35:46 +00:00
// Copyright 2019 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2019-03-28 10:35:46 +00:00
#pragma once
#include <array>
#include <d3d12.h>
#include "Common/CommonTypes.h"
#include "VideoCommon/NativeVertexFormat.h"
enum class ShaderAttrib : u32;
2019-03-28 10:35:46 +00:00
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, ShaderAttrib semantic_index, u32 slot,
DXGI_FORMAT format, u32 offset);
2019-03-28 10:35:46 +00:00
void MapAttributes();
std::array<D3D12_INPUT_ELEMENT_DESC, MAX_VERTEX_ATTRIBUTES> m_attribute_descriptions = {};
u32 m_num_attributes = 0;
};
} // namespace DX12