summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2017-07-20 15:25:31 +1000
committerStenzek <stenzek@gmail.com>2017-07-30 17:43:59 +1000
commit4bf562589565636382b81313c2de0482e45743c0 (patch)
tree16acc9338c56d0334d0e93bde7afdccf3052f64e /Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
parentcd502990fa63e63c727d99ebf0defb3cf40583f9 (diff)
D3D: Uber shader support
Diffstat (limited to 'Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
index 01658b66e6..2e0df19808 100644
--- a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
+++ b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
@@ -13,20 +13,6 @@
namespace DX11
{
-class D3DVertexFormat : public NativeVertexFormat
-{
-public:
- D3DVertexFormat(const PortableVertexDeclaration& vtx_decl);
- ~D3DVertexFormat() { SAFE_RELEASE(m_layout); }
- void SetupVertexPointers() override;
-
-private:
- std::array<D3D11_INPUT_ELEMENT_DESC, 32> m_elems{};
- UINT m_num_elems = 0;
-
- ID3D11InputLayout* m_layout = nullptr;
-};
-
std::unique_ptr<NativeVertexFormat>
VertexManager::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl)
{
@@ -66,7 +52,6 @@ D3DVertexFormat::D3DVertexFormat(const PortableVertexDeclaration& _vtx_decl)
this->vtx_decl = _vtx_decl;
const AttributeFormat* format = &_vtx_decl.position;
-
if (format->enable)
{
m_elems[m_num_elems].SemanticName = "POSITION";
@@ -129,15 +114,22 @@ D3DVertexFormat::D3DVertexFormat(const PortableVertexDeclaration& _vtx_decl)
}
}
+D3DVertexFormat::~D3DVertexFormat()
+{
+ SAFE_RELEASE(m_layout);
+}
+
void D3DVertexFormat::SetupVertexPointers()
{
+}
+
+void D3DVertexFormat::SetInputLayout(D3DBlob* vs_bytecode)
+{
if (!m_layout)
{
// CreateInputLayout requires a shader input, but it only looks at the
// signature of the shader, so we don't need to recompute it if the shader
// changes.
- D3DBlob* vs_bytecode = DX11::VertexShaderCache::GetActiveShaderBytecode();
-
HRESULT hr = DX11::D3D::device->CreateInputLayout(
m_elems.data(), m_num_elems, vs_bytecode->Data(), vs_bytecode->Size(), &m_layout);
if (FAILED(hr))