Re: [Piglit] [PATCH] cl: Add test for CSR VGPRs caused by SGPR spilling

2018-08-13 Thread Jan Vesely
On Mon, 2018-08-13 at 23:29 +0300, Matt Arsenault wrote:
> > On May 8, 2018, at 18:45, Jan Vesely  wrote:
> > 
> > On Tue, 2018-05-08 at 13:28 +0300, Matt Arsenault wrote:
> > > > On Apr 8, 2018, at 19:56, Jan Vesely  wrote:
> > > > 
> > > > On Fri, 2018-04-06 at 00:49 -0400, Matt Arsenault wrote:
> > > > > ping
> > > > 
> > > > I'll need to setup the rocm stack to test this. It will take some time.
> > > > It should work with clover as well (modulo bugs; asm parser, function
> > > > calls, ...), right?
> > > > 
> > > > Jan
> > > 
> > > I thought calls were broken in general with clover because of the
> > > missing link step? Besides that it should work
> > 
> > Linking works (both linking with libclc and cl-1.2 clLinkProgram) it
> > just happens at IR level (if you consider that linking) so all function
> > calls can be inlined.
> > 
> > The problem is that llvm backend generates relocation for function
> > calls. This relocation is not handled by clover (you could call this
> > 'calls are broken in general').
> > 
> > I see two ways to fix this;
> > a) fix llvm to use fixup instead of relocation for internal function
> > calls.
> > b) fix clover to handle the function call relocation.
> > 
> > I tried a) but a simple
> > "|| (GV->getLinkage() == GlobalValue::InternalLinkage)"
> > in shouldEmitFixup() is not enough (the fixup value looks wrong)
> > 
> > I still think that a) is preferable, but now that 6.0 is out with the
> > breakage we'll need to implement b) anyway.
> > 
> > I'll try to find some time to dig a bit more into this, but it's tricky
> > since wrong jump leaves the GPU in unrecoverable state that needs
> > manual power cycling on reboot.
> > 
> > Jan
> > > 
> > > -Matt
> 
> 
> ping. Should this just skip the clover platform for now?

this already skips clover due to device regexp (gfx). I just want to
see it run (pass or fail) before stamping it.
It can be either clover (with function calls fixed and changed device
regexp) or other OCL implementation.
Given how user-hostile to rocm-ocl setup is and that -pro version
segfaults, getting clover to support relocations is more likely.

Jan
-- 
Jan Vesely 

signature.asc
Description: This is a digitally signed message part
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] cl: Add bigger versions of calls with struct tests

2018-08-13 Thread Jan Vesely
On Mon, 2018-08-13 at 13:41 -0700, Matt Arsenault wrote:
> These are just bigger versions of the existing struct
> calls tests so that they stress using byval/sret. The
> existing call with struct tests are now passed directly
> in registers.
> 
> v2: Rename struct member

passes on POCL.
Reviewed-by: Jan Vesely 

I'd help I you cc'ed me on patches you want me to merge directly,
rather than sending a ping later. sifting through the ML requires
extra time.

Jan

