1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-24 04:54:14 +01:00
dxvk/src/d3d11/d3d11_input_layout.h
Philip Rebohle 8cd97959f2
[d3d11] Chjeck whether input layouts are identical
Prevents redundant state changes when a game switches between
identical input layouts. Reduces the the number of Vulkan
calls in Grim Dawn by ~30%.
2018-05-27 01:10:49 +02:00

45 lines
1017 B
C++

#pragma once
#include "d3d11_device_child.h"
namespace dxvk {
class D3D11Device;
class D3D11InputLayout : public D3D11DeviceChild<ID3D11InputLayout> {
public:
D3D11InputLayout(
D3D11Device* pDevice,
uint32_t numAttributes,
const DxvkVertexAttribute* pAttributes,
uint32_t numBindings,
const DxvkVertexBinding* pBindings);
~D3D11InputLayout();
HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject) final;
void STDMETHODCALLTYPE GetDevice(
ID3D11Device** ppDevice) final;
void BindToContext(
const Rc<DxvkContext>& ctx);
bool Compare(
const D3D11InputLayout* pOther) const;
private:
Com<D3D11Device> m_device;
std::vector<DxvkVertexAttribute> m_attributes;
std::vector<DxvkVertexBinding> m_bindings;
};
}