diff --git a/dlls/d3dcompiler_43/blob.c b/dlls/d3dcompiler_43/blob.c index ca13f4ba6b0..8550dee34ae 100644 --- a/dlls/d3dcompiler_43/blob.c +++ b/dlls/d3dcompiler_43/blob.c @@ -137,6 +137,10 @@ static BOOL check_blob_part(DWORD tag, D3D_BLOB_PART part) if (tag == TAG_ISGN || tag == TAG_OSGN) add = TRUE; break; + case D3D_BLOB_DEBUG_INFO: + if (tag == TAG_SDBG) add = TRUE; + break; + default: FIXME("Unhandled D3D_BLOB_PART %s.\n", debug_d3dcompiler_d3d_blob_part(part)); break; @@ -204,6 +208,7 @@ HRESULT d3dcompiler_get_blob_part(const void *data, SIZE_T data_size, D3D_BLOB_P { case D3D_BLOB_INPUT_SIGNATURE_BLOB: case D3D_BLOB_OUTPUT_SIGNATURE_BLOB: + case D3D_BLOB_DEBUG_INFO: if (count != 1) count = 0; break; @@ -224,10 +229,26 @@ HRESULT d3dcompiler_get_blob_part(const void *data, SIZE_T data_size, D3D_BLOB_P return E_FAIL; } - hr = dxbc_write_blob(&dst_dxbc, blob); - if (FAILED(hr)) + /* some parts aren't full DXBCs, they contain only the data */ + if (count == 1 && (part == D3D_BLOB_DEBUG_INFO)) { - WARN("Failed to write blob part\n"); + hr = D3DCreateBlob(dst_dxbc.sections[0].data_size, blob); + if (SUCCEEDED(hr)) + { + memcpy(ID3D10Blob_GetBufferPointer(*blob), dst_dxbc.sections[0].data, dst_dxbc.sections[0].data_size); + } + else + { + WARN("Could not create blob\n"); + } + } + else + { + hr = dxbc_write_blob(&dst_dxbc, blob); + if (FAILED(hr)) + { + WARN("Failed to write blob part\n"); + } } dxbc_destroy(&src_dxbc); diff --git a/dlls/d3dcompiler_43/d3dcompiler_43.spec b/dlls/d3dcompiler_43/d3dcompiler_43.spec index e605e292250..8077be701a4 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_43.spec +++ b/dlls/d3dcompiler_43/d3dcompiler_43.spec @@ -7,7 +7,7 @@ @ stub D3DDisassemble10Effect @ stub D3DDisassemble @ stdcall D3DGetBlobPart(ptr long long long ptr) -@ stub D3DGetDebugInfo +@ stdcall D3DGetDebugInfo(ptr long ptr) @ stdcall D3DGetInputAndOutputSignatureBlob(ptr long ptr) @ stdcall D3DGetInputSignatureBlob(ptr long ptr) @ stdcall D3DGetOutputSignatureBlob(ptr long ptr) diff --git a/dlls/d3dcompiler_43/d3dcompiler_43_main.c b/dlls/d3dcompiler_43/d3dcompiler_43_main.c index d19924438aa..a7fabeffe83 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_43_main.c +++ b/dlls/d3dcompiler_43/d3dcompiler_43_main.c @@ -109,3 +109,10 @@ HRESULT WINAPI D3DGetInputAndOutputSignatureBlob(const void *data, SIZE_T data_s return d3dcompiler_get_blob_part(data, data_size, D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB, 0, blob); } + +HRESULT WINAPI D3DGetDebugInfo(const void *data, SIZE_T data_size, ID3DBlob **blob) +{ + TRACE("data %p, data_size %lu, blob %p\n", data, data_size, blob); + + return d3dcompiler_get_blob_part(data, data_size, D3D_BLOB_DEBUG_INFO, 0, blob); +} diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 41c4f5a92d7..09d42fbf766 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -583,6 +583,7 @@ void SlDeleteShader(struct bwriter_shader *shader); #define TAG_DXBC MAKE_TAG('D', 'X', 'B', 'C') #define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N') #define TAG_OSGN MAKE_TAG('O', 'S', 'G', 'N') +#define TAG_SDBG MAKE_TAG('S', 'D', 'B', 'G') struct dxbc_section { diff --git a/include/d3dcompiler.h b/include/d3dcompiler.h index 90799204e87..11ccf56d7e3 100644 --- a/include/d3dcompiler.h +++ b/include/d3dcompiler.h @@ -65,6 +65,7 @@ HRESULT WINAPI D3DGetBlobPart(const void *data, SIZE_T data_size, D3D_BLOB_PART HRESULT WINAPI D3DGetInputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob); HRESULT WINAPI D3DGetOutputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob); HRESULT WINAPI D3DGetInputAndOutputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob); +HRESULT WINAPI D3DGetDebugInfo(const void *data, SIZE_T data_size, ID3DBlob **blob); HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3DBlob **blob);