Commit 3add5584 authored by Travis Athougies's avatar Travis Athougies Committed by Alexandre Julliard

d3dcompiler_43/tests: Fixed nonconformant C string literals in HLSL test suite.

parent 89991e1f
...@@ -70,10 +70,10 @@ static IDirect3DDevice9 *init_d3d9(IDirect3DVertexDeclaration9 **vdeclaration, ...@@ -70,10 +70,10 @@ static IDirect3DDevice9 *init_d3d9(IDirect3DVertexDeclaration9 **vdeclaration,
}; };
static const char *vshader_passthru_hlsl = static const char *vshader_passthru_hlsl =
"float4 vshader(float4 pos: POSITION, inout float2 texcoord: TEXCOORD0): POSITION \ "float4 vshader(float4 pos: POSITION, inout float2 texcoord: TEXCOORD0): POSITION\n"
{ \ "{\n"
return pos; \ " return pos;\n"
}"; "}";
IDirect3D9 *d3d9_ptr; IDirect3D9 *d3d9_ptr;
IDirect3DDevice9 *device_ptr = NULL; IDirect3DDevice9 *device_ptr = NULL;
...@@ -301,14 +301,14 @@ static void test_swizzle(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_ ...@@ -301,14 +301,14 @@ static void test_swizzle(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_
}; };
static const char *swizzle_test_shader = static const char *swizzle_test_shader =
"uniform float4 color; \ "uniform float4 color;\n"
float4 test(): COLOR \ "float4 test(): COLOR\n"
{ \ "{\n"
float4 ret = color; \ " float4 ret = color;\n"
ret.gb = ret.ra; \ " ret.gb = ret.ra;\n"
ret.ra = float2(0.0101, 0.0404); \ " ret.ra = float2(0.0101, 0.0404);\n"
return ret; \ " return ret;\n"
}"; "}";
ID3DXConstantTable *constants; ID3DXConstantTable *constants;
IDirect3DPixelShader9 *pshader; IDirect3DPixelShader9 *pshader;
...@@ -339,14 +339,14 @@ static void test_math(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geo ...@@ -339,14 +339,14 @@ static void test_math(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geo
}; };
static const char *order_of_operations_shader = static const char *order_of_operations_shader =
"float4 test(uniform float u, uniform float v, uniform float w, uniform float x, \ "float4 test(uniform float u, uniform float v, uniform float w, uniform float x,\n"
uniform float y, uniform float z): COLOR \ " uniform float y, uniform float z): COLOR\n"
{ \ "{\n"
return float4(x * y - z / w + --u / -v, \ " return float4(x * y - z / w + --u / -v,\n"
z * x / y + w / -v, \ " z * x / y + w / -v,\n"
u + v - w, \ " u + v - w,\n"
x / y / w); \ " x / y / w);\n"
}"; "}";
ID3DXConstantTable *constants; ID3DXConstantTable *constants;
IDirect3DPixelShader9 *pshader; IDirect3DPixelShader9 *pshader;
...@@ -383,13 +383,13 @@ static void test_conditionals(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 * ...@@ -383,13 +383,13 @@ static void test_conditionals(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *
}; };
static const char *if_greater_shader = static const char *if_greater_shader =
"float4 test(float2 pos: TEXCOORD0): COLOR \ "float4 test(float2 pos: TEXCOORD0): COLOR\n"
{ \ "{\n"
if((pos.x * 32.0) > 20.0) \ " if((pos.x * 32.0) > 20.0)\n"
return float4(0.1, 0.2, 0.3, 0.4); \ " return float4(0.1, 0.2, 0.3, 0.4);\n"
else \ " else\n"
return float4(0.9, 0.8, 0.7, 0.6); \ " return float4(0.9, 0.8, 0.7, 0.6);\n"
}"; "}";
static const struct hlsl_probe_info ternary_operator_probes[] = static const struct hlsl_probe_info ternary_operator_probes[] =
{ {
...@@ -404,10 +404,10 @@ static void test_conditionals(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 * ...@@ -404,10 +404,10 @@ static void test_conditionals(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *
}; };
static const char *ternary_operator_shader = static const char *ternary_operator_shader =
"float4 test(float2 pos: TEXCOORD0): COLOR \ "float4 test(float2 pos: TEXCOORD0): COLOR\n"
{ \ "{\n"
return (pos.x < 0.5?float4(0.5, 0.25, 0.5, 0.75):float4(0.6, 0.8, 0.1, 0.2)); \ " return (pos.x < 0.5?float4(0.5, 0.25, 0.5, 0.75):float4(0.6, 0.8, 0.1, 0.2));\n"
}"; "}";
ID3DXConstantTable *constants; ID3DXConstantTable *constants;
IDirect3DPixelShader9 *pshader; IDirect3DPixelShader9 *pshader;
...@@ -442,15 +442,15 @@ static void test_float_vectors(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 ...@@ -442,15 +442,15 @@ static void test_float_vectors(IDirect3DDevice9 *device, IDirect3DVertexBuffer9
}; };
static const char *vec4_indexing_test1_shader = static const char *vec4_indexing_test1_shader =
"float4 test(): COLOR \ "float4 test(): COLOR\n"
{ \ "{\n"
float4 color; \ " float4 color;\n"
color[0] = 0.020; \ " color[0] = 0.020;\n"
color[1] = 0.245; \ " color[1] = 0.245;\n"
color[2] = 0.351; \ " color[2] = 0.351;\n"
color[3] = 1.0; \ " color[3] = 1.0;\n"
return color; \ " return color;\n"
}"; "}";
static const struct hlsl_probe_info vec4_indexing_test2_probes[] = static const struct hlsl_probe_info vec4_indexing_test2_probes[] =
{ {
...@@ -459,14 +459,14 @@ static void test_float_vectors(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 ...@@ -459,14 +459,14 @@ static void test_float_vectors(IDirect3DDevice9 *device, IDirect3DVertexBuffer9
/* We have this uniform i here so the compiler can't optimize */ /* We have this uniform i here so the compiler can't optimize */
static const char *vec4_indexing_test2_shader = static const char *vec4_indexing_test2_shader =
"uniform int i; \ "uniform int i;\n"
float4 test(): COLOR \ "float4 test(): COLOR\n"
{ \ "{\n"
float4 color = float4(0.5, 0.4, 0.3, 0.2); \ " float4 color = float4(0.5, 0.4, 0.3, 0.2);\n"
color.g = color[i]; \ " color.g = color[i];\n"
color.b = 0.8; \ " color.b = 0.8;\n"
return color; \ " return color;\n"
}"; "}";
ID3DXConstantTable *constants; ID3DXConstantTable *constants;
IDirect3DPixelShader9 *pshader; IDirect3DPixelShader9 *pshader;
...@@ -534,13 +534,13 @@ static void test_trig(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geo ...@@ -534,13 +534,13 @@ static void test_trig(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geo
}; };
static const char *sincos_shader = static const char *sincos_shader =
"float4 test(float x: TEXCOORD0): COLOR \ "float4 test(float x: TEXCOORD0): COLOR\n"
{ \ "{\n"
const float pi2 = 6.2831853; \ " const float pi2 = 6.2831853;\n"
float calcd_sin = (sin(x * pi2) + 1)/2; \ " float calcd_sin = (sin(x * pi2) + 1)/2;\n"
float calcd_cos = (cos(x * pi2) + 1)/2; \ " float calcd_cos = (cos(x * pi2) + 1)/2;\n"
return float4(calcd_sin, calcd_cos, 0, 0); \ " return float4(calcd_sin, calcd_cos, 0, 0);\n"
}"; "}";
ID3DXConstantTable *constants; ID3DXConstantTable *constants;
IDirect3DPixelShader9 *pshader; IDirect3DPixelShader9 *pshader;
......
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