Commit a44681e1 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3dcompiler: Wrap fx_4_x output in a dxbc container.

parent d01ae151
......@@ -601,6 +601,20 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen
return S_OK;
}
/* Unlike other effect profiles fx_4_x is using DXBC container. */
if (!strcmp(profile, "fx_4_0") || !strcmp(profile, "fx_4_1"))
{
struct vkd3d_shader_dxbc_section_desc section = { .tag = TAG_FX10, .data = byte_code };
struct vkd3d_shader_code dxbc;
ret = vkd3d_shader_serialize_dxbc(1, &section, &dxbc, NULL);
vkd3d_shader_free_shader_code(&byte_code);
if (ret)
return hresult_from_vkd3d_result(ret);
byte_code = dxbc;
}
if (SUCCEEDED(hr = D3DCreateBlob(byte_code.size, shader_blob)))
memcpy(ID3D10Blob_GetBufferPointer(*shader_blob), byte_code.code, byte_code.size);
......
......@@ -523,6 +523,7 @@ void SlDeleteShader(struct bwriter_shader *shader);
((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
#define TAG_Aon9 MAKE_TAG('A', 'o', 'n', '9')
#define TAG_DXBC MAKE_TAG('D', 'X', 'B', 'C')
#define TAG_FX10 MAKE_TAG('F', 'X', '1', '0')
#define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N')
#define TAG_OSGN MAKE_TAG('O', 'S', 'G', 'N')
#define TAG_OSG5 MAKE_TAG('O', 'S', 'G', '5')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment