Hello Travis,
On 12/22/2010 10:31 PM, Travis Athougies wrote:
Tests to ensure the HLSL compiler won't crash on malformed input.
dlls/d3dcompiler_43/tests/hlsl.c | 87 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 87 insertions(+), 0 deletions(-)
diff --git a/dlls/d3dcompiler_43/tests/hlsl.c b/dlls/d3dcompiler_43/tests/hlsl.c index 1f8e31c..a6a6099 100644 --- a/dlls/d3dcompiler_43/tests/hlsl.c +++ b/dlls/d3dcompiler_43/tests/hlsl.c @@ -556,6 +556,92 @@ static void test_trig(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geo } }
+static void test_fail(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *qquad_geometry,
IDirect3DVertexShader9 *vshader_passthru)
+{
- static const char *undefined_variable_shader =
"float4 test(float2 pos: TEXCOORD0) : COLOR \
{ \
return y; \
}";
please use proper C string literals. Escaping the newline is a gcc extension. You can use string literal concatenation to split the string on multiple lines. Something like this would do: "float4 test(float2 pos: TEXCOORD0) : COLOR" "{" " return y;" "}";
bye michael
Am 23.12.2010 00:37, schrieb Michael Stefaniuc:
Hello Travis,
On 12/22/2010 10:31 PM, Travis Athougies wrote:
Tests to ensure the HLSL compiler won't crash on malformed input.
dlls/d3dcompiler_43/tests/hlsl.c | 87 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 87 insertions(+), 0 deletions(-)
diff --git a/dlls/d3dcompiler_43/tests/hlsl.c b/dlls/d3dcompiler_43/tests/hlsl.c index 1f8e31c..a6a6099 100644 --- a/dlls/d3dcompiler_43/tests/hlsl.c +++ b/dlls/d3dcompiler_43/tests/hlsl.c @@ -556,6 +556,92 @@ static void test_trig(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geo } }
+static void test_fail(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *qquad_geometry,
IDirect3DVertexShader9 *vshader_passthru)
+{
- static const char *undefined_variable_shader =
"float4 test(float2 pos: TEXCOORD0) : COLOR \
{ \
return y; \
}";
please use proper C string literals. Escaping the newline is a gcc extension. You can use string literal concatenation to split the string on multiple lines. Something like this would do: "float4 test(float2 pos: TEXCOORD0) : COLOR" "{" " return y;" "}";
bye michael
You probably may use ID3D10Blob_Release() instead of IUnknown_Release(). This way you could drop the cast.
What happens to the ID3D10Blob *compiled? Is it still NULL after each call to D3DCompile or is it an valid blob which has to be released?
Cheers Rico
To address, the C string literals issue, this is the same format I have used for the other test strings. It would seem inconsistent to break this now. Maybe a later patch can address this.
I've used IUnknown_Release in other places to free ID3D10Blobs, so it also seems inconsistent to use ID3D10Blob_Release here. However, I did not cast it those other times, so I will remove the casts in my next attempt
And yes, compiled is NULL if the compile failed.
Travis.
2010/12/23 Rico Schüller kgbricola@web.de:
Am 23.12.2010 00:37, schrieb Michael Stefaniuc:
Hello Travis,
On 12/22/2010 10:31 PM, Travis Athougies wrote:
Tests to ensure the HLSL compiler won't crash on malformed input.
dlls/d3dcompiler_43/tests/hlsl.c | 87 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 87 insertions(+), 0 deletions(-)
diff --git a/dlls/d3dcompiler_43/tests/hlsl.c b/dlls/d3dcompiler_43/tests/hlsl.c index 1f8e31c..a6a6099 100644 --- a/dlls/d3dcompiler_43/tests/hlsl.c +++ b/dlls/d3dcompiler_43/tests/hlsl.c @@ -556,6 +556,92 @@ static void test_trig(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geo } }
+static void test_fail(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *qquad_geometry,
- IDirect3DVertexShader9 *vshader_passthru)
+{
- static const char *undefined_variable_shader =
- "float4 test(float2 pos: TEXCOORD0) : COLOR \
- { \
- return y; \
- }";
please use proper C string literals. Escaping the newline is a gcc extension. You can use string literal concatenation to split the string on multiple lines. Something like this would do: "float4 test(float2 pos: TEXCOORD0) : COLOR" "{" " return y;" "}";
bye michael
You probably may use ID3D10Blob_Release() instead of IUnknown_Release(). This way you could drop the cast.
What happens to the ID3D10Blob *compiled? Is it still NULL after each call to D3DCompile or is it an valid blob which has to be released?
Cheers Rico