2 * Copyright © 2020 Valve Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 #include "test_isel-spirv.h"
29 BEGIN_TEST(isel
.interp
.simple
)
30 QoShaderModuleCreateInfo vs
= qoShaderModuleCreateInfoGLSL(VERTEX
,
31 layout(location
= 0) in vec4 in_color
;
32 layout(location
= 0) out vec4 out_color
;
37 QoShaderModuleCreateInfo fs
= qoShaderModuleCreateInfoGLSL(FRAGMENT
,
38 layout(location
= 0) in vec4 in_color
;
39 layout(location
= 0) out vec4 out_color
;
41 //>> v1: %a_tmp = v_interp_p1_f32 %bx, %pm:m0 attr0.w
42 //! v1: %a = v_interp_p2_f32 %by, %pm:m0, %a_tmp attr0.w
43 //! v1: %b_tmp = v_interp_p1_f32 %bx, %pm:m0 attr0.z
44 //! v1: %b = v_interp_p2_f32 %by, %pm:m0, %b_tmp attr0.z
45 //! v1: %g_tmp = v_interp_p1_f32 %bx, %pm:m0 attr0.y
46 //! v1: %g = v_interp_p2_f32 %by, %pm:m0, %g_tmp attr0.y
47 //! v1: %r_tmp = v_interp_p1_f32 %bx, %pm:m0 attr0.x
48 //! v1: %r = v_interp_p2_f32 %by, %pm:m0, %r_tmp attr0.x
49 //! exp %r, %g, %b, %a mrt0
54 PipelineBuilder
bld(get_vk_device(GFX9
));
56 bld
.print_ir(VK_SHADER_STAGE_FRAGMENT_BIT
, "ACO IR");
59 BEGIN_TEST(isel
.compute
.simple
)
60 for (unsigned i
= GFX7
; i
<= GFX8
; i
++) {
61 if (!set_variant((chip_class
)i
))
64 QoShaderModuleCreateInfo cs
= qoShaderModuleCreateInfoGLSL(COMPUTE
,
65 layout(local_size_x
=1) in
;
66 layout(binding
=0) buffer Buf
{
70 //~gfx7>> v1: %data = v_mov_b32 42
71 //~gfx7>> buffer_store_dword %_, v1: undef, 0, %data disable_wqm storage:buffer semantics: scope:invocation
72 //~gfx8>> s1: %data = s_mov_b32 42
73 //~gfx8>> s_buffer_store_dword %_, 0, %data storage:buffer semantics: scope:invocation
78 PipelineBuilder
bld(get_vk_device((chip_class
)i
));
80 bld
.print_ir(VK_SHADER_STAGE_COMPUTE_BIT
, "ACO IR", true);