> ---
>  .../cl/program/execute/calls-large-struct.cl  | 156 ++
>  tests/cl/program/execute/calls-struct.cl  |  96 +--
>  2 files changed, 204 insertions(+), 48 deletions(-)
>  create mode 100644 tests/cl/program/execute/calls-large-struct.cl
> 
> diff --git a/tests/cl/program/execute/calls-large-struct.cl 
> b/tests/cl/program/execute/calls-large-struct.cl
> new file mode 100644
> index 0..c10458f37
> --- /dev/null
> +++ b/tests/cl/program/execute/calls-large-struct.cl
> @@ -0,0 +1,156 @@
> +/*!
> +
> +[config]
> +name: calls with large structs
> +clc_version_min: 10
> +
> +[test]
> +name: byval struct
> +kernel_name: call_i32_func_byval_Char_IntArray
> +dimensions: 1
> +global_size: 16 0 0
> +
> +arg_out: 0 buffer int[16]\
> + 1021 1022 1023 1024 1025 1026 1027 1028 \
> + 1029 1030 1031 1032 1033 1034 1035 1036
> +
> +arg_out: 1 buffer int[16] \
> +  14   14   14   14 \
> +  14   14   14   14 \
> +  14   14   14   14 \
> +  14   14   14   14 \
> +
> +arg_in: 2 buffer int[16] \
> + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
> +
> +
> +[test]
> +name: sret struct
> +kernel_name: call_sret_Char_IntArray_func
> +dimensions: 1
> +global_size: 16 0 0
> +
> +arg_out: 0 buffer int[16]\
> + 921 922 923 924 925 926 927 928 \
> + 929 930 931 932 933 934 935 936
> +
> +arg_in: 1 buffer int[16] \
> + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
> +
> +!*/
> +
> +#define NOINLINE __attribute__((noinline))
> +
> +typedef struct ByVal_Char_IntArray {
> +char c;
> +int i32_arr[32];
> +} ByVal_Char_IntArray;
> +
> +NOINLINE
> +int i32_func_byval_Char_IntArray(ByVal_Char_IntArray st)
> +{
> +st.i32_arr[0] += 100;
> +
> +int sum = 0;
> +for (int i = 0; i < 32; ++i)
> +{
> +sum += st.i32_arr[i];
> +}
> +
> +sum += st.c;
> +return sum;
> +}
> +
> +kernel void call_i32_func_byval_Char_IntArray(global int* out0,
> +  global int* out1,
> +  global int* input)
> +{
> +ByVal_Char_IntArray st;
> +st.c = 15;
> +
> +int id = get_global_id(0);
> +
> +int val = input[id];
> +
> +
> +st.i32_arr[0] = 14;
> +st.i32_arr[1] = -8;
> +st.i32_arr[2] = val;
> +st.i32_arr[3] = 900;
> +
> +for (int i = 4; i < 32; ++i)
> +{
> +st.i32_arr[i] = 0;
> +}
> +
> +volatile int stack_object[16];
> +for (int i = 0; i < 16; ++i)
> +{
> +const int test_val = 0x07080900 | i;
> +stack_object[i] = test_val;
> +}
> +
> +int result = i32_func_byval_Char_IntArray(st);
> +
> +// Check for stack corruption
> +for (int i = 0; i < 16; ++i)
> +{
> +const int test_val = 0x07080900 | i;
> +if (stack_object[i] != test_val)
> +result = -1;
> +}
> +
> +out0[id] = result;
> +out1[id] = st.i32_arr[0];
> +}
> +
> +NOINLINE
> +ByVal_Char_IntArray sret_Char_IntArray_func(global int* input, int id)
> +{
> +ByVal_Char_IntArray st;
> +st.c = 15;
> +
> +int val = input[id];
> +st.i32_arr[0] = 14;
> +st.i32_arr[1] = -8;
> +st.i32_arr[2] = val;
> +st.i32_arr[3] = 900;
> +
> +for (int i = 4; i < 32; ++i)
> +{
> +st.i32_arr[i] = 0;
> +}
> +
> +return st;
> +}
> +
> +kernel void call_sret_Char_IntArray_func(global int* output, global int* 
> input)
> +{
> +volatile int stack_object[16];
> +for (int i = 0; i < 16; ++i)
> +{
> +const int test_val = 0x04030200 | i;
> +stack_object[i] = test_val;
> +}
> +
> +int id = get_global_id(0);
> +ByVal_Char_IntArray st = sret_Char_IntArray_func(input, id);
> +
> +int sum = 0;
> +for (int i = 0; i < 32; ++i)
> +{
> +sum += st.i32_arr[i];
> +}
> +
> +sum += st.c;
> +
> +// Check for stack corruption
> +for (int i = 0; i < 16; ++i)
> +{
> +const int test_val = 0x04030200 | i;
> +if (stack_object[i] != test_val)
> +sum = -1;
> +}
> +
> +output[id] = sum;
> +}
> diff --git a/tests/cl/program/execute/calls-struct.cl 
> b/tests/cl/program/execute/calls-struct.cl
> index 04f769dac..3e1fa6a85 100644
> --- a/tests/cl/program/execute/calls-struct.cl
> +++ b/tests/cl/program/execute/calls-struct.cl
> @@ -1,12 +1,12 @@
>  /*!
>  
>  [config]
> -name: calls with structs
> +name: calls with structs passed in registers on amdgcn
>  clc_version_min: 10
>  
>  [test]
> -name: byval struct
> -kernel_name: call_i32_func_byval_Char_IntArray
> 

Re: [Piglit] [PATCH] cl: Fix types to be unsigned

2018-08-13 Thread Jan Vesely
On Mon, 2018-08-13 at 23:42 +0300, Matt Arsenault wrote:
> ping

Reviewed-by: Jan Vesely 

> 
> > On Oct 27, 2017, at 13:03, Matt Arsenault  wrote:
> > 
> > Doesn't really matter.

so why change it?
still passes on clover carrizo/iceland

Jan

> > ---
> > tests/cl/program/execute/store-hi16.cl | 8 
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/tests/cl/program/execute/store-hi16.cl 
> > b/tests/cl/program/execute/store-hi16.cl
> > index b734b3766..4273d3369 100644
> > --- a/tests/cl/program/execute/store-hi16.cl
> > +++ b/tests/cl/program/execute/store-hi16.cl
> > @@ -92,7 +92,7 @@ kernel void store_hi16_global(volatile global ushort* 
> > out, volatile global uint*
> > 
> > kernel void store_hi16_local(volatile global ushort* out, volatile global 
> > uint* in)
> > {
> > -volatile local short lds[64];
> > +volatile local ushort lds[64];
> > int lid = get_local_id(0);
> > int gid = get_global_id(0);
> > 
> > @@ -104,7 +104,7 @@ kernel void store_hi16_local(volatile global ushort* 
> > out, volatile global uint*
> > kernel void store_hi16_private(volatile global ushort* out, volatile global 
> > uint* in)
> > {
> > int gid = get_global_id(0);
> > -volatile private short stack = in[gid] >> 16;
> > +volatile private ushort stack = in[gid] >> 16;
> > out[gid] = stack;
> > }
> > 
> > @@ -117,7 +117,7 @@ kernel void truncstorei8_hi16_global(volatile global 
> > uchar* out, volatile global
> > 
> > kernel void truncstorei8_hi16_local(volatile global uchar* out, volatile 
> > global uint* in)
> > {
> > -volatile local short lds[64];
> > +volatile local ushort lds[64];
> > int lid = get_local_id(0);
> > int gid = get_global_id(0);
> > 
> > @@ -129,6 +129,6 @@ kernel void truncstorei8_hi16_local(volatile global 
> > uchar* out, volatile global
> > kernel void truncstorei8_hi16_private(volatile global uchar* out, volatile 
> > global uint* in)
> > {
> > int gid = get_global_id(0);
> > -volatile private short stack = in[gid] >> 16;
> > +volatile private ushort stack = in[gid] >> 16;
> > out[gid] = (uchar)stack;
> > }
> > -- 
> > 2.11.0
> > 
> 
> 

-- 
Jan Vesely 

signature.asc
Description: This is a digitally signed message part
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] cl: Fix types to be unsigned

2018-08-13 Thread Matt Arsenault
ping

> On Oct 27, 2017, at 13:03, Matt Arsenault  wrote:
> 
> Doesn't really matter.
> ---
> tests/cl/program/execute/store-hi16.cl | 8 
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/cl/program/execute/store-hi16.cl 
> b/tests/cl/program/execute/store-hi16.cl
> index b734b3766..4273d3369 100644
> --- a/tests/cl/program/execute/store-hi16.cl
> +++ b/tests/cl/program/execute/store-hi16.cl
> @@ -92,7 +92,7 @@ kernel void store_hi16_global(volatile global ushort* out, 
> volatile global uint*
> 
> kernel void store_hi16_local(volatile global ushort* out, volatile global 
> uint* in)
> {
> -volatile local short lds[64];
> +volatile local ushort lds[64];
> int lid = get_local_id(0);
> int gid = get_global_id(0);
> 
> @@ -104,7 +104,7 @@ kernel void store_hi16_local(volatile global ushort* out, 
> volatile global uint*
> kernel void store_hi16_private(volatile global ushort* out, volatile global 
> uint* in)
> {
> int gid = get_global_id(0);
> -volatile private short stack = in[gid] >> 16;
> +volatile private ushort stack = in[gid] >> 16;
> out[gid] = stack;
> }
> 
> @@ -117,7 +117,7 @@ kernel void truncstorei8_hi16_global(volatile global 
> uchar* out, volatile global
> 
> kernel void truncstorei8_hi16_local(volatile global uchar* out, volatile 
> global uint* in)
> {
> -volatile local short lds[64];
> +volatile local ushort lds[64];
> int lid = get_local_id(0);
> int gid = get_global_id(0);
> 
> @@ -129,6 +129,6 @@ kernel void truncstorei8_hi16_local(volatile global 
> uchar* out, volatile global
> kernel void truncstorei8_hi16_private(volatile global uchar* out, volatile 
> global uint* in)
> {
> int gid = get_global_id(0);
> -volatile private short stack = in[gid] >> 16;
> +volatile private ushort stack = in[gid] >> 16;
> out[gid] = (uchar)stack;
> }
> -- 
> 2.11.0
> 

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] cl: Add bigger versions of calls with struct tests

2018-08-13 Thread Matt Arsenault
These are just bigger versions of the existing struct
calls tests so that they stress using byval/sret. The
existing call with struct tests are now passed directly
in registers.

v2: Rename struct member
---
 .../cl/program/execute/calls-large-struct.cl  | 156 ++
 tests/cl/program/execute/calls-struct.cl  |  96 +--
 2 files changed, 204 insertions(+), 48 deletions(-)
 create mode 100644 tests/cl/program/execute/calls-large-struct.cl

diff --git a/tests/cl/program/execute/calls-large-struct.cl 
b/tests/cl/program/execute/calls-large-struct.cl
new file mode 100644
index 0..c10458f37
--- /dev/null
+++ b/tests/cl/program/execute/calls-large-struct.cl
@@ -0,0 +1,156 @@
+/*!
+
+[config]
+name: calls with large structs
+clc_version_min: 10
+
+[test]
+name: byval struct
+kernel_name: call_i32_func_byval_Char_IntArray
+dimensions: 1
+global_size: 16 0 0
+
+arg_out: 0 buffer int[16]\
+ 1021 1022 1023 1024 1025 1026 1027 1028 \
+ 1029 1030 1031 1032 1033 1034 1035 1036
+
+arg_out: 1 buffer int[16] \
+  14   14   14   14 \
+  14   14   14   14 \
+  14   14   14   14 \
+  14   14   14   14 \
+
+arg_in: 2 buffer int[16] \
+ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+
+
+[test]
+name: sret struct
+kernel_name: call_sret_Char_IntArray_func
+dimensions: 1
+global_size: 16 0 0
+
+arg_out: 0 buffer int[16]\
+ 921 922 923 924 925 926 927 928 \
+ 929 930 931 932 933 934 935 936
+
+arg_in: 1 buffer int[16] \
+ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+
+!*/
+
+#define NOINLINE __attribute__((noinline))
+
+typedef struct ByVal_Char_IntArray {
+char c;
+int i32_arr[32];
+} ByVal_Char_IntArray;
+
+NOINLINE
+int i32_func_byval_Char_IntArray(ByVal_Char_IntArray st)
+{
+st.i32_arr[0] += 100;
+
+int sum = 0;
+for (int i = 0; i < 32; ++i)
+{
+sum += st.i32_arr[i];
+}
+
+sum += st.c;
+return sum;
+}
+
+kernel void call_i32_func_byval_Char_IntArray(global int* out0,
+  global int* out1,
+  global int* input)
+{
+ByVal_Char_IntArray st;
+st.c = 15;
+
+int id = get_global_id(0);
+
+int val = input[id];
+
+
+st.i32_arr[0] = 14;
+st.i32_arr[1] = -8;
+st.i32_arr[2] = val;
+st.i32_arr[3] = 900;
+
+for (int i = 4; i < 32; ++i)
+{
+st.i32_arr[i] = 0;
+}
+
+volatile int stack_object[16];
+for (int i = 0; i < 16; ++i)
+{
+const int test_val = 0x07080900 | i;
+stack_object[i] = test_val;
+}
+
+int result = i32_func_byval_Char_IntArray(st);
+
+// Check for stack corruption
+for (int i = 0; i < 16; ++i)
+{
+const int test_val = 0x07080900 | i;
+if (stack_object[i] != test_val)
+result = -1;
+}
+
+out0[id] = result;
+out1[id] = st.i32_arr[0];
+}
+
+NOINLINE
+ByVal_Char_IntArray sret_Char_IntArray_func(global int* input, int id)
+{
+ByVal_Char_IntArray st;
+st.c = 15;
+
+int val = input[id];
+st.i32_arr[0] = 14;
+st.i32_arr[1] = -8;
+st.i32_arr[2] = val;
+st.i32_arr[3] = 900;
+
+for (int i = 4; i < 32; ++i)
+{
+st.i32_arr[i] = 0;
+}
+
+return st;
+}
+
+kernel void call_sret_Char_IntArray_func(global int* output, global int* input)
+{
+volatile int stack_object[16];
+for (int i = 0; i < 16; ++i)
+{
+const int test_val = 0x04030200 | i;
+stack_object[i] = test_val;
+}
+
+int id = get_global_id(0);
+ByVal_Char_IntArray st = sret_Char_IntArray_func(input, id);
+
+int sum = 0;
+for (int i = 0; i < 32; ++i)
+{
+sum += st.i32_arr[i];
+}
+
+sum += st.c;
+
+// Check for stack corruption
+for (int i = 0; i < 16; ++i)
+{
+const int test_val = 0x04030200 | i;
+if (stack_object[i] != test_val)
+sum = -1;
+}
+
+output[id] = sum;
+}
diff --git a/tests/cl/program/execute/calls-struct.cl 
b/tests/cl/program/execute/calls-struct.cl
index 04f769dac..3e1fa6a85 100644
--- a/tests/cl/program/execute/calls-struct.cl
+++ b/tests/cl/program/execute/calls-struct.cl
@@ -1,12 +1,12 @@
 /*!
 
 [config]
-name: calls with structs
+name: calls with structs passed in registers on amdgcn
 clc_version_min: 10
 
 [test]
-name: byval struct
-kernel_name: call_i32_func_byval_Char_IntArray
+name: regs struct
+kernel_name: call_i32_func_small_struct_regs_Char_IntArray
 dimensions: 1
 global_size: 16 0 0
 
@@ -25,8 +25,8 @@ arg_in: 2 buffer int[16] \
 
 
 [test]
-name: sret struct
-kernel_name: call_sret_Char_IntArray_func
+name: struct_smallregs struct
+kernel_name: call_struct_smallregs_Char_IntArray_func
 dimensions: 1
 global_size: 16 0 0
 
@@ -39,8 +39,8 @@ arg_in: 1 buffer int[16] \
 
 
 [test]
-name: byval struct and sret struct
-kernel_name: call_sret_Char_IntArray_func_byval_Char_IntArray
+name: small struct in regs
+kernel_name: 
call_struct_smallregs_Char_IntArray_func_small_struct_regs_Char_IntArray
 

Re: [Piglit] [PATCH] cl: Add bigger versions of calls with struct tests

2018-08-13 Thread Matt Arsenault


> On Mar 23, 2018, at 23:07, Jan Vesely  wrote:
> 
> On Thu, 2018-03-15 at 11:41 -0400, Matt Arsenault wrote:
>> ping
>> 
>>> On Oct 12, 2017, at 16:19, Matt Arsenault  wrote:
>>> 
>>> These are just bigger versions of the existing struct
>>> calls tests so that they stress using byval/sret. The
>>> existing call with struct tests are now passed directly
>>> in registers.
>>> ---
>>> tests/cl/program/execute/calls-large-struct.cl | 156 
>>> +
>>> tests/cl/program/execute/calls-struct.cl   |  50 
>>> 2 files changed, 181 insertions(+), 25 deletions(-)
>>> create mode 100644 tests/cl/program/execute/calls-large-struct.cl
>>> 
>>> diff --git a/tests/cl/program/execute/calls-large-struct.cl 
>>> b/tests/cl/program/execute/calls-large-struct.cl
>>> new file mode 100644
>>> index 0..46d84760d
>>> --- /dev/null
>>> +++ b/tests/cl/program/execute/calls-large-struct.cl
>>> @@ -0,0 +1,156 @@
>>> +/*!
>>> +
>>> +[config]
>>> +name: calls with large structs
>>> +clc_version_min: 10
>>> +
>>> +[test]
>>> +name: byval struct
>>> +kernel_name: call_i32_func_byval_Char_IntArray
>>> +dimensions: 1
>>> +global_size: 16 0 0
>>> +
>>> +arg_out: 0 buffer int[16]\
>>> + 1021 1022 1023 1024 1025 1026 1027 1028 \
>>> + 1029 1030 1031 1032 1033 1034 1035 1036
>>> +
>>> +arg_out: 1 buffer int[16] \
>>> +  14   14   14   14 \
>>> +  14   14   14   14 \
>>> +  14   14   14   14 \
>>> +  14   14   14   14 \
>>> +
>>> +arg_in: 2 buffer int[16] \
>>> + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
>>> +
>>> +
>>> +[test]
>>> +name: sret struct
>>> +kernel_name: call_sret_Char_IntArray_func
>>> +dimensions: 1
>>> +global_size: 16 0 0
>>> +
>>> +arg_out: 0 buffer int[16]\
>>> + 921 922 923 924 925 926 927 928 \
>>> + 929 930 931 932 933 934 935 936
>>> +
>>> +arg_in: 1 buffer int[16] \
>>> + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
>>> +
>>> +!*/
>>> +
>>> +#define NOINLINE __attribute__((noinline))
>>> +
>>> +typedef struct ByVal_Char_IntArray {
>>> +char c;
>>> +int i[32];
>>> +} ByVal_Char_IntArray;
>>> +
>>> +NOINLINE
>>> +int i32_func_byval_Char_IntArray(ByVal_Char_IntArray st)
>>> +{
>>> +st.i[0] += 100;
>>> +
>>> +int sum = 0;
>>> +for (int i = 0; i < 32; ++i)
>>> +{
>>> +sum += st.i[i];
>>> +}
>>> +
>>> +sum += st.c;
>>> +return sum;
>>> +}
>>> +
>>> +kernel void call_i32_func_byval_Char_IntArray(global int* out0,
>>> +  global int* out1,
>>> +  global int* input)
>>> +{
>>> +ByVal_Char_IntArray st;
>>> +st.c = 15;
>>> +
>>> +int id = get_global_id(0);
>>> +
>>> +int val = input[id];
>>> +
>>> +
>>> +st.i[0] = 14;
>>> +st.i[1] = -8;
>>> +st.i[2] = val;
>>> +st.i[3] = 900;
> 
> are these just some arbitrary numbers or do they have a specific
> meaning?

They’re arbitrary


> 
>>> +
>>> +for (int i = 4; i < 32; ++i)
>>> +{
>>> +st.i[i] = 0;
>>> +}
>>> +
>>> +volatile int stack_object[16];
>>> +for (int i = 0; i < 16; ++i)
>>> +{
>>> +const int test_val = 0x07080900 | i;
> same here

Just arbitrary values to test against



>>> +stack_object[i] = test_val;
>>> +}
>>> +
>>> +int result = i32_func_byval_Char_IntArray(st);
>>> +
>>> +// Check for stack corruption
>>> +for (int i = 0; i < 16; ++i)
>>> +{
>>> +const int test_val = 0x07080900 | i;
>>> +if (stack_object[i] != test_val)
>>> +result = -1;
>>> +}
>>> +
>>> +out0[id] = result;
>>> +out1[id] = st.i[0];
>>> +}
>>> +
>>> +NOINLINE
>>> +ByVal_Char_IntArray sret_Char_IntArray_func(global int* input, int id)
> 
> why is it called sret? is it "stack return"? why not spell it out, the
> test is using ridiculously long names anyway.

