2017-12-07 12:45:02 +01:00
|
|
|
#include "d3d11_device.h"
|
|
|
|
#include "d3d11_input_layout.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
D3D11InputLayout::D3D11InputLayout(
|
|
|
|
D3D11Device* pDevice,
|
2017-12-08 00:44:58 +01:00
|
|
|
uint32_t numAttributes,
|
|
|
|
const DxvkVertexAttribute* pAttributes,
|
|
|
|
uint32_t numBindings,
|
|
|
|
const DxvkVertexBinding* pBindings)
|
|
|
|
: m_device(pDevice) {
|
|
|
|
m_attributes.resize(numAttributes);
|
|
|
|
m_bindings.resize(numBindings);
|
2017-12-07 12:45:02 +01:00
|
|
|
|
2017-12-08 00:44:58 +01:00
|
|
|
for (uint32_t i = 0; i < numAttributes; i++)
|
|
|
|
m_attributes.at(i) = pAttributes[i];
|
|
|
|
|
|
|
|
for (uint32_t i = 0; i < numBindings; i++)
|
|
|
|
m_bindings.at(i) = pBindings[i];
|
2017-12-07 12:45:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
D3D11InputLayout::~D3D11InputLayout() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE D3D11InputLayout::QueryInterface(REFIID riid, void** ppvObject) {
|
2018-04-02 12:52:02 +02:00
|
|
|
*ppvObject = nullptr;
|
|
|
|
|
|
|
|
if (riid == __uuidof(IUnknown)
|
|
|
|
|| riid == __uuidof(ID3D11DeviceChild)
|
|
|
|
|| riid == __uuidof(ID3D11InputLayout)) {
|
|
|
|
*ppvObject = ref(this);
|
|
|
|
return S_OK;
|
|
|
|
}
|
2017-12-07 12:45:02 +01:00
|
|
|
|
|
|
|
Logger::warn("D3D11InputLayout::QueryInterface: Unknown interface query");
|
2018-03-12 12:05:43 +01:00
|
|
|
Logger::warn(str::format(riid));
|
2017-12-07 12:45:02 +01:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
void STDMETHODCALLTYPE D3D11InputLayout::GetDevice(ID3D11Device** ppDevice) {
|
2017-12-09 15:57:05 +01:00
|
|
|
*ppDevice = m_device.ref();
|
2017-12-07 12:45:02 +01:00
|
|
|
}
|
|
|
|
|
2017-12-08 00:44:58 +01:00
|
|
|
|
|
|
|
void D3D11InputLayout::BindToContext(const Rc<DxvkContext>& ctx) {
|
|
|
|
ctx->setInputLayout(
|
|
|
|
m_attributes.size(),
|
|
|
|
m_attributes.data(),
|
|
|
|
m_bindings.size(),
|
|
|
|
m_bindings.data());
|
|
|
|
}
|
|
|
|
|
2017-12-07 12:45:02 +01:00
|
|
|
}
|