mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 10:54:16 +01:00
[d3d11] Added buffer stub
This commit is contained in:
parent
2c3674190a
commit
ea15f22492
40
src/d3d11/d3d11_buffer.cpp
Normal file
40
src/d3d11/d3d11_buffer.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
#include "d3d11_buffer.h"
|
||||
#include "d3d11_device.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
D3D11Buffer::D3D11Buffer(
|
||||
D3D11Device* device,
|
||||
const D3D11_BUFFER_DESC& desc) {
|
||||
TRACE(this, device);
|
||||
}
|
||||
|
||||
|
||||
D3D11Buffer::~D3D11Buffer() {
|
||||
TRACE(this);
|
||||
}
|
||||
|
||||
|
||||
HRESULT D3D11Buffer::QueryInterface(REFIID riid, void** ppvObject) {
|
||||
COM_QUERY_IFACE(riid, ppvObject, ID3D11Buffer);
|
||||
|
||||
Logger::warn("D3D11Buffer::QueryInterface: Unknown interface query");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
|
||||
void D3D11Buffer::GetDevice(ID3D11Device** ppDevice) {
|
||||
*ppDevice = m_device.ref();
|
||||
}
|
||||
|
||||
|
||||
void D3D11Buffer::GetType(D3D11_RESOURCE_DIMENSION* pResourceDimension) {
|
||||
*pResourceDimension = D3D11_RESOURCE_DIMENSION_BUFFER;
|
||||
}
|
||||
|
||||
|
||||
void D3D11Buffer::GetDesc(D3D11_BUFFER_DESC* pDesc) {
|
||||
*pDesc = m_desc;
|
||||
}
|
||||
|
||||
}
|
40
src/d3d11/d3d11_buffer.h
Normal file
40
src/d3d11/d3d11_buffer.h
Normal file
@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <dxvk_device.h>
|
||||
|
||||
#include "d3d11_resource.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
class D3D11Device;
|
||||
|
||||
class D3D11Buffer : public D3D11Resource<ID3D11Buffer> {
|
||||
|
||||
public:
|
||||
|
||||
D3D11Buffer(
|
||||
D3D11Device* device,
|
||||
const D3D11_BUFFER_DESC& desc);
|
||||
~D3D11Buffer();
|
||||
|
||||
HRESULT QueryInterface(
|
||||
REFIID riid,
|
||||
void** ppvObject) final;
|
||||
|
||||
void GetDevice(
|
||||
ID3D11Device **ppDevice) final;
|
||||
|
||||
void GetType(
|
||||
D3D11_RESOURCE_DIMENSION *pResourceDimension) final;
|
||||
|
||||
void GetDesc(
|
||||
D3D11_BUFFER_DESC *pDesc);
|
||||
|
||||
private:
|
||||
|
||||
Com<D3D11Device> m_device;
|
||||
D3D11_BUFFER_DESC m_desc;
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
#include <cstring>
|
||||
|
||||
#include "d3d11_buffer.h"
|
||||
#include "d3d11_context.h"
|
||||
#include "d3d11_device.h"
|
||||
|
||||
@ -42,8 +43,21 @@ namespace dxvk {
|
||||
const D3D11_BUFFER_DESC* pDesc,
|
||||
const D3D11_SUBRESOURCE_DATA* pInitialData,
|
||||
ID3D11Buffer** ppBuffer) {
|
||||
Logger::err("D3D11Device::CreateBuffer: Not implemented");
|
||||
return E_NOTIMPL;
|
||||
if (ppBuffer == nullptr)
|
||||
return S_OK;
|
||||
|
||||
if (pInitialData != nullptr) {
|
||||
Logger::err("D3D11Device::CreateBuffer: pInitialData != NULL not supported");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
try {
|
||||
*ppBuffer = ref(new D3D11Buffer(this, *pDesc));
|
||||
return S_OK;
|
||||
} catch (const DxvkError& e) {
|
||||
Logger::err(e.message());
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -215,6 +215,10 @@ namespace dxvk {
|
||||
|
||||
UINT GetExceptionMode() final;
|
||||
|
||||
DxvkDevice* GetDXVKDevice() {
|
||||
return m_dxvkDevice.ptr();
|
||||
}
|
||||
|
||||
static bool CheckFeatureLevelSupport(
|
||||
D3D_FEATURE_LEVEL featureLevel);
|
||||
|
||||
|
26
src/d3d11/d3d11_resource.h
Normal file
26
src/d3d11/d3d11_resource.h
Normal file
@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include "d3d11_device_child.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
template<typename Base>
|
||||
class D3D11Resource : public D3D11DeviceChild<Base> {
|
||||
|
||||
public:
|
||||
|
||||
UINT GetEvictionPriority() final {
|
||||
return m_evictionPriority;
|
||||
}
|
||||
|
||||
void SetEvictionPriority(UINT EvictionPriority) final {
|
||||
m_evictionPriority = EvictionPriority;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
UINT m_evictionPriority = 0;
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
d3d11_src = [
|
||||
'd3d11_buffer.cpp',
|
||||
'd3d11_context.cpp',
|
||||
'd3d11_device.cpp',
|
||||
'd3d11_main.cpp',
|
||||
|
Loading…
x
Reference in New Issue
Block a user