Because this will use the llvm sret attributed pointer argument to return the 
struct, rather than the direct value. sret is more specific than just returning 
a structure 

> 
>>> +{
>>> +ByVal_Char_IntArray st;
>>> +st.c = 15;
>>> +
>>> +int val = input[id];
>>> +st.i[0] = 14;
>>> +st.i[1] = -8;
>>> +st.i[2] = val;
>>> +st.i[3] = 900;
>>> +
>>> +for (int i = 4; i < 32; ++i)
>>> +{
>>> +st.i[i] = 0;
> 
> Can you use other iteration variable than "i", using the same name as
> struct members is confusing.
> 
>>> +}
>>> +
>>> +return st;
>>> +}
>>> +
>>> +kernel void call_sret_Char_IntArray_func(global int* output, global int* 
>>> input)
>>> +{
>>> +volatile int stack_object[16];
>>> +for (int i = 0; i < 16; ++i)
>>> +{
>>> +const int test_val = 0x04030200 | i;
>>> +stack_object[i] = test_val;
>>> +}
>>> +
>>> +int id = get_global_id(0);
>>> +ByVal_Char_IntArray st = sret_Char_IntArray_func(input, id);
>>> +
>>> +int sum = 0;
>>> +for (int i = 0; i < 32; ++i)
>>> +{
>>> +sum += st.i[i];
>>> +}
>>> +
>>> +sum += st.c;
>>> +

[Piglit] [PATCH] cl: Add test for call stack realignment

2018-08-13 Thread Matt Arsenault
v2: Use uintptr_t

v3: Formatting
---
 tests/cl/program/execute/realign-stack.cl | 93 +++
 1 file changed, 93 insertions(+)
 create mode 100644 tests/cl/program/execute/realign-stack.cl

diff --git a/tests/cl/program/execute/realign-stack.cl 
b/tests/cl/program/execute/realign-stack.cl
new file mode 100644
index 0..ca83284fe
--- /dev/null
+++ b/tests/cl/program/execute/realign-stack.cl
@@ -0,0 +1,93 @@
+/*!
+
+[config]
+name: call with stack realignment
+
+[test]
+name: call stack realignment 16
+kernel_name: kernel_call_stack_realign16_func
+dimensions: 1
+global_size: 1 0 0
+
+arg_out: 0 buffer int[1] 1
+
+
+[test]
+name: call stack realignment 32
+kernel_name: kernel_call_stack_realign32_func
+dimensions: 1
+global_size: 1 0 0
+
+arg_out: 0 buffer int[1] 1
+
+[test]
+name: call stack realignment 64
+kernel_name: kernel_call_stack_realign64_func
+dimensions: 1
+global_size: 1 0 0
+
+arg_out: 0 buffer int[1] 1
+
+[test]
+name: call stack realignment 128
+kernel_name: kernel_call_stack_realign128_func
+dimensions: 1
+global_size: 1 0 0
+
+arg_out: 0 buffer int[1] 1
+
+
+!*/
+
+// Make sure the absolute private address of stack objects in callee
+// functions is properly aligned.
+
+#define NOINLINE __attribute__((noinline))
+
+NOINLINE
+int test_stack_object_alignment16() {
+volatile int4 requires_align16 = 0;
+volatile uintptr_t addr = (uint)_align16;
+return (addr & 15) == 0;
+}
+
+NOINLINE
+int test_stack_object_alignment32() {
+volatile int8 requires_align32 = 0;
+volatile uintptr_t addr = (uint)_align32;
+return (addr & 31) == 0;
+}
+
+NOINLINE
+int test_stack_object_alignment64() {
+volatile int16 requires_align64 = 0;
+volatile uintptr_t addr = (uint)_align64;
+return (addr & 63) == 0;
+}
+
+NOINLINE
+int test_stack_object_alignment128() {
+volatile long16 requires_align128 = 0;
+volatile uintptr_t addr = (uint)_align128;
+return (addr & 127) == 0;
+}
+
+kernel void kernel_call_stack_realign16_func(global int* out) {
+volatile int misalign_stack = 0;
+*out = test_stack_object_alignment16();
+}
+
+kernel void kernel_call_stack_realign32_func(global int* out) {
+volatile int misalign_stack = 0;
+*out = test_stack_object_alignment32();
+}
+
+kernel void kernel_call_stack_realign64_func(global int* out) {
+volatile int misalign_stack = 0;
+*out = test_stack_object_alignment64();
+}
+
+kernel void kernel_call_stack_realign128_func(global int* out) {
+volatile int misalign_stack = 0;
+*out = test_stack_object_alignment128();
+}
-- 
2.17.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] cl: Add test for CSR VGPRs caused by SGPR spilling

