MCPcopy Create free account
hub / github.com/crosire/reshade / create_input_layout

Method create_input_layout

source/d3d10/d3d10_impl_device.cpp:578–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578bool reshade::d3d10::device_impl::create_input_layout(uint32_t count, const api::input_element *desc, const api::shader_desc &signature, api::pipeline *out_pipeline)
579{
580 static_assert(alignof(ID3D10InputLayout) >= 2);
581
582 // Empty input layout is valid, but generates a warning, so just return success and a zero handle
583 if (count == 0)
584 {
585 *out_pipeline = { 0 };
586 return true;
587 }
588
589 std::vector<D3D10_INPUT_ELEMENT_DESC> internal_desc(count);
590 for (uint32_t i = 0; i < count; ++i)
591 convert_input_element(desc[i], internal_desc[i]);
592
593 if (com_ptr<ID3D10InputLayout> object;
594 SUCCEEDED(_orig->CreateInputLayout(internal_desc.data(), static_cast<UINT>(internal_desc.size()), signature.code, signature.code_size, &object)))
595 {
596 *out_pipeline = to_handle(object.release());
597 return true;
598 }
599 else
600 {
601 *out_pipeline = { 0 };
602 return false;
603 }
604}
605bool reshade::d3d10::device_impl::create_vertex_shader(const api::shader_desc &desc, api::pipeline *out_pipeline)
606{
607 static_assert(alignof(ID3D10VertexShader) >= 2);

Callers

nothing calls this directly

Calls 3

releaseMethod · 0.80
to_handleFunction · 0.70
CreateInputLayoutMethod · 0.45

Tested by

no test coverage detected