dolphin/Source/Core/VideoCommon/VertexLoaderManager.h

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

54 lines
1.8 KiB
C
Raw Normal View History

// Copyright 2008 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
2016-02-26 12:55:34 -07:00
#include <memory>
#include <string>
#include <unordered_map>
#include "Common/CommonTypes.h"
2021-03-26 16:46:37 -06:00
#include "VideoCommon/CPMemory.h"
class DataReader;
class NativeVertexFormat;
struct PortableVertexDeclaration;
namespace VertexLoaderManager
{
using NativeVertexFormatMap =
std::unordered_map<PortableVertexDeclaration, std::unique_ptr<NativeVertexFormat>>;
void Init();
void Clear();
void MarkAllDirty();
// Creates or obtains a pointer to a VertexFormat representing decl.
// If this results in a VertexFormat being created, if the game later uses a matching vertex
// declaration, the one that was previously created will be used.
NativeVertexFormat* GetOrCreateMatchingFormat(const PortableVertexDeclaration& decl);
// For vertex ubershaders, all attributes need to be present, even when the vertex
// format does not contain them. This function returns a vertex format with dummy
// offsets set to the unused attributes.
NativeVertexFormat* GetUberVertexFormat(const PortableVertexDeclaration& decl);
2014-12-09 00:35:04 -07:00
// Returns -1 if buf_size is insufficient, else the amount of bytes consumed
2016-10-07 20:55:47 -06:00
int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bool is_preprocess);
NativeVertexFormat* GetCurrentVertexFormat();
// Resolved pointers to array bases. Used by vertex loaders.
2021-03-26 16:46:37 -06:00
extern u8* cached_arraybases[NUM_VERTEX_COMPONENT_ARRAYS];
void UpdateVertexArrayPointers();
// Position cache for zfreeze (3 vertices, 4 floats each to allow SIMD overwrite).
// These arrays are in reverse order.
extern float position_cache[3][4];
extern u32 position_matrix_index[4];
// VB_HAS_X. Bitmask telling what vertex components are present.
extern u32 g_current_components;
} // namespace VertexLoaderManager