yes
This commit is contained in:
+94
@@ -0,0 +1,94 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[65536];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[65535] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 65536 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint16 DATA
|
||||
0 1 1 65535 65535 2 2 0
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint16 DATA
|
||||
0 1 1 3 3 2 2 0
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS LINE_LIST INDEXED START_IDX 0 COUNT 8
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS LINE_LIST INDEXED START_IDX 0 COUNT 8
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE IndexTypeUint8Features.indexTypeUint8
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[256];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[255] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 256 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint8 DATA
|
||||
0 1 1 255 255 2 2 0
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint8 DATA
|
||||
0 1 1 3 3 2 2 0
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS LINE_LIST INDEXED START_IDX 0 COUNT 8
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS LINE_LIST INDEXED START_IDX 0 COUNT 8
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
DEVICE_FEATURE geometryShader
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[65536];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[65535] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER geometry geom_shader GLSL
|
||||
#version 430
|
||||
layout(lines_adjacency) in;
|
||||
layout(line_strip, max_vertices = 2) out;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
for (int i = 1; i < 3; i++)
|
||||
{
|
||||
gl_Position = gl_in[i].gl_Position;
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 65536 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint16 DATA
|
||||
65535 0 1 65535 65535 1 65535 65535 65535 65535 2 65535 65535 2 0 65535
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint16 DATA
|
||||
3 0 1 3 3 1 3 3 3 3 2 3 3 2 0 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH geom_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS LINE_LIST_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 16
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS LINE_LIST_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 16
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE IndexTypeUint8Features.indexTypeUint8
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
DEVICE_FEATURE geometryShader
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[256];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[255] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER geometry geom_shader GLSL
|
||||
#version 430
|
||||
layout(lines_adjacency) in;
|
||||
layout(line_strip, max_vertices = 2) out;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
for (int i = 1; i < 3; i++)
|
||||
{
|
||||
gl_Position = gl_in[i].gl_Position;
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 256 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint8 DATA
|
||||
255 0 1 255 255 1 255 255 255 255 2 255 255 2 0 255
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint8 DATA
|
||||
3 0 1 3 3 1 3 3 3 3 2 3 3 2 0 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH geom_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS LINE_LIST_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 16
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS LINE_LIST_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 16
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[65536];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[65535] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 65536 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint16 DATA
|
||||
0 1 65535 2 0
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint16 DATA
|
||||
0 1 3 2 0
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS LINE_STRIP INDEXED START_IDX 0 COUNT 5
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS LINE_STRIP INDEXED START_IDX 0 COUNT 5
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE IndexTypeUint8Features.indexTypeUint8
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[256];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[255] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 256 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint8 DATA
|
||||
0 1 255 2 0
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint8 DATA
|
||||
0 1 3 2 0
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS LINE_STRIP INDEXED START_IDX 0 COUNT 5
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS LINE_STRIP INDEXED START_IDX 0 COUNT 5
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE geometryShader
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[65536];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[65535] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER geometry geom_shader GLSL
|
||||
#version 430
|
||||
layout(lines_adjacency) in;
|
||||
layout(line_strip, max_vertices = 2) out;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
for (int i = 1; i < 3; i++)
|
||||
{
|
||||
gl_Position = gl_in[i].gl_Position;
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 65536 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint16 DATA
|
||||
65535 0 1 65535 2 0 65535
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint16 DATA
|
||||
3 0 1 3 2 0 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH geom_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS LINE_STRIP_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 7
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS LINE_STRIP_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 7
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE IndexTypeUint8Features.indexTypeUint8
|
||||
|
||||
DEVICE_FEATURE geometryShader
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[256];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[255] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER geometry geom_shader GLSL
|
||||
#version 430
|
||||
layout(lines_adjacency) in;
|
||||
layout(line_strip, max_vertices = 2) out;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
for (int i = 1; i < 3; i++)
|
||||
{
|
||||
gl_Position = gl_in[i].gl_Position;
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 256 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint8 DATA
|
||||
255 0 1 255 2 0 255
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint8 DATA
|
||||
3 0 1 3 2 0 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH geom_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS LINE_STRIP_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 7
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS LINE_STRIP_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 7
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+132
@@ -0,0 +1,132 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
DEVICE_FEATURE tessellationShader
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[65536];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[65535] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER tessellation_control tcs_shader GLSL
|
||||
#version 430
|
||||
layout(vertices = 4) out;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
if (gl_InvocationID == 0)
|
||||
{
|
||||
gl_TessLevelInner[0] = 2.0f;
|
||||
gl_TessLevelInner[1] = 2.0f;
|
||||
gl_TessLevelOuter[0] = 2.0f;
|
||||
gl_TessLevelOuter[1] = 2.0f;
|
||||
gl_TessLevelOuter[2] = 2.0f;
|
||||
gl_TessLevelOuter[3] = 2.0f;
|
||||
}
|
||||
gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
|
||||
}
|
||||
END
|
||||
|
||||
SHADER tessellation_evaluation tes_shader GLSL
|
||||
#version 430
|
||||
layout(quads, equal_spacing, ccw) in;
|
||||
void main (void)
|
||||
{
|
||||
const float u = gl_TessCoord.x;
|
||||
const float v = gl_TessCoord.y;
|
||||
gl_Position = (1 - u) * (1 - v) * gl_in[0].gl_Position + (1 - u) * v * gl_in[1].gl_Position + u * (1 - v) * gl_in[2].gl_Position + u * v * gl_in[3].gl_Position;
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 65536 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint16 DATA
|
||||
0 1 65535 2
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint16 DATA
|
||||
0 1 3 2
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH tcs_shader
|
||||
ATTACH tes_shader
|
||||
PATCH_CONTROL_POINTS 4
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH tcs_shader
|
||||
ATTACH tes_shader
|
||||
PATCH_CONTROL_POINTS 4
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS PATCH_LIST INDEXED START_IDX 0 COUNT 4
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS PATCH_LIST INDEXED START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE IndexTypeUint8Features.indexTypeUint8
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
DEVICE_FEATURE tessellationShader
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[256];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[255] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER tessellation_control tcs_shader GLSL
|
||||
#version 430
|
||||
layout(vertices = 4) out;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
if (gl_InvocationID == 0)
|
||||
{
|
||||
gl_TessLevelInner[0] = 2.0f;
|
||||
gl_TessLevelInner[1] = 2.0f;
|
||||
gl_TessLevelOuter[0] = 2.0f;
|
||||
gl_TessLevelOuter[1] = 2.0f;
|
||||
gl_TessLevelOuter[2] = 2.0f;
|
||||
gl_TessLevelOuter[3] = 2.0f;
|
||||
}
|
||||
gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
|
||||
}
|
||||
END
|
||||
|
||||
SHADER tessellation_evaluation tes_shader GLSL
|
||||
#version 430
|
||||
layout(quads, equal_spacing, ccw) in;
|
||||
void main (void)
|
||||
{
|
||||
const float u = gl_TessCoord.x;
|
||||
const float v = gl_TessCoord.y;
|
||||
gl_Position = (1 - u) * (1 - v) * gl_in[0].gl_Position + (1 - u) * v * gl_in[1].gl_Position + u * (1 - v) * gl_in[2].gl_Position + u * v * gl_in[3].gl_Position;
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 256 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint8 DATA
|
||||
0 1 255 2
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint8 DATA
|
||||
0 1 3 2
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH tcs_shader
|
||||
|
||||
ATTACH tes_shader
|
||||
|
||||
PATCH_CONTROL_POINTS 4
|
||||
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH tcs_shader
|
||||
ATTACH tes_shader
|
||||
PATCH_CONTROL_POINTS 4
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS PATCH_LIST INDEXED START_IDX 0 COUNT 4
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS PATCH_LIST INDEXED START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[65536];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[65535] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) in vec4 position;
|
||||
void main()
|
||||
{
|
||||
gl_Position = position;
|
||||
gl_PointSize = 1.0;
|
||||
}
|
||||
END
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 65536 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint16 DATA
|
||||
0 1 2 65535
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint16 DATA
|
||||
0 1 2 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS POINT_LIST INDEXED START_IDX 0 COUNT 4
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS POINT_LIST INDEXED START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE IndexTypeUint8Features.indexTypeUint8
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[256];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[255] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) in vec4 position;
|
||||
void main()
|
||||
{
|
||||
gl_Position = position;
|
||||
gl_PointSize = 1.0;
|
||||
}
|
||||
END
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 256 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint8 DATA
|
||||
0 1 2 255
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint8 DATA
|
||||
0 1 2 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS POINT_LIST INDEXED START_IDX 0 COUNT 4
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS POINT_LIST INDEXED START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[65536];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[65535] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 65536 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint16 DATA
|
||||
0 1 2 65535
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint16 DATA
|
||||
0 1 2 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS TRIANGLE_FAN INDEXED START_IDX 0 COUNT 4
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS TRIANGLE_FAN INDEXED START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE IndexTypeUint8Features.indexTypeUint8
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[256];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[255] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 256 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint8 DATA
|
||||
0 1 2 255
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint8 DATA
|
||||
0 1 2 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS TRIANGLE_FAN INDEXED START_IDX 0 COUNT 4
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS TRIANGLE_FAN INDEXED START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[65536];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[65535] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 65536 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint16 DATA
|
||||
0 1 2 0 2 65535
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint16 DATA
|
||||
0 1 2 0 2 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS TRIANGLE_LIST INDEXED START_IDX 0 COUNT 6
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS TRIANGLE_LIST INDEXED START_IDX 0 COUNT 6
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE IndexTypeUint8Features.indexTypeUint8
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[256];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[255] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 256 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint8 DATA
|
||||
0 1 2 0 2 255
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint8 DATA
|
||||
0 1 2 0 2 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS TRIANGLE_LIST INDEXED START_IDX 0 COUNT 6
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS TRIANGLE_LIST INDEXED START_IDX 0 COUNT 6
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
DEVICE_FEATURE geometryShader
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[65536];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[65535] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER geometry geom_shader GLSL
|
||||
#version 430
|
||||
layout(triangles_adjacency) in;
|
||||
layout(triangle_strip, max_vertices = 3) out;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
for (int i = 0; i < 6; i += 2)
|
||||
{
|
||||
gl_Position = gl_in[i].gl_Position;
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 65536 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint16 DATA
|
||||
0 65535 1 65535 2 65535 0 65535 2 65535 65535 65535
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint16 DATA
|
||||
0 3 1 3 2 3 0 3 2 3 3 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH geom_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS TRIANGLE_LIST_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 12
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS TRIANGLE_LIST_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 12
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE IndexTypeUint8Features.indexTypeUint8
|
||||
DEVICE_EXTENSION VK_EXT_primitive_topology_list_restart
|
||||
|
||||
DEVICE_FEATURE geometryShader
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[256];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[255] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER geometry geom_shader GLSL
|
||||
#version 430
|
||||
layout(triangles_adjacency) in;
|
||||
layout(triangle_strip, max_vertices = 3) out;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
for (int i = 0; i < 6; i += 2)
|
||||
{
|
||||
gl_Position = gl_in[i].gl_Position;
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 256 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint8 DATA
|
||||
0 255 1 255 2 255 0 255 2 255 255 255
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint8 DATA
|
||||
0 3 1 3 2 3 0 3 2 3 3 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH geom_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS TRIANGLE_LIST_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 12
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS TRIANGLE_LIST_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 12
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[65536];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[65535] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 65536 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint16 DATA
|
||||
1 0 2 65535
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint16 DATA
|
||||
1 0 2 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS TRIANGLE_STRIP INDEXED START_IDX 0 COUNT 4
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS TRIANGLE_STRIP INDEXED START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE IndexTypeUint8Features.indexTypeUint8
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[256];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[255] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 256 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint8 DATA
|
||||
1 0 2 255
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint8 DATA
|
||||
1 0 2 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS TRIANGLE_STRIP INDEXED START_IDX 0 COUNT 4
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS TRIANGLE_STRIP INDEXED START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE geometryShader
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[65536];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[65535] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER geometry geom_shader GLSL
|
||||
#version 430
|
||||
layout(triangles_adjacency) in;
|
||||
layout(triangle_strip, max_vertices = 3) out;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
for (int i = 0; i < 6; i += 2)
|
||||
{
|
||||
gl_Position = gl_in[i].gl_Position;
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 65536 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint16 DATA
|
||||
1 65535 0 65535 2 65535 65535 65535
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint16 DATA
|
||||
1 3 0 3 2 3 3 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH geom_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS TRIANGLE_STRIP_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 8
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS TRIANGLE_STRIP_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 8
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE IndexTypeUint8Features.indexTypeUint8
|
||||
|
||||
DEVICE_FEATURE geometryShader
|
||||
|
||||
SHADER compute compute_shader GLSL
|
||||
#version 430
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer block0
|
||||
{
|
||||
vec4 pos[256];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
pos[0] = vec4(-0.5, -0.5, 0.0, 1.0);
|
||||
pos[1] = vec4(-0.5, 0.5, 0.0, 1.0);
|
||||
pos[2] = vec4(0.5, 0.5, 0.0, 1.0);
|
||||
pos[3] = pos[255] = vec4(0.5, -0.5, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER vertex vert_shader PASSTHROUGH
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 430
|
||||
layout(location = 0) out vec4 color_out;
|
||||
void main()
|
||||
{
|
||||
color_out = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER geometry geom_shader GLSL
|
||||
#version 430
|
||||
layout(triangles_adjacency) in;
|
||||
layout(triangle_strip, max_vertices = 3) out;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
for (int i = 0; i < 6; i += 2)
|
||||
{
|
||||
gl_Position = gl_in[i].gl_Position;
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> SIZE 256 FILL 0.0
|
||||
|
||||
BUFFER indices DATA_TYPE uint8 DATA
|
||||
1 255 0 255 2 255 255 255
|
||||
END
|
||||
|
||||
BUFFER indices_ref DATA_TYPE uint8 DATA
|
||||
1 3 0 3 2 3 3 3
|
||||
END
|
||||
|
||||
PIPELINE compute compute_pipeline
|
||||
ATTACH compute_shader
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
|
||||
BIND BUFFER position AS storage DESCRIPTOR_SET 0 BINDING 0
|
||||
END
|
||||
|
||||
RUN compute_pipeline 1 1 1
|
||||
|
||||
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
IMAGE framebuffer_ref FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
ATTACH geom_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
PIPELINE graphics graphics_pipeline_ref
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
INDEX_DATA indices_ref
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebuffer_ref AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 0 0 0 0
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS TRIANGLE_STRIP_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 8
|
||||
CLEAR_COLOR graphics_pipeline_ref 0 0 0 0
|
||||
CLEAR graphics_pipeline_ref
|
||||
RUN graphics_pipeline_ref DRAW_ARRAY AS TRIANGLE_STRIP_WITH_ADJACENCY INDEXED START_IDX 0 COUNT 8
|
||||
EXPECT framebuffer EQ_BUFFER framebuffer_ref
|
||||
@@ -0,0 +1,62 @@
|
||||
#!amber
|
||||
|
||||
DEVICE_FEATURE geometryShader
|
||||
|
||||
SHADER vertex vert GLSL
|
||||
#version 460
|
||||
layout (location=0) in vec4 inPos;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = inPos;
|
||||
}
|
||||
|
||||
END
|
||||
|
||||
SHADER fragment frag GLSL
|
||||
#version 460
|
||||
layout (location=0) out vec4 outColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (gl_Layer == 0)
|
||||
outColor = vec4(0.0,1.0,0.0,0.0);
|
||||
else
|
||||
outColor = vec4(1.0,0.0,0.0,0.0);
|
||||
}
|
||||
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> DATA
|
||||
-1 -1 0 1
|
||||
1 -1 0 1
|
||||
-1 0 0 1
|
||||
|
||||
-1 0 0 1
|
||||
1 -1 0 1
|
||||
1 0 0 1
|
||||
|
||||
-1 0 0 1
|
||||
1 0 0 1
|
||||
-1 1 0 1
|
||||
|
||||
-1 1 0 1
|
||||
1 0 0 1
|
||||
1 1 0 1
|
||||
|
||||
END
|
||||
|
||||
BUFFER framebuffer FORMAT R8G8B8A8_UNORM
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert
|
||||
ATTACH frag
|
||||
VERTEX_DATA position LOCATION 0
|
||||
FRAMEBUFFER_SIZE 1 1
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 255 255 255 255
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS TRIANGLE_LIST START_IDX 0 COUNT 12
|
||||
EXPECT framebuffer IDX 0 0 SIZE 1 1 EQ_RGBA 0 255 0 0
|
||||
@@ -0,0 +1,84 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE sampleRateShading
|
||||
|
||||
SHADER vertex vert_shader GLSL
|
||||
#version 440
|
||||
layout(location = 0) in vec4 inPosNDC;
|
||||
layout(location = 1) in vec2 inPosScreen;
|
||||
layout(location = 0) out vec2 outPosScreenArr[10];
|
||||
|
||||
void main (void)
|
||||
{
|
||||
gl_Position = inPosNDC;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
outPosScreenArr[i] = inPosScreen + vec2(i);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 440
|
||||
layout(location = 0) sample in vec2 inPosScreenArr[10];
|
||||
layout(location = 0) out vec4 fs_out_color;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
int index = int(gl_FragCoord.x) % 10;
|
||||
vec2 ref = interpolateAtCentroid(inPosScreenArr[0]) + vec2(index);
|
||||
|
||||
if (distance(ref, interpolateAtCentroid(inPosScreenArr[index])) < 0.01
|
||||
&& abs(ref.y - interpolateAtCentroid(inPosScreenArr[index].y)) < 0.01
|
||||
&& abs(ref.y - interpolateAtCentroid(inPosScreenArr[index])).y < 0.01)
|
||||
{
|
||||
fs_out_color = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
fs_out_color = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> DATA
|
||||
-1.0 -1.0 0.0 1.0
|
||||
1.0 -1.0 0.0 1.0
|
||||
1.0 1.0 0.0 1.0
|
||||
-1.0 1.0 0.0 1.0
|
||||
END
|
||||
|
||||
BUFFER position_screen DATA_TYPE vec2<float> DATA
|
||||
0.0 0.0
|
||||
64.0 0.0
|
||||
64.0 64.0
|
||||
0.0 64.0
|
||||
END
|
||||
|
||||
IMAGE framebufferMS FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64 SAMPLES 4
|
||||
IMAGE framebuffer FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
VERTEX_DATA position_screen LOCATION 1
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebufferMS AS color LOCATION 0
|
||||
BIND BUFFER framebuffer AS resolve
|
||||
END
|
||||
|
||||
RUN pipeline DRAW_ARRAY AS TRIANGLE_FAN START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
|
||||
@@ -0,0 +1,85 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE sampleRateShading
|
||||
|
||||
SHADER vertex vert_shader GLSL
|
||||
#version 440
|
||||
layout(location = 0) in vec4 inPosNDC;
|
||||
layout(location = 1) in vec2 inPosScreen;
|
||||
layout(location = 0) out vec2 outPosScreenArr[10];
|
||||
|
||||
void main (void)
|
||||
{
|
||||
gl_Position = inPosNDC;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
outPosScreenArr[i] = inPosScreen + vec2(i);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 440
|
||||
layout(location = 0) sample in vec2 inPosScreenArr[10];
|
||||
layout(location = 0) out vec4 fs_out_color;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec2 offset = vec2(0.75, -0.33);
|
||||
int index = int(gl_FragCoord.x) % 10;
|
||||
vec2 ref = interpolateAtOffset(inPosScreenArr[0], offset) + vec2(index);
|
||||
|
||||
if (distance(ref, interpolateAtOffset(inPosScreenArr[index], offset)) < 0.01
|
||||
&& abs(ref.y - interpolateAtOffset(inPosScreenArr[index].y, offset)) < 0.01
|
||||
&& abs(ref.y - interpolateAtOffset(inPosScreenArr[index], offset)).y < 0.01)
|
||||
{
|
||||
fs_out_color = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
fs_out_color = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> DATA
|
||||
-1.0 -1.0 0.0 1.0
|
||||
1.0 -1.0 0.0 1.0
|
||||
1.0 1.0 0.0 1.0
|
||||
-1.0 1.0 0.0 1.0
|
||||
END
|
||||
|
||||
BUFFER position_screen DATA_TYPE vec2<float> DATA
|
||||
0.0 0.0
|
||||
64.0 0.0
|
||||
64.0 64.0
|
||||
0.0 64.0
|
||||
END
|
||||
|
||||
IMAGE framebufferMS FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64 SAMPLES 4
|
||||
IMAGE framebuffer FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
VERTEX_DATA position_screen LOCATION 1
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebufferMS AS color LOCATION 0
|
||||
BIND BUFFER framebuffer AS resolve
|
||||
END
|
||||
|
||||
RUN pipeline DRAW_ARRAY AS TRIANGLE_FAN START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
|
||||
@@ -0,0 +1,84 @@
|
||||
#!amber
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE sampleRateShading
|
||||
|
||||
SHADER vertex vert_shader GLSL
|
||||
#version 440
|
||||
layout(location = 0) in vec4 inPosNDC;
|
||||
layout(location = 1) in vec2 inPosScreen;
|
||||
layout(location = 0) out vec2 outPosScreenArr[10];
|
||||
|
||||
void main (void)
|
||||
{
|
||||
gl_Position = inPosNDC;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
outPosScreenArr[i] = inPosScreen + vec2(i);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 440
|
||||
layout(location = 0) sample in vec2 inPosScreenArr[10];
|
||||
layout(location = 0) out vec4 fs_out_color;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
int index = int(gl_FragCoord.x) % 10;
|
||||
vec2 ref = interpolateAtSample(inPosScreenArr[0], gl_SampleID) + vec2(index);
|
||||
|
||||
if (distance(ref, interpolateAtSample(inPosScreenArr[index], gl_SampleID)) < 0.01
|
||||
&& abs(ref.y - interpolateAtSample(inPosScreenArr[index].y, gl_SampleID)) < 0.01
|
||||
&& abs(ref.y - interpolateAtSample(inPosScreenArr[index], gl_SampleID)).y < 0.01)
|
||||
{
|
||||
fs_out_color = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
fs_out_color = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> DATA
|
||||
-1.0 -1.0 0.0 1.0
|
||||
1.0 -1.0 0.0 1.0
|
||||
1.0 1.0 0.0 1.0
|
||||
-1.0 1.0 0.0 1.0
|
||||
END
|
||||
|
||||
BUFFER position_screen DATA_TYPE vec2<float> DATA
|
||||
0.0 0.0
|
||||
64.0 0.0
|
||||
64.0 64.0
|
||||
0.0 64.0
|
||||
END
|
||||
|
||||
IMAGE framebufferMS FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64 SAMPLES 4
|
||||
IMAGE framebuffer FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
|
||||
|
||||
PIPELINE graphics pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
VERTEX_DATA position_screen LOCATION 1
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
BIND BUFFER framebufferMS AS color LOCATION 0
|
||||
BIND BUFFER framebuffer AS resolve
|
||||
END
|
||||
|
||||
RUN pipeline DRAW_ARRAY AS TRIANGLE_FAN START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
|
||||
@@ -0,0 +1,43 @@
|
||||
# Copyright 2019 Google LLC.
|
||||
# Copyright 2019 The Khronos Group Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
[require]
|
||||
vertexPipelineStoresAndAtomics
|
||||
|
||||
[vertex shader]
|
||||
#version 430
|
||||
|
||||
layout(location = 0) in vec4 position_in;
|
||||
layout(binding = 0) buffer DataOut
|
||||
{
|
||||
vec4 values[];
|
||||
} dataOut;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = position_in;
|
||||
dataOut.values[gl_VertexIndex] = position_in;
|
||||
}
|
||||
|
||||
[vertex data]
|
||||
0/R32G32B32A32_SFLOAT
|
||||
0.1 0.2 0.3 0.4
|
||||
0.5 0.6 0.7 0.8
|
||||
0.9 1.0 1.1 1.2
|
||||
|
||||
[test]
|
||||
ssbo 0 48
|
||||
draw arrays TRIANGLE_STRIP 0 3
|
||||
probe ssbo float 0 0 == 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2
|
||||
@@ -0,0 +1,114 @@
|
||||
#!amber
|
||||
#
|
||||
# Copyright 2020 The Khronos Group Inc.
|
||||
# Copyright 2020 Valve Corporation.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
DEVICE_FEATURE geometryShader
|
||||
DEVICE_FEATURE tessellationShader
|
||||
|
||||
SHADER vertex vert GLSL
|
||||
#version 450
|
||||
layout (location=0) in vec4 in_pos;
|
||||
void main(void)
|
||||
{
|
||||
gl_Position = in_pos;
|
||||
}
|
||||
END
|
||||
|
||||
SHADER tessellation_control tesc GLSL
|
||||
#version 450
|
||||
layout (vertices = 3) out;
|
||||
void main(void)
|
||||
{
|
||||
gl_TessLevelInner[0] = 1.0;
|
||||
gl_TessLevelInner[1] = 1.0;
|
||||
gl_TessLevelOuter[0] = 1.0;
|
||||
gl_TessLevelOuter[1] = 1.0;
|
||||
gl_TessLevelOuter[2] = 1.0;
|
||||
gl_TessLevelOuter[3] = 1.0;
|
||||
|
||||
gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
|
||||
}
|
||||
END
|
||||
|
||||
SHADER tessellation_evaluation tese GLSL
|
||||
#version 450
|
||||
layout (triangles, fractional_odd_spacing, cw) in;
|
||||
void main(void)
|
||||
{
|
||||
gl_Position = (gl_TessCoord.x * gl_in[0].gl_Position) +
|
||||
(gl_TessCoord.y * gl_in[1].gl_Position) +
|
||||
(gl_TessCoord.z * gl_in[2].gl_Position);
|
||||
}
|
||||
END
|
||||
|
||||
SHADER fragment frag GLSL
|
||||
#version 450
|
||||
layout (location=0) out vec4 out_color;
|
||||
void main(void)
|
||||
{
|
||||
vec4 primitive_color;
|
||||
switch (gl_PrimitiveID) {
|
||||
case 0:
|
||||
case 1:
|
||||
primitive_color = vec4(0, 0, 1, 1);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
primitive_color = vec4(1, 0, 1, 1);
|
||||
break;
|
||||
default:
|
||||
primitive_color = vec4(0, 0, 0, 1);
|
||||
break;
|
||||
}
|
||||
out_color = primitive_color;
|
||||
}
|
||||
END
|
||||
|
||||
BUFFER position DATA_TYPE vec4<float> DATA
|
||||
-1 -1 0 1
|
||||
1 -1 0 1
|
||||
-1 0 0 1
|
||||
|
||||
-1 0 0 1
|
||||
1 -1 0 1
|
||||
1 0 0 1
|
||||
|
||||
-1 0 0 1
|
||||
1 0 0 1
|
||||
-1 1 0 1
|
||||
|
||||
-1 1 0 1
|
||||
1 0 0 1
|
||||
1 1 0 1
|
||||
|
||||
END
|
||||
|
||||
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
|
||||
|
||||
PIPELINE graphics graphics_pipeline
|
||||
ATTACH vert
|
||||
ATTACH tesc
|
||||
ATTACH tese
|
||||
ATTACH frag
|
||||
VERTEX_DATA position LOCATION 0
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
END
|
||||
|
||||
CLEAR_COLOR graphics_pipeline 255 255 255 255
|
||||
CLEAR graphics_pipeline
|
||||
RUN graphics_pipeline DRAW_ARRAY AS PATCH_LIST START_IDX 0 COUNT 12
|
||||
EXPECT framebuffer IDX 0 0 SIZE 250 125 EQ_RGBA 0 0 255 255
|
||||
EXPECT framebuffer IDX 0 125 SIZE 250 125 EQ_RGBA 255 0 255 255
|
||||
@@ -0,0 +1,52 @@
|
||||
#!amber
|
||||
DEVICE_FEATURE sampleRateShading
|
||||
SHADER vertex vert_shader GLSL
|
||||
#version 440
|
||||
layout(location = 0) in vec4 vs_in_position_ndc;
|
||||
layout(location = 1) in float vs_in_position_screen;
|
||||
layout(location = 0) out float vs_out_pos_screen;
|
||||
void main (void)
|
||||
{
|
||||
gl_Position = vs_in_position_ndc;
|
||||
vs_out_pos_screen = vs_in_position_screen;
|
||||
}
|
||||
END
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 440
|
||||
layout(location = 0) centroid in float fs_in_pos_screen;
|
||||
layout(location = 0) out vec4 fs_out_color;
|
||||
void main (void)
|
||||
{
|
||||
const float threshold = 0.0005;
|
||||
const float a = interpolateAtCentroid(fs_in_pos_screen);
|
||||
const float b = fs_in_pos_screen;
|
||||
const bool valuesEqual = (abs(a - b) < threshold);
|
||||
if (valuesEqual)
|
||||
fs_out_color = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
else
|
||||
fs_out_color = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
BUFFER position DATA_TYPE vec4<float> DATA
|
||||
1.0 -1.0 0.0 1.0
|
||||
1.0 1.0 0.0 1.0
|
||||
-1.0 -1.0 0.0 1.0
|
||||
-1.0 1.0 0.0 1.0
|
||||
END
|
||||
BUFFER position_screen DATA_TYPE float DATA
|
||||
64.0
|
||||
64.0
|
||||
0.0
|
||||
0.0
|
||||
END
|
||||
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
|
||||
PIPELINE graphics pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
VERTEX_DATA position_screen LOCATION 1
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
END
|
||||
RUN pipeline DRAW_ARRAY AS TRIANGLE_STRIP START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
|
||||
@@ -0,0 +1,52 @@
|
||||
#!amber
|
||||
DEVICE_FEATURE sampleRateShading
|
||||
SHADER vertex vert_shader GLSL
|
||||
#version 440
|
||||
layout(location = 0) in vec4 vs_in_position_ndc;
|
||||
layout(location = 1) in float vs_in_position_screen;
|
||||
layout(location = 0) out float vs_out_pos_screen;
|
||||
void main (void)
|
||||
{
|
||||
gl_Position = vs_in_position_ndc;
|
||||
vs_out_pos_screen = vs_in_position_screen;
|
||||
}
|
||||
END
|
||||
SHADER fragment frag_shader GLSL
|
||||
#version 440
|
||||
layout(location = 0) sample in float fs_in_pos_screen;
|
||||
layout(location = 0) out vec4 fs_out_color;
|
||||
void main (void)
|
||||
{
|
||||
const float threshold = 0.0005;
|
||||
const float a = interpolateAtSample(fs_in_pos_screen, gl_SampleID);
|
||||
const float b = fs_in_pos_screen;
|
||||
const bool valuesEqual = (abs(a - b) < threshold);
|
||||
if (valuesEqual)
|
||||
fs_out_color = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
else
|
||||
fs_out_color = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
END
|
||||
BUFFER position DATA_TYPE vec4<float> DATA
|
||||
1.0 -1.0 0.0 1.0
|
||||
1.0 1.0 0.0 1.0
|
||||
-1.0 -1.0 0.0 1.0
|
||||
-1.0 1.0 0.0 1.0
|
||||
END
|
||||
BUFFER position_screen DATA_TYPE float DATA
|
||||
64.0
|
||||
64.0
|
||||
0.0
|
||||
0.0
|
||||
END
|
||||
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
|
||||
PIPELINE graphics pipeline
|
||||
ATTACH vert_shader
|
||||
ATTACH frag_shader
|
||||
VERTEX_DATA position LOCATION 0
|
||||
VERTEX_DATA position_screen LOCATION 1
|
||||
BIND BUFFER framebuffer AS color LOCATION 0
|
||||
FRAMEBUFFER_SIZE 64 64
|
||||
END
|
||||
RUN pipeline DRAW_ARRAY AS TRIANGLE_STRIP START_IDX 0 COUNT 4
|
||||
EXPECT framebuffer IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
|
||||
Reference in New Issue
Block a user