[2/2] d3dcompiler: Enable newline string terminator in shader preprocessor.

Józef Kucia joseph.kucia at gmail.com
Fri Mar 16 07:22:20 CDT 2012


---
 dlls/d3dcompiler_43/compiler.c  |    2 ++
 dlls/d3dcompiler_43/tests/asm.c |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c
index 7f4ebdb..1b7385a 100644
--- a/dlls/d3dcompiler_43/compiler.c
+++ b/dlls/d3dcompiler_43/compiler.c
@@ -348,6 +348,8 @@ static HRESULT preprocess_shader(const void *data, SIZE_T data_size,
     current_shader.buffer = data;
     current_shader.size = data_size;

+    wpp_set_newline_string_terminator(1);
+
     ret = wpp_parse("", NULL);
     if (!wpp_close_output())
         ret = 1;
diff --git a/dlls/d3dcompiler_43/tests/asm.c b/dlls/d3dcompiler_43/tests/asm.c
index 1e986df..c216abb 100644
--- a/dlls/d3dcompiler_43/tests/asm.c
+++ b/dlls/d3dcompiler_43/tests/asm.c
@@ -1643,7 +1643,12 @@ static void d3dpreprocess_test(void)
     messages = NULL;
     hr = D3DPreprocess(quotation_marks_test, strlen(quotation_marks_test), NULL,
             NULL, NULL, &shader, &messages);
-    todo_wine ok(hr == S_OK, "quotation marks test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
+    ok(hr == S_OK, "quotation marks test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
+    if (SUCCEEDED(hr))
+    {
+        const char *preprocessed_shader = ID3D10Blob_GetBufferPointer(shader);
+        ok(strstr(preprocessed_shader, "mov") != NULL, "Expected 'mov' instruction in preprocessed shader\n");
+    } else skip("Failed to preprocess shader\n");
     if (messages)
     {
         trace("D3DPreprocess messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
--
1.7.8.5




More information about the wine-patches mailing list