2 extern "C" HRESULT STDMETHODCALLTYPE D3D10CreateBlob(
4 LPD3D10BLOB *out_buffer
7 HRESULT STDMETHODCALLTYPE D3D10CreateBlob(
9 LPD3D10BLOB *out_buffer
12 void* data = malloc(num_bytes);
15 *out_buffer = new GalliumD3DBlob(data, num_bytes);
19 LPCSTR STDMETHODCALLTYPE D3D10GetPixelShaderProfile(
26 LPCSTR STDMETHODCALLTYPE D3D10GetVertexShaderProfile(
33 LPCSTR STDMETHODCALLTYPE D3D10GetGeometryShaderProfile(
40 static HRESULT dxbc_assemble_as_blob(struct dxbc_chunk_header** chunks, unsigned num_chunks, ID3D10Blob** blob)
42 std::pair<void*, size_t> p = dxbc_assemble(chunks, num_chunks);
45 *blob = new GalliumD3DBlob(p.first, p.second);
49 HRESULT D3D10GetInputSignatureBlob(
50 const void *shader_bytecode,
51 SIZE_T bytecode_length,
52 ID3D10Blob **signature_blob
55 dxbc_chunk_signature* sig = dxbc_find_signature(shader_bytecode, bytecode_length, false);
59 return dxbc_assemble_as_blob((dxbc_chunk_header**)&sig, 1, signature_blob);
62 HRESULT D3D10GetOutputSignatureBlob(
63 const void *shader_bytecode,
64 SIZE_T bytecode_length,
65 ID3D10Blob **signature_blob
68 dxbc_chunk_signature* sig = dxbc_find_signature(shader_bytecode, bytecode_length, true);
72 return dxbc_assemble_as_blob((dxbc_chunk_header**)&sig, 1, signature_blob);
75 HRESULT D3D10GetInputAndOutputSignatureBlob(
76 const void *shader_bytecode,
77 SIZE_T bytecode_length,
78 ID3D10Blob **signature_blob
81 dxbc_chunk_signature* sigs[2];
82 sigs[0] = dxbc_find_signature(shader_bytecode, bytecode_length, false);
85 sigs[1] = dxbc_find_signature(shader_bytecode, bytecode_length, true);
89 return dxbc_assemble_as_blob((dxbc_chunk_header**)&sigs, 2, signature_blob);