On 4/6/20 12:47 PM, Jactry Zeng wrote:
- if (!ReadFile(file, source, source_size, &read_size, NULL) || (read_size != source_size))
- {
WARN("Failed to read file contents.\n");
hr = E_FAIL;
goto end;
- }
- hr = D3DCompile(source, strlen(source), NULL, defines, includes, entrypoint, target, flags1, flags2, code, errors);
Length passed to D3DCompile() does not look right. Shouldn't you pass source_size there instead? Also mapping the file is probably easier.