2018-08-13 Thread Matt Arsenault


> On May 8, 2018, at 18:45, Jan Vesely  wrote:
> 
> On Tue, 2018-05-08 at 13:28 +0300, Matt Arsenault wrote:
>>> On Apr 8, 2018, at 19:56, Jan Vesely  wrote:
>>> 
>>> On Fri, 2018-04-06 at 00:49 -0400, Matt Arsenault wrote:
 ping
>>> 
>>> I'll need to setup the rocm stack to test this. It will take some time.
>>> It should work with clover as well (modulo bugs; asm parser, function
>>> calls, ...), right?
>>> 
>>> Jan
>> 
>> I thought calls were broken in general with clover because of the
>> missing link step? Besides that it should work
> 
> Linking works (both linking with libclc and cl-1.2 clLinkProgram) it
> just happens at IR level (if you consider that linking) so all function
> calls can be inlined.
> 
> The problem is that llvm backend generates relocation for function
> calls. This relocation is not handled by clover (you could call this
> 'calls are broken in general').
> 
> I see two ways to fix this;
> a) fix llvm to use fixup instead of relocation for internal function
> calls.
> b) fix clover to handle the function call relocation.
> 
> I tried a) but a simple
> "|| (GV->getLinkage() == GlobalValue::InternalLinkage)"
> in shouldEmitFixup() is not enough (the fixup value looks wrong)
> 
> I still think that a) is preferable, but now that 6.0 is out with the
> breakage we'll need to implement b) anyway.
> 
> I'll try to find some time to dig a bit more into this, but it's tricky
> since wrong jump leaves the GPU in unrecoverable state that needs
> manual power cycling on reboot.
> 
> Jan
>> 
>> -Matt


ping. Should this just skip the clover platform for now?
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] ext_render_snorm-render: test for GL_EXT_render_snorm

2018-08-13 Thread Nanley Chery
On Mon, Aug 13, 2018 at 02:59:39PM +0300, Tapani Pälli wrote:
> 
> 
> On 08/13/2018 01:31 PM, Tapani Pälli wrote:
> > 
> > 
> > On 08/11/2018 01:12 AM, Nanley Chery wrote:
> > > On Thu, Aug 02, 2018 at 02:06:26PM +0300, Tapani Pälli wrote:
> > > > Test includes:
> > > >     - texture uploads
> > > >     - mipmap generation
> > > >     - framebuffer creation
> > > >     - rendering to
> > > >     - reading from
> > > >     - interaction with GL_EXT_copy_image
> > > 
> > > I don't see any interaction with this extension..
> > 
> > Oops yes, this is leftover (as this test was copy-paste from
> > ext_texture_norm16 test), will remove this.
> > 
> > 
> > > > 
> > > > This test includes only GL_BYTE based formats. R16_SNORM, RG16_SNORM
> > > > and RGBA16_SNORM are tested in GL_EXT_texture_norm16 tests.
> > > > 
> > > > Signed-off-by: Tapani Pälli 
> > > > ---
> > > >   tests/opengl.py  |   5 +
> > > >   tests/spec/CMakeLists.txt    |   1 +
> > > >   tests/spec/ext_render_snorm/CMakeLists.gles2.txt |   7 +
> > > >   tests/spec/ext_render_snorm/CMakeLists.txt   |   1 +
> > > >   tests/spec/ext_render_snorm/render.c | 335
> > > > +++
> > > >   5 files changed, 349 insertions(+)
> > > >   create mode 100644 tests/spec/ext_render_snorm/CMakeLists.gles2.txt
> > > >   create mode 100644 tests/spec/ext_render_snorm/CMakeLists.txt
> > > >   create mode 100644 tests/spec/ext_render_snorm/render.c
> > > > 
> > > > diff --git a/tests/opengl.py b/tests/opengl.py
> > > > index 397676e65..6a8c513b4 100644
> > > > --- a/tests/opengl.py
> > > > +++ b/tests/opengl.py
> > > > @@ -3070,6 +3070,11 @@ with profile.test_list.group_manager(
> > > >   grouptools.join('spec', 'ext_texture_norm16')) as g:
> > > >   g(['ext_texture_norm16-render'], 'render')
> > > > +with profile.test_list.group_manager(
> > > > +    PiglitGLTest,
> > > > +    grouptools.join('spec', 'ext_render_snorm')) as g:
> > > > +    g(['ext_render_snorm-render'], 'render')
> > > > +
> > > >   with profile.test_list.group_manager(
> > > >   PiglitGLTest,
> > > >   grouptools.join('spec', 'ext_frag_depth')) as g:
> > > > diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
> > > > index 6cf3f76ed..0a2d4bb25 100644
> > > > --- a/tests/spec/CMakeLists.txt
> > > > +++ b/tests/spec/CMakeLists.txt
> > > > @@ -181,3 +181,4 @@ add_subdirectory (ext_occlusion_query_boolean)
> > > >   add_subdirectory (ext_disjoint_timer_query)
> > > >   add_subdirectory (intel_blackhole_render)
> > > >   add_subdirectory (ext_texture_norm16)
> > > > +add_subdirectory (ext_render_snorm)
> > > > diff --git a/tests/spec/ext_render_snorm/CMakeLists.gles2.txt
> > > > b/tests/spec/ext_render_snorm/CMakeLists.gles2.txt
> > > > new file mode 100644
> > > > index 0..4b90257cc
> > > > --- /dev/null
> > > > +++ b/tests/spec/ext_render_snorm/CMakeLists.gles2.txt
> > > > @@ -0,0 +1,7 @@
> > > > +link_libraries (
> > > > +    piglitutil_${piglit_target_api}
> > > > +)
> > > > +
> > > > +piglit_add_executable (ext_render_snorm-render render.c)
> > > > +
> > > > +# vim: ft=cmake:
> > > > diff --git a/tests/spec/ext_render_snorm/CMakeLists.txt
> > > > b/tests/spec/ext_render_snorm/CMakeLists.txt
> > > > new file mode 100644
> > > > index 0..144a306f4
> > > > --- /dev/null
> > > > +++ b/tests/spec/ext_render_snorm/CMakeLists.txt
> > > > @@ -0,0 +1 @@
> > > > +piglit_include_target_api()
> > > > diff --git a/tests/spec/ext_render_snorm/render.c
> > > > b/tests/spec/ext_render_snorm/render.c
> > > > new file mode 100644
> > > > index 0..241812e12
> > > > --- /dev/null
> > > > +++ b/tests/spec/ext_render_snorm/render.c
> > > > @@ -0,0 +1,335 @@
> > > > +/*
> > > > + * Copyright © 2018 Intel Corporation
> > > > + *
> > > > + * Permission is hereby granted, free of charge, to any person
> > > > obtaining a
> > > > + * copy of this software and associated documentation files
> > > > (the "Software"),
> > > > + * to deal in the Software without restriction, including
> > > > without limitation
> > > > + * the rights to use, copy, modify, merge, publish, distribute,
> > > > sublicense,
> > > > + * and/or sell copies of the Software, and to permit persons to
> > > > whom the
> > > > + * Software is furnished to do so, subject to the following conditions:
> > > > + *
> > > > + * The above copyright notice and this permission notice
> > > > (including the next
> > > > + * paragraph) shall be included in all copies or substantial
> > > > portions of the
> > > > + * Software.
> > > > + *
> > > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
> > > > KIND, EXPRESS OR
> > > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> > > > MERCHANTABILITY,
> > > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO
> > > > EVENT SHALL
> > > > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
> > > > DAMAGES OR OTHER
> > > 

Re: [Piglit] [PATCH] ext_render_snorm-render: test for GL_EXT_render_snorm

2018-08-13 Thread Tapani Pälli



On 08/13/2018 01:31 PM, Tapani Pälli wrote:



On 08/11/2018 01:12 AM, Nanley Chery wrote:

On Thu, Aug 02, 2018 at 02:06:26PM +0300, Tapani Pälli wrote:

Test includes:
    - texture uploads
    - mipmap generation
    - framebuffer creation
    - rendering to
    - reading from
    - interaction with GL_EXT_copy_image


I don't see any interaction with this extension..


Oops yes, this is leftover (as this test was copy-paste from 
ext_texture_norm16 test), will remove this.





This test includes only GL_BYTE based formats. R16_SNORM, RG16_SNORM
and RGBA16_SNORM are tested in GL_EXT_texture_norm16 tests.

Signed-off-by: Tapani Pälli 
---
  tests/opengl.py  |   5 +
  tests/spec/CMakeLists.txt    |   1 +
  tests/spec/ext_render_snorm/CMakeLists.gles2.txt |   7 +
  tests/spec/ext_render_snorm/CMakeLists.txt   |   1 +
  tests/spec/ext_render_snorm/render.c | 335 
+++

  5 files changed, 349 insertions(+)
  create mode 100644 tests/spec/ext_render_snorm/CMakeLists.gles2.txt
  create mode 100644 tests/spec/ext_render_snorm/CMakeLists.txt
  create mode 100644 tests/spec/ext_render_snorm/render.c

diff --git a/tests/opengl.py b/tests/opengl.py
index 397676e65..6a8c513b4 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3070,6 +3070,11 @@ with profile.test_list.group_manager(
  grouptools.join('spec', 'ext_texture_norm16')) as g:
  g(['ext_texture_norm16-render'], 'render')
+with profile.test_list.group_manager(
+    PiglitGLTest,
+    grouptools.join('spec', 'ext_render_snorm')) as g:
+    g(['ext_render_snorm-render'], 'render')
+
  with profile.test_list.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'ext_frag_depth')) as g:
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 6cf3f76ed..0a2d4bb25 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -181,3 +181,4 @@ add_subdirectory (ext_occlusion_query_boolean)
  add_subdirectory (ext_disjoint_timer_query)
  add_subdirectory (intel_blackhole_render)
  add_subdirectory (ext_texture_norm16)
+add_subdirectory (ext_render_snorm)
diff --git a/tests/spec/ext_render_snorm/CMakeLists.gles2.txt 
b/tests/spec/ext_render_snorm/CMakeLists.gles2.txt

new file mode 100644
index 0..4b90257cc
--- /dev/null
+++ b/tests/spec/ext_render_snorm/CMakeLists.gles2.txt
@@ -0,0 +1,7 @@
+link_libraries (
+    piglitutil_${piglit_target_api}
+)
+
+piglit_add_executable (ext_render_snorm-render render.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/ext_render_snorm/CMakeLists.txt 
b/tests/spec/ext_render_snorm/CMakeLists.txt

new file mode 100644
index 0..144a306f4
--- /dev/null
+++ b/tests/spec/ext_render_snorm/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/ext_render_snorm/render.c 
b/tests/spec/ext_render_snorm/render.c

new file mode 100644
index 0..241812e12
--- /dev/null
+++ b/tests/spec/ext_render_snorm/render.c
@@ -0,0 +1,335 @@
+/*
+ * Copyright © 2018 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person 
obtaining a
+ * copy of this software and associated documentation files (the 
"Software"),
+ * to deal in the Software without restriction, including without 
limitation
+ * the rights to use, copy, modify, merge, publish, distribute, 
sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom 
the

+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including 
the next
+ * paragraph) shall be included in all copies or substantial 
portions of the

+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO 
EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES 
OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
OTHER DEALINGS

+ * IN THE SOFTWARE.
+ */
+
+/**
+ * @file
+ * Basic tests for formats added by GL_EXT_render_snorm extension
+ *
+ * 
https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_render_snorm.txt 


+ *
+ * Test includes:
+ * - texture uploads
+ * - mipmap generation
+ * - framebuffer creation
+ * - rendering to
+ * - reading from
+ *    - interaction with GL_EXT_copy_image


Same as above.


To be removed.


+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+    config.supports_gl_es_version = 31;
+    config.window_visual = PIGLIT_GL_VISUAL_RGBA;
+PIGLIT_GL_TEST_CONFIG_END
+
+#define PIGLIT_RESULT(x) x ? PIGLIT_PASS : PIGLIT_FAIL
+
+static const char vs_source[] =
+    "#version 310 es\n"
+    "layout(location = 0) in highp vec4 

Re: [Piglit] [PATCH] ext_render_snorm-render: test for GL_EXT_render_snorm

2018-08-13 Thread Tapani Pälli



On 08/11/2018 01:12 AM, Nanley Chery wrote:

On Thu, Aug 02, 2018 at 02:06:26PM +0300, Tapani Pälli wrote:

Test includes:
- texture uploads
- mipmap generation
- framebuffer creation
- rendering to
- reading from
- interaction with GL_EXT_copy_image


I don't see any interaction with this extension..


Oops yes, this is leftover (as this test was copy-paste from 
ext_texture_norm16 test), will remove this.





This test includes only GL_BYTE based formats. R16_SNORM, RG16_SNORM
and RGBA16_SNORM are tested in GL_EXT_texture_norm16 tests.

Signed-off-by: Tapani Pälli 
---
  tests/opengl.py  |   5 +
  tests/spec/CMakeLists.txt|   1 +
  tests/spec/ext_render_snorm/CMakeLists.gles2.txt |   7 +
  tests/spec/ext_render_snorm/CMakeLists.txt   |   1 +
  tests/spec/ext_render_snorm/render.c | 335 +++
  5 files changed, 349 insertions(+)
  create mode 100644 tests/spec/ext_render_snorm/CMakeLists.gles2.txt
  create mode 100644 tests/spec/ext_render_snorm/CMakeLists.txt
  create mode 100644 tests/spec/ext_render_snorm/render.c

diff --git a/tests/opengl.py b/tests/opengl.py
index 397676e65..6a8c513b4 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3070,6 +3070,11 @@ with profile.test_list.group_manager(
  grouptools.join('spec', 'ext_texture_norm16')) as g:
  g(['ext_texture_norm16-render'], 'render')
  
+with profile.test_list.group_manager(

+PiglitGLTest,
+grouptools.join('spec', 'ext_render_snorm')) as g:
+g(['ext_render_snorm-render'], 'render')
+
  with profile.test_list.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'ext_frag_depth')) as g:
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 6cf3f76ed..0a2d4bb25 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -181,3 +181,4 @@ add_subdirectory (ext_occlusion_query_boolean)
  add_subdirectory (ext_disjoint_timer_query)
  add_subdirectory (intel_blackhole_render)
  add_subdirectory (ext_texture_norm16)
+add_subdirectory (ext_render_snorm)
diff --git a/tests/spec/ext_render_snorm/CMakeLists.gles2.txt 
b/tests/spec/ext_render_snorm/CMakeLists.gles2.txt
new file mode 100644
index 0..4b90257cc
--- /dev/null
+++ b/tests/spec/ext_render_snorm/CMakeLists.gles2.txt
@@ -0,0 +1,7 @@
+link_libraries (
+   piglitutil_${piglit_target_api}
+)
+
+piglit_add_executable (ext_render_snorm-render render.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/ext_render_snorm/CMakeLists.txt 
b/tests/spec/ext_render_snorm/CMakeLists.txt
new file mode 100644
index 0..144a306f4
--- /dev/null
+++ b/tests/spec/ext_render_snorm/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/ext_render_snorm/render.c 
b/tests/spec/ext_render_snorm/render.c
new file mode 100644
index 0..241812e12
--- /dev/null
+++ b/tests/spec/ext_render_snorm/render.c
@@ -0,0 +1,335 @@
+/*
+ * Copyright © 2018 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * @file
+ * Basic tests for formats added by GL_EXT_render_snorm extension
+ *
+ * https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_render_snorm.txt
+ *
+ * Test includes:
+ * - texture uploads
+ * - mipmap generation
+ * - framebuffer creation
+ * - rendering to
+ * - reading from
+ * - interaction with GL_EXT_copy_image


Same as above.


To be removed.


+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_es_version = 31;
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA;
+PIGLIT_GL_TEST_CONFIG_END
+
+#define PIGLIT_RESULT(x) x ? PIGLIT_PASS : PIGLIT_FAIL
+
+static const char vs_source[] =
+   "#version 310 es\n"
+   "layout(location = 0) in highp vec4 vertex;\n"
+   "layout(location = 1) in highp vec4 

Re: [Piglit] [PATCH] shaders: add a glslparsertest for bug 98699

2018-08-13 Thread Tapani Pälli



On 08/13/2018 06:15 AM, Timothy Arceri wrote:

On 11/08/18 02:32, Dylan Baker wrote:
I thought we'd stopped adding tests with "bugX" in the name and 
tried to

give the test a descriptive name and we were trying not to add more
tests to tests/shaders, but put them in tests/spec/. So maybe rename
it to something like:
tests/spec/glsl-1.10/compiler/post-increment-in-array-size.shader_test


Yes I agree with Dylan on all points. With the move/rename this is:

Reviewed-by: Timothy Arceri 


I'm fine with move and rename, Thanks guys!




Or whatever you think is better (I'm just reading the bug and trying 
to come up

with something).

Otherwise this test looks good, so with the rename:
Reviewed-by: Dylan Baker 

Quoting Tapani Pälli (2018-08-09 23:12:44)

Signed-off-by: Tapani Pälli 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98699
---
  tests/shaders/glsl-compiler-bug98699.vert | 9 +
  1 file changed, 9 insertions(+)
  create mode 100644 tests/shaders/glsl-compiler-bug98699.vert

diff --git a/tests/shaders/glsl-compiler-bug98699.vert 
b/tests/shaders/glsl-compiler-bug98699.vert

new file mode 100644
index 0..9bd219cf0
--- /dev/null
+++ b/tests/shaders/glsl-compiler-bug98699.vert
@@ -0,0 +1,9 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.10
+// [end config]
+
+void main()
+{
+    float[a+++4 ? 1:1] f;
+}
--
2.14.4

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit