This commit is contained in:
2026-05-06 23:44:13 +02:00
parent a5f787d80f
commit fd7038b853
1574 changed files with 365439 additions and 0 deletions
@@ -0,0 +1,51 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 4; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
# The fill value has the most significant bit enabled for each component.
IMAGE texture FORMAT A2B10G10R10_SNORM_PACK32 DIM_1D WIDTH 1 FILL 2684879360
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,51 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 4; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
# The fill value has the most significant bit enabled for each component.
IMAGE texture FORMAT A2R10G10B10_SNORM_PACK32 DIM_1D WIDTH 1 FILL 2684879360
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,51 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 4; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
# The fill value has the most significant bit enabled for each component.
IMAGE texture FORMAT A8B8G8R8_SNORM_PACK32 DIM_1D WIDTH 1 FILL 2155905152
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,50 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 3; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
IMAGE texture FORMAT B8G8R8_SNORM DIM_1D WIDTH 1 FILL -128
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,50 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 4; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
IMAGE texture FORMAT B8G8R8A8_SNORM DIM_1D WIDTH 1 FILL -128
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,50 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 1; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
IMAGE texture FORMAT R16_SNORM DIM_1D WIDTH 1 FILL -32768
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,50 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 2; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
IMAGE texture FORMAT R16G16_SNORM DIM_1D WIDTH 1 FILL -32768
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,50 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 3; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
IMAGE texture FORMAT R16G16B16_SNORM DIM_1D WIDTH 1 FILL -32768
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,50 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 4; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
IMAGE texture FORMAT R16G16B16A16_SNORM DIM_1D WIDTH 1 FILL -32768
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,50 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 1; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
IMAGE texture FORMAT R8_SNORM DIM_1D WIDTH 1 FILL -128
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,50 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 2; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
IMAGE texture FORMAT R8G8_SNORM DIM_1D WIDTH 1 FILL -128
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,50 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 3; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
IMAGE texture FORMAT R8G8B8_SNORM DIM_1D WIDTH 1 FILL -128
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,50 @@
#!amber
# Copyright 2020 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 vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 frag_out;
uniform layout(set=0, binding=0) sampler1D tex_sampler;
void main()
{
vec4 color = texture(tex_sampler, 0.0);
for (int i = 0; i < 4; i++)
{
if (color[i] != -1.0)
{
frag_out = vec4(1, 0, 0, 1);
return;
}
}
frag_out = vec4(0, 1, 0, 1);
}
END
IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
IMAGE texture FORMAT R8G8B8A8_SNORM DIM_1D WIDTH 1 FILL -128
SAMPLER sampler
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 255 0 255
@@ -0,0 +1,73 @@
#!amber
# Copyright 2020 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=10, local_size_y=10) in;
uniform layout (set=0, binding=0, r11f_g11f_b10f) image2D texture;
void main ()
{
ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
vec4 color = vec4(uv.x - uv.y, uv.y, -uv.y, 1);
imageStore(texture, uv, color);
}
END
SHADER compute compute_shader_verify GLSL
#version 430
layout(local_size_x=1, local_size_y=1) in;
uniform layout (set=0, binding=0, r11f_g11f_b10f) image2D texture;
layout(binding = 1) buffer Buf1
{
int result;
};
void main ()
{
result = 1;
for (int y = 0; y < 50; y++)
for (int x = 0; x < 50; x++)
{
ivec2 uv = ivec2(x, y);
vec4 color = imageLoad(texture, uv);
// Conversion to tiny float should clamp negative values to zero,
// thus the max operation here.
vec4 ref = max(vec4(uv.x - uv.y, uv.y, -uv.y, 1), vec4(0));
if (color != ref)
result = 0;
}
}
END
IMAGE texture FORMAT B10G11R11_UFLOAT_PACK32 DIM_2D WIDTH 50 HEIGHT 50 FILL 0
BUFFER result DATA_TYPE int32 SIZE 1 FILL 0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
END
PIPELINE compute verify
ATTACH compute_shader_verify
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER result AS storage DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 5 5 1
RUN verify 1 1 1
EXPECT result IDX 0 EQ 1
@@ -0,0 +1,98 @@
#!amber
# Copyright 2020 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 shaderStorageImageMultisample
SHADER compute compute_shader GLSL
#version 430
layout(local_size_x = 16, local_size_y = 16) in;
uniform layout(set=0, binding=0, r32i) iimage2DMS texture;
uniform layout(set=0, binding=1, rgba8) image2D result;
void main()
{
ivec2 loc = ivec2(gl_LocalInvocationID.xy);
// Partner location is a mirror in local workgroup space.
ivec2 partnerLoc = ivec2(15) - loc;
int id = loc.y * 16 + loc.x;
int partnerId = partnerLoc.y * 16 + partnerLoc.x;
ivec2 workGroupOffset = ivec2(gl_WorkGroupID.xy) * ivec2(16);
// Initialize texture with id + sample id
for (int s = 0; s < 4; s++)
imageStore(texture, loc + workGroupOffset, s, ivec4(s + id));
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// Add id to both location and partner location.
imageAtomicAdd(texture, loc + workGroupOffset, s, id);
imageAtomicAdd(texture, partnerLoc + workGroupOffset, s, id);
// Set MSB for location and the second MSB for partner.
imageAtomicOr(texture, loc + workGroupOffset, s, 1 << 31);
imageAtomicOr(texture, partnerLoc + workGroupOffset, s, 1 << 30);
}
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// XOR with two patterns in the second highest byte. Should set this
// byte to 0xc. The order of XOR operations don't matter.
imageAtomicXor(texture, loc + workGroupOffset, s, 0x0a000000);
imageAtomicXor(texture, partnerLoc + workGroupOffset, s, 0x06000000);
}
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// Finally mask out one of LSBs based on sample
imageAtomicAnd(texture, loc + workGroupOffset, s, ~(1 << s));
}
// Verification
bool ok = true;
for (int s = 0; s < 4; s++)
{
if (imageLoad(texture, loc + workGroupOffset, s).r != (((s + id * 2 + partnerId) | 0xcc000000) & ~(1 << s)))
ok = false;
}
vec4 color = ok ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
imageStore(result, loc + workGroupOffset, color);
}
END
IMAGE texture FORMAT R32_SINT DIM_2D WIDTH 64 HEIGHT 64 SAMPLES 4
IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64 FILL 0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 4 4 1
EXPECT result IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
@@ -0,0 +1,98 @@
#!amber
# Copyright 2020 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 shaderStorageImageMultisample
SHADER compute compute_shader GLSL
#version 430
layout(local_size_x = 16, local_size_y = 16) in;
uniform layout(set=0, binding=0, r32ui) uimage2DMS texture;
uniform layout(set=0, binding=1, rgba8) image2D result;
void main()
{
ivec2 loc = ivec2(gl_LocalInvocationID.xy);
// Partner location is a mirror in local workgroup space.
ivec2 partnerLoc = ivec2(15) - loc;
uint id = loc.y * 16 + loc.x;
uint partnerId = partnerLoc.y * 16 + partnerLoc.x;
ivec2 workGroupOffset = ivec2(gl_WorkGroupID.xy) * ivec2(16);
// Initialize texture with id + sample id
for (int s = 0; s < 4; s++)
imageStore(texture, loc + workGroupOffset, s, uvec4(s + id));
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// Add id to both location and partner location.
imageAtomicAdd(texture, loc + workGroupOffset, s, id);
imageAtomicAdd(texture, partnerLoc + workGroupOffset, s, id);
// Set MSB for location and the second MSB for partner.
imageAtomicOr(texture, loc + workGroupOffset, s, 1u << 31);
imageAtomicOr(texture, partnerLoc + workGroupOffset, s, 1u << 30);
}
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// XOR with two patterns in the second highest byte. Should set this
// byte to 0xc. The order of XOR operations don't matter.
imageAtomicXor(texture, loc + workGroupOffset, s, 0x0a000000);
imageAtomicXor(texture, partnerLoc + workGroupOffset, s, 0x06000000);
}
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// Finally mask out one of LSBs based on sample
imageAtomicAnd(texture, loc + workGroupOffset, s, ~(1u << s));
}
// Verification
bool ok = true;
for (int s = 0; s < 4; s++)
{
if (imageLoad(texture, loc + workGroupOffset, s).r != (((s + id * 2 + partnerId) | 0xcc000000) & ~(1u << s)))
ok = false;
}
vec4 color = ok ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
imageStore(result, loc + workGroupOffset, color);
}
END
IMAGE texture FORMAT R32_UINT DIM_2D WIDTH 64 HEIGHT 64 SAMPLES 4
IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64 FILL 0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 4 4 1
EXPECT result IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
@@ -0,0 +1,101 @@
#!amber
# Copyright 2020 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 shaderStorageImageMultisample
DEVICE_FEATURE shaderInt64
SHADER compute compute_shader GLSL
#version 430
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
#extension GL_EXT_shader_image_int64 : require
layout(local_size_x = 16, local_size_y = 16) in;
uniform layout(set=0, binding=0, r64i) i64image2DMS texture;
uniform layout(set=0, binding=1, rgba8) image2D result;
void main()
{
ivec2 loc = ivec2(gl_LocalInvocationID.xy);
// Partner location is a mirror in local workgroup space.
ivec2 partnerLoc = ivec2(15) - loc;
int id = loc.y * 16 + loc.x;
int partnerId = partnerLoc.y * 16 + partnerLoc.x;
ivec2 workGroupOffset = ivec2(gl_WorkGroupID.xy) * ivec2(16);
// Initialize texture with id + sample id
for (int s = 0; s < 4; s++)
imageStore(texture, loc + workGroupOffset, s, ivec4(int64_t(s + id)));
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// Add id to both location and partner location.
imageAtomicAdd(texture, loc + workGroupOffset, s, int64_t(id));
imageAtomicAdd(texture, partnerLoc + workGroupOffset, s, int64_t(id));
// Set MSB for location and the second MSB for partner.
imageAtomicOr(texture, loc + workGroupOffset, s, int64_t(1) << 63);
imageAtomicOr(texture, partnerLoc + workGroupOffset, s, int64_t(1) << 62);
}
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// XOR with two patterns in the second highest byte. Should set this
// byte to 0xc. The order of XOR operations don't matter.
imageAtomicXor(texture, loc + workGroupOffset, s, 0x0a00000000000000L);
imageAtomicXor(texture, partnerLoc + workGroupOffset, s, 0x0600000000000000L);
}
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// Finally mask out one of LSBs based on sample
imageAtomicAnd(texture, loc + workGroupOffset, s, ~(int64_t(1) << s));
}
// Verification
bool ok = true;
for (int s = 0; s < 4; s++)
{
if (imageLoad(texture, loc + workGroupOffset, s).r != int64_t(((s + id * 2 + partnerId) | 0x0a00000000000000L) & ~(int64_t(1) << s)))
ok = false;
}
vec4 color = ok ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
imageStore(result, loc + workGroupOffset, color);
}
END
IMAGE texture FORMAT R64_SINT DIM_2D WIDTH 64 HEIGHT 64 SAMPLES 4
IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64 FILL 0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 4 4 1
EXPECT result IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
@@ -0,0 +1,90 @@
#!amber
# See the License for the specific language governing permissions and
# limitations under the License.
DEVICE_FEATURE shaderStorageImageMultisample
DEVICE_FEATURE shaderInt64
SHADER compute compute_shader GLSL
#version 430
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
#extension GL_EXT_shader_image_int64 : require
layout(local_size_x = 16, local_size_y = 16) in;
uniform layout(set=0, binding=0, r64ui) u64image2DMS texture;
uniform layout(set=0, binding=1, rgba8) image2D result;
void main()
{
ivec2 loc = ivec2(gl_LocalInvocationID.xy);
// Partner location is a mirror in local workgroup space.
ivec2 partnerLoc = ivec2(15) - loc;
int id = loc.y * 16 + loc.x;
int partnerId = partnerLoc.y * 16 + partnerLoc.x;
ivec2 workGroupOffset = ivec2(gl_WorkGroupID.xy) * ivec2(16);
// Initialize texture with id + sample id
for (int s = 0; s < 4; s++)
imageStore(texture, loc + workGroupOffset, s, uvec4(uint64_t(s + id)));
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// Add id to both location and partner location.
imageAtomicAdd(texture, loc + workGroupOffset, s, uint64_t(id));
imageAtomicAdd(texture, partnerLoc + workGroupOffset, s, uint64_t(id));
// Set MSB for location and the second MSB for partner.
imageAtomicOr(texture, loc + workGroupOffset, s, uint64_t(1) << 63);
imageAtomicOr(texture, partnerLoc + workGroupOffset, s, uint64_t(1) << 62);
}
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// XOR with two patterns in the second highest byte. Should set this
// byte to 0xc. The order of XOR operations don't matter.
imageAtomicXor(texture, loc + workGroupOffset, s, 0x0a00000000000000L);
imageAtomicXor(texture, partnerLoc + workGroupOffset, s, 0x0600000000000000L);
}
memoryBarrierImage();
barrier();
for (int s = 0; s < 4; s++)
{
// Finally mask out one of LSBs based on sample
imageAtomicAnd(texture, loc + workGroupOffset, s, ~(uint64_t(1) << s));
}
// Verification
bool ok = true;
for (int s = 0; s < 4; s++)
{
if (imageLoad(texture, loc + workGroupOffset, s).r != uint64_t(((s + id * 2 + partnerId) | 0x0a00000000000000L) & ~(uint64_t(1) << s)))
ok = false;
}
vec4 color = ok ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
imageStore(result, loc + workGroupOffset, color);
}
END
IMAGE texture FORMAT R64_UINT DIM_2D WIDTH 64 HEIGHT 64 SAMPLES 4
IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64 FILL 0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 4 4 1
EXPECT result IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
@@ -0,0 +1,89 @@
#!amber
# Copyright 2021 Google LLC.
# Copyright 2021 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
#
# 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.
# Write to an invalid sample index test
# Sample Count: 16
# Tested Sample Min: -256
# Tested Sample Max: 256
# Description: All writes to invalid sample numbers should be discarded.
DEVICE_FEATURE shaderStorageImageMultisample
SHADER compute compute_shader GLSL
#version 430
layout(local_size_x = 16, local_size_y = 16) in;
uniform layout(set=0, binding=0, rgba8) image2DMS texture;
uniform layout(set=0, binding=1, rgba8) image2D result;
void main()
{
int numSamples = 16;
int distortion = 256;
vec4 ndxColors[4];
ndxColors[0] = vec4(1.0, 0.0, 0.0, 1.0);
ndxColors[1] = vec4(0.0, 1.0, 0.0, 1.0);
ndxColors[2] = vec4(0.0, 0.0, 1.0, 1.0);
ndxColors[3] = vec4(0.0, 1.0, 1.0, 1.0);
ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
// Initialize texture
for (int s = -distortion; s < distortion; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
imageStore(texture, uv, s, color);
}
memoryBarrierImage();
barrier();
// Verification
bool imageOk = true;
for (int s = 0; s < numSamples; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
if (imageLoad(texture, uv, s) != color)
imageOk = false;
}
vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
imageStore(result, uv, resultColor);
}
END
IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 16
IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 FILL 0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 1 1 1
EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
@@ -0,0 +1,87 @@
#!amber
# Copyright 2021 Google LLC.
# Copyright 2021 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
#
# 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.
# Write to an invalid sample index test
# Sample Count: 2
# Tested Sample Min: -256
# Tested Sample Max: 256
# Description: All writes to invalid sample numbers should be discarded.
DEVICE_FEATURE shaderStorageImageMultisample
SHADER compute compute_shader GLSL
#version 430
layout(local_size_x = 16, local_size_y = 16) in;
uniform layout(set=0, binding=0, rgba8) image2DMS texture;
uniform layout(set=0, binding=1, rgba8) image2D result;
void main()
{
int numSamples = 2;
int distortion = 256;
vec4 ndxColors[2];
ndxColors[0] = vec4(1.0, 0.0, 1.0, 1.0);
ndxColors[1] = vec4(0.0, 1.0, 1.0, 1.0);
ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
// Initialize texture
for (int s = -distortion; s < distortion; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 2];
imageStore(texture, uv, s, color);
}
memoryBarrierImage();
barrier();
// Verification
bool imageOk = true;
for (int s = 0; s < numSamples; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 2];
if (imageLoad(texture, uv, s) != color)
imageOk = false;
}
vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
imageStore(result, uv, resultColor);
}
END
IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 2
IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 FILL 0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 1 1 1
EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
@@ -0,0 +1,89 @@
#!amber
# Copyright 2021 Google LLC.
# Copyright 2021 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
#
# 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.
# Write to an invalid sample number test
# Sample Count: 32
# Tested Sample Min: -256
# Tested Sample Max: 256
# Description: All writes to invalid sample numbers should be discarded.
DEVICE_FEATURE shaderStorageImageMultisample
SHADER compute compute_shader GLSL
#version 430
layout(local_size_x = 16, local_size_y = 16) in;
uniform layout(set=0, binding=0, rgba8) image2DMS texture;
uniform layout(set=0, binding=1, rgba8) image2D result;
void main()
{
int numSamples = 32;
int distortion = 256;
vec4 ndxColors[4];
ndxColors[0] = vec4(1.0, 0.0, 0.0, 1.0);
ndxColors[1] = vec4(0.0, 1.0, 0.0, 1.0);
ndxColors[2] = vec4(0.0, 0.0, 1.0, 1.0);
ndxColors[3] = vec4(0.0, 1.0, 1.0, 1.0);
ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
// Initialize texture
for (int s = -distortion; s < distortion; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
imageStore(texture, uv, s, color);
}
memoryBarrierImage();
barrier();
// Verification
bool imageOk = true;
for (int s = 0; s < numSamples; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
if (imageLoad(texture, uv, s) != color)
imageOk = false;
}
vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
imageStore(result, uv, resultColor);
}
END
IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 32
IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 FILL 0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 1 1 1
EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
@@ -0,0 +1,89 @@
#!amber
# Copyright 2021 Google LLC.
# Copyright 2021 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
#
# 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.
# Write to an invalid sample index test
# Sample Count: 4
# Tested Sample Min: -256
# Tested Sample Max: 256
# Description: All writes to invalid sample numbers should be discarded.
DEVICE_FEATURE shaderStorageImageMultisample
SHADER compute compute_shader GLSL
#version 430
layout(local_size_x = 16, local_size_y = 16) in;
uniform layout(set=0, binding=0, rgba8) image2DMS texture;
uniform layout(set=0, binding=1, rgba8) image2D result;
void main()
{
int numSamples = 4;
int distortion = 256;
vec4 ndxColors[4];
ndxColors[0] = vec4(1.0, 0.0, 0.0, 1.0);
ndxColors[1] = vec4(0.0, 1.0, 0.0, 1.0);
ndxColors[2] = vec4(0.0, 0.0, 1.0, 1.0);
ndxColors[3] = vec4(0.0, 1.0, 1.0, 1.0);
ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
// Initialize texture
for (int s = -distortion; s < distortion; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
imageStore(texture, uv, s, color);
}
memoryBarrierImage();
barrier();
// Verification
bool imageOk = true;
for (int s = 0; s < numSamples; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
if (imageLoad(texture, uv, s) != color)
imageOk = false;
}
vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
imageStore(result, uv, resultColor);
}
END
IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 4
IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 FILL 0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 1 1 1
EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
@@ -0,0 +1,89 @@
#!amber
# Copyright 2021 Google LLC.
# Copyright 2021 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
#
# 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.
# Write to an invalid sample number test
# Sample Count: 64
# Tested Sample Min: -256
# Tested Sample Max: 256
# Description: All writes to invalid sample numbers should be discarded.
DEVICE_FEATURE shaderStorageImageMultisample
SHADER compute compute_shader GLSL
#version 430
layout(local_size_x = 16, local_size_y = 16) in;
uniform layout(set=0, binding=0, rgba8) image2DMS texture;
uniform layout(set=0, binding=1, rgba8) image2D result;
void main()
{
int numSamples = 64;
int distortion = 256;
vec4 ndxColors[4];
ndxColors[0] = vec4(1.0, 0.0, 0.0, 1.0);
ndxColors[1] = vec4(0.0, 1.0, 0.0, 1.0);
ndxColors[2] = vec4(0.0, 0.0, 1.0, 1.0);
ndxColors[3] = vec4(0.0, 1.0, 1.0, 1.0);
ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
// Initialize texture
for (int s = -distortion; s < distortion; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
imageStore(texture, uv, s, color);
}
memoryBarrierImage();
barrier();
// Verification
bool imageOk = true;
for (int s = 0; s < numSamples; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
if (imageLoad(texture, uv, s) != color)
imageOk = false;
}
vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
imageStore(result, uv, resultColor);
}
END
IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 64
IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 FILL 0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 1 1 1
EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
@@ -0,0 +1,89 @@
#!amber
# Copyright 2021 Google LLC.
# Copyright 2021 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
#
# 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.
# Write to an invalid sample index test
# Sample Count: 8
# Tested Sample Min: -256
# Tested Sample Max: 256
# Description: All writes to invalid sample numbers should be discarded.
DEVICE_FEATURE shaderStorageImageMultisample
SHADER compute compute_shader GLSL
#version 430
layout(local_size_x = 16, local_size_y = 16) in;
uniform layout(set=0, binding=0, rgba8) image2DMS texture;
uniform layout(set=0, binding=1, rgba8) image2D result;
void main()
{
int numSamples = 8;
int distortion = 256;
vec4 ndxColors[4];
ndxColors[0] = vec4(1.0, 0.0, 0.0, 1.0);
ndxColors[1] = vec4(0.0, 1.0, 0.0, 1.0);
ndxColors[2] = vec4(0.0, 0.0, 1.0, 1.0);
ndxColors[3] = vec4(0.0, 1.0, 1.0, 1.0);
ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
// Initialize texture
for (int s = -distortion; s < distortion; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
imageStore(texture, uv, s, color);
}
memoryBarrierImage();
barrier();
// Verification
bool imageOk = true;
for (int s = 0; s < numSamples; s++)
{
vec4 color = vec4(1);
if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
if (imageLoad(texture, uv, s) != color)
imageOk = false;
}
vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
imageStore(result, uv, resultColor);
}
END
IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 8
IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 FILL 0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 1 1 1
EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
@@ -0,0 +1,51 @@
#!amber
# Copyright 2022 Google LLC.
# Copyright 2022 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) sampler2DShadow tex;
void main()
{
// Sample border color of opaque white which makes the depth comparison 0.5 > 1.0 false.
color_out = vec4(texture(tex, vec3(2.0, 2.0, 0.5)), 0.0, 0.0, 1.0);
}
END
IMAGE texture FORMAT D32_SFLOAT DIM_2D WIDTH 32 HEIGHT 32 FILL 0.0
IMAGE framebuffer FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
SAMPLER sampler_float_opaque_white \
ADDRESS_MODE_U clamp_to_border \
ADDRESS_MODE_V clamp_to_border \
BORDER_COLOR float_opaque_white \
COMPARE on \
COMPARE_OP greater
PIPELINE graphics pipeline_float_opaque_white
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler_float_opaque_white DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 32 32
BIND BUFFER framebuffer AS color LOCATION 0
END
RUN pipeline_float_opaque_white DRAW_RECT POS 0 0 SIZE 32 32
EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 0 0 255
@@ -0,0 +1,105 @@
#!amber
# 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.
SHADER vertex vert_shader_mipclear PASSTHROUGH
SHADER vertex vert_shader_lod GLSL
#version 430
layout(location = 0) in vec3 position_in;
layout(location = 0) out vec4 color_out;
layout(set = 0, binding = 0) uniform highp sampler2D tex;
void main() {
gl_Position = vec4(position_in, 1.0);
// Pick a color from the center of a mipmap. Each corner point gets its own mip level.
int lod = gl_VertexIndex % 4;
int center = 256 >> lod;
color_out = texelFetch(tex, ivec2(center), lod);
}
END
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) in vec4 color_in;
layout(location = 0) out vec4 color_out;
void main() {
color_out = color_in;
}
END
BUFFER texture FORMAT B8G8R8A8_UNORM MIP_LEVELS 4
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
SAMPLER sampler MAX_LOD 4.0
PIPELINE graphics mipclear_pipeline0
ATTACH vert_shader_mipclear
ATTACH frag_shader
BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 0
FRAMEBUFFER_SIZE 512 512
END
PIPELINE graphics mipclear_pipeline1
ATTACH vert_shader_mipclear
ATTACH frag_shader
BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 1
FRAMEBUFFER_SIZE 256 256
END
PIPELINE graphics mipclear_pipeline2
ATTACH vert_shader_mipclear
ATTACH frag_shader
BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 2
FRAMEBUFFER_SIZE 128 128
END
PIPELINE graphics mipclear_pipeline3
ATTACH vert_shader_mipclear
ATTACH frag_shader
BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 3
FRAMEBUFFER_SIZE 64 64
END
PIPELINE graphics lod_pipeline
ATTACH vert_shader_lod
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
FRAMEBUFFER_SIZE 512 512
END
# Clear all mip levels to different color.
CLEAR_COLOR mipclear_pipeline0 255 0 0 255
CLEAR mipclear_pipeline0
CLEAR_COLOR mipclear_pipeline1 0 255 0 255
CLEAR mipclear_pipeline1
CLEAR_COLOR mipclear_pipeline2 0 0 255 255
CLEAR mipclear_pipeline2
CLEAR_COLOR mipclear_pipeline3 255 255 0 255
CLEAR mipclear_pipeline3
CLEAR_COLOR lod_pipeline 0 0 0 255
CLEAR lod_pipeline
RUN lod_pipeline DRAW_RECT POS 0 0 SIZE 512 512
# Check corners of the frame buffer: each should have a color from a different mip level.
EXPECT framebuffer IDX 0 511 SIZE 1 1 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 511 0 SIZE 1 1 EQ_RGBA 255 255 0 255
EXPECT framebuffer IDX 511 511 SIZE 1 1 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 0 0 SIZE 1 1 EQ_RGBA 0 255 0 255
@@ -0,0 +1,90 @@
#!amber
# 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.
SHADER vertex vert_shader_mipclear PASSTHROUGH
SHADER vertex vert_shader_lod GLSL
#version 430
layout(location = 0) in vec3 position_in;
layout(location = 0) out vec4 color_out;
layout(set = 0, binding = 0) uniform highp sampler2D tex;
void main() {
gl_Position = vec4(position_in, 1.0);
// Vary dPdx and dPdy based on vertex index to force
// LOD 0 or LOD 1.
vec2 v = vec2(0);
if (gl_VertexIndex % 2 != 0)
v = vec2(1);
color_out = vec4(textureGrad(tex, vec2(0.5), v, v));
}
END
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) in vec4 color_in;
layout(location = 0) out vec4 color_out;
void main() {
color_out = color_in;
}
END
BUFFER texture FORMAT B8G8R8A8_UNORM MIP_LEVELS 2
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
SAMPLER sampler MAX_LOD 2.0
PIPELINE graphics mipclear_pipeline0
ATTACH vert_shader_mipclear
ATTACH frag_shader
BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 0
FRAMEBUFFER_SIZE 512 512
END
PIPELINE graphics mipclear_pipeline1
ATTACH vert_shader_mipclear
ATTACH frag_shader
BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 1
FRAMEBUFFER_SIZE 256 256
END
PIPELINE graphics lod_pipeline
ATTACH vert_shader_lod
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
FRAMEBUFFER_SIZE 512 512
END
# Clear all mip levels to different color.
CLEAR_COLOR mipclear_pipeline0 255 0 0 255
CLEAR mipclear_pipeline0
CLEAR_COLOR mipclear_pipeline1 0 255 0 255
CLEAR mipclear_pipeline1
CLEAR_COLOR lod_pipeline 0 0 0 255
CLEAR lod_pipeline
RUN lod_pipeline DRAW_RECT POS 0 0 SIZE 512 512
# Check corners of the frame buffer: even vertices should have LOD 0 and odd ones LOD 1.
EXPECT framebuffer IDX 0 511 SIZE 1 1 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 511 0 SIZE 1 1 EQ_RGBA 0 255 0 255
EXPECT framebuffer IDX 511 511 SIZE 1 1 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 0 0 SIZE 1 1 EQ_RGBA 0 255 0 255
@@ -0,0 +1,103 @@
#!amber
# 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.
SHADER vertex vert_shader_mipclear PASSTHROUGH
SHADER vertex vert_shader_lod GLSL
#version 430
layout(location = 0) in vec3 position_in;
layout(location = 0) out vec4 color_out;
layout(set = 0, binding = 0) uniform highp sampler2D tex;
void main() {
gl_Position = vec4(position_in, 1.0);
// Pick a color from the center of a mipmap. Each corner point gets its own mip level.
color_out = vec4(textureLod(tex, vec2(0.5), float(gl_VertexIndex % 4)));
}
END
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) in vec4 color_in;
layout(location = 0) out vec4 color_out;
void main() {
color_out = color_in;
}
END
BUFFER texture FORMAT B8G8R8A8_UNORM MIP_LEVELS 4
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
SAMPLER sampler MAX_LOD 4.0
PIPELINE graphics mipclear_pipeline0
ATTACH vert_shader_mipclear
ATTACH frag_shader
BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 0
FRAMEBUFFER_SIZE 512 512
END
PIPELINE graphics mipclear_pipeline1
ATTACH vert_shader_mipclear
ATTACH frag_shader
BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 1
FRAMEBUFFER_SIZE 256 256
END
PIPELINE graphics mipclear_pipeline2
ATTACH vert_shader_mipclear
ATTACH frag_shader
BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 2
FRAMEBUFFER_SIZE 128 128
END
PIPELINE graphics mipclear_pipeline3
ATTACH vert_shader_mipclear
ATTACH frag_shader
BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 3
FRAMEBUFFER_SIZE 64 64
END
PIPELINE graphics lod_pipeline
ATTACH vert_shader_lod
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
FRAMEBUFFER_SIZE 512 512
END
# Clear all mip levels to different color.
CLEAR_COLOR mipclear_pipeline0 255 0 0 255
CLEAR mipclear_pipeline0
CLEAR_COLOR mipclear_pipeline1 0 255 0 255
CLEAR mipclear_pipeline1
CLEAR_COLOR mipclear_pipeline2 0 0 255 255
CLEAR mipclear_pipeline2
CLEAR_COLOR mipclear_pipeline3 255 255 0 255
CLEAR mipclear_pipeline3
CLEAR_COLOR lod_pipeline 0 0 0 255
CLEAR lod_pipeline
RUN lod_pipeline DRAW_RECT POS 0 0 SIZE 512 512
# Check corners of the frame buffer: each should have a color from a different mip level.
EXPECT framebuffer IDX 0 511 SIZE 1 1 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 511 0 SIZE 1 1 EQ_RGBA 255 255 0 255
EXPECT framebuffer IDX 511 511 SIZE 1 1 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 0 0 SIZE 1 1 EQ_RGBA 0 255 0 255
@@ -0,0 +1,56 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) usamplerBuffer texels;
void main()
{
color_out = texelFetch(texels, int(gl_FragCoord.x) % 4);
}
END
BUFFER texel_buffer DATA_TYPE A2B10G10R10_UINT_PACK32 DATA
0x40000001 # Unpacks to R = 1, G = 0, B = 0, A = 1
0x40000400 # Unpacks to R = 0, G = 1, B = 0, A = 1
0x40100000 # Unpacks to R = 0, G = 0, B = 1, A = 1
0x40100400 # Unpacks to R = 0, G = 1, B = 1, A = 1
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 50 50 SIZE 100 100
EXPECT framebuffer IDX 50 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 51 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 52 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 53 50 SIZE 1 100 EQ_RGBA 0 255 0 255
EXPECT framebuffer IDX 54 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 55 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 56 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 57 50 SIZE 1 100 EQ_RGBA 0 255 0 255
@@ -0,0 +1,56 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = texelFetch(texels, int(gl_FragCoord.x) % 4);
}
END
BUFFER texel_buffer DATA_TYPE A2B10G10R10_UNORM_PACK32 DATA
0xc00003ff # Unpacks to R = 1023, G = 0, B = 0, A = 3
0xc00ffc00 # Unpacks to R = 0, G = 1023, B = 0, A = 3
0xfff00000 # Unpacks to R = 0, G = 0, B = 1023, A = 3
0xfffffc00 # Unpacks to R = 0, G = 1023, B = 1023, A = 3
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 50 50 SIZE 100 100
EXPECT framebuffer IDX 50 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 51 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 52 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 53 50 SIZE 1 100 EQ_RGBA 0 255 0 255
EXPECT framebuffer IDX 54 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 55 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 56 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 57 50 SIZE 1 100 EQ_RGBA 0 255 0 255
@@ -0,0 +1,56 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) isamplerBuffer texels;
void main()
{
color_out = texelFetch(texels, int(gl_FragCoord.x) % 4);
}
END
BUFFER texel_buffer DATA_TYPE A8B8G8R8_SINT_PACK32 DATA
0x01000001 # Unpacks to R = 1, G = 0, B = 0, A = 1
0x01000100 # Unpacks to R = 0, G = 1, B = 0, A = 1
0x01010000 # Unpacks to R = 0, G = 0, B = 1, A = 1
0x01010100 # Unpacks to R = 0, G = 1, B = 1, A = 1
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 50 50 SIZE 100 100
EXPECT framebuffer IDX 50 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 51 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 52 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 53 50 SIZE 1 100 EQ_RGBA 0 255 0 255
EXPECT framebuffer IDX 54 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 55 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 56 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 57 50 SIZE 1 100 EQ_RGBA 0 255 0 255
@@ -0,0 +1,56 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = texelFetch(texels, int(gl_FragCoord.x) % 4);
}
END
BUFFER texel_buffer DATA_TYPE A8B8G8R8_SNORM_PACK32 DATA
0x7f00007f # Unpacks to R = 127, G = 0, B = 0, A = 127
0x7f007f00 # Unpacks to R = 0, G = 127, B = 0, A = 127
0x7f7f0000 # Unpacks to R = 0, G = 0, B = 127, A = 127
0x7f7f7f00 # Unpacks to R = 0, G = 127, B = 127, A = 127
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 50 50 SIZE 100 100
EXPECT framebuffer IDX 50 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 51 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 52 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 53 50 SIZE 1 100 EQ_RGBA 0 255 0 255
EXPECT framebuffer IDX 54 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 55 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 56 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 57 50 SIZE 1 100 EQ_RGBA 0 255 0 255
@@ -0,0 +1,56 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) usamplerBuffer texels;
void main()
{
color_out = texelFetch(texels, int(gl_FragCoord.x) % 4);
}
END
BUFFER texel_buffer DATA_TYPE A8B8G8R8_UINT_PACK32 DATA
0x01000001 # Unpacks to R = 1, G = 0, B = 0, A = 1
0x01000100 # Unpacks to R = 0, G = 1, B = 0, A = 1
0x01010000 # Unpacks to R = 0, G = 0, B = 1, A = 1
0x01010100 # Unpacks to R = 0, G = 1, B = 1, A = 1
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 50 50 SIZE 100 100
EXPECT framebuffer IDX 50 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 51 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 52 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 53 50 SIZE 1 100 EQ_RGBA 0 255 0 255
EXPECT framebuffer IDX 54 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 55 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 56 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 57 50 SIZE 1 100 EQ_RGBA 0 255 0 255
@@ -0,0 +1,56 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = texelFetch(texels, int(gl_FragCoord.x) % 4);
}
END
BUFFER texel_buffer DATA_TYPE A8B8G8R8_UNORM_PACK32 DATA
0xff0000ff # Unpacks to R = 255, G = 0, B = 0, A = 255
0xff00ff00 # Unpacks to R = 0, G = 255, B = 0, A = 255
0xffff0000 # Unpacks to R = 0, G = 0, B = 255, A = 255
0xffffff00 # Unpacks to R = 0, G = 255, B = 255, A = 255
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 50 50 SIZE 100 100
EXPECT framebuffer IDX 50 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 51 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 52 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 53 50 SIZE 1 100 EQ_RGBA 0 255 0 255
EXPECT framebuffer IDX 54 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 55 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 56 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 57 50 SIZE 1 100 EQ_RGBA 0 255 0 255
@@ -0,0 +1,56 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = texelFetch(texels, int(gl_FragCoord.x) % 4);
}
END
BUFFER texel_buffer DATA_TYPE B10G11R11_UFLOAT_PACK32 DATA
0x000003e0 # Unpacks to R = 1.0, G = 0.0, B = 0.0
0x001f0000 # Unpacks to R = 0.0, G = 1.0, B = 0.0
0x7c000000 # Unpacks to R = 0.0, G = 0.0, B = 1.0
0x7c1f0000 # Unpacks to R = 0.0, G = 1.0, B = 1.0
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 50 50 SIZE 100 100
EXPECT framebuffer IDX 50 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 51 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 52 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 53 50 SIZE 1 100 EQ_RGBA 0 255 0 255
EXPECT framebuffer IDX 54 50 SIZE 1 100 EQ_RGBA 0 0 255 255
EXPECT framebuffer IDX 55 50 SIZE 1 100 EQ_RGBA 0 255 255 255
EXPECT framebuffer IDX 56 50 SIZE 1 100 EQ_RGBA 255 0 0 255
EXPECT framebuffer IDX 57 50 SIZE 1 100 EQ_RGBA 0 255 0 255
@@ -0,0 +1,96 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = (texelFetch(texels, int(gl_FragCoord.x) % 39) + vec4(1.0)) / vec4(2.0);
color_out.a = 1;
}
END
BUFFER texel_buffer DATA_TYPE B8G8R8_SNORM DATA
0x81 0x88 0x8f 0x88 0x8f 0x96 0x8f 0x96 0x9d 0x96 0x9d 0xa4
0x9d 0xa4 0xab 0xa4 0xab 0xb2 0xab 0xb2 0xb9 0xb2 0xb9 0xc0
0xb9 0xc0 0xc7 0xc0 0xc7 0xce 0xc7 0xce 0xd5 0xce 0xd5 0xdc
0xd5 0xdc 0xe3 0xdc 0xe3 0xea 0xe3 0xea 0xf1 0xea 0xf1 0xf8
0xf1 0xf8 0xff 0xf8 0xff 0x06 0xff 0x06 0x0d 0x06 0x0d 0x14
0x0d 0x14 0x1b 0x14 0x1b 0x22 0x1b 0x22 0x29 0x22 0x29 0x30
0x29 0x30 0x37 0x30 0x37 0x3e 0x37 0x3e 0x45 0x3e 0x45 0x4c
0x45 0x4c 0x53 0x4c 0x53 0x5a 0x53 0x5a 0x61 0x5a 0x61 0x68
0x61 0x68 0x6f 0x68 0x6f 0x76 0x6f 0x76 0x7d 0x76 0x7d 0x80
0x7d 0x80 0x00 0x80 0x00 0x81 0x00 0x81 0x88
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 0 0 SIZE 100 128
EXPECT framebuffer IDX 0 0 SIZE 1 128 EQ_RGBA 0 7 14 255 TOLERANCE 1
EXPECT framebuffer IDX 1 0 SIZE 1 128 EQ_RGBA 7 14 21 255 TOLERANCE 1
EXPECT framebuffer IDX 2 0 SIZE 1 128 EQ_RGBA 14 21 28 255 TOLERANCE 1
EXPECT framebuffer IDX 3 0 SIZE 1 128 EQ_RGBA 21 28 35 255 TOLERANCE 1
EXPECT framebuffer IDX 4 0 SIZE 1 128 EQ_RGBA 28 35 42 255 TOLERANCE 1
EXPECT framebuffer IDX 5 0 SIZE 1 128 EQ_RGBA 35 42 49 255 TOLERANCE 1
EXPECT framebuffer IDX 6 0 SIZE 1 128 EQ_RGBA 42 49 56 255 TOLERANCE 1
EXPECT framebuffer IDX 7 0 SIZE 1 128 EQ_RGBA 49 56 63 255 TOLERANCE 1
EXPECT framebuffer IDX 8 0 SIZE 1 128 EQ_RGBA 56 63 70 255 TOLERANCE 1
EXPECT framebuffer IDX 9 0 SIZE 1 128 EQ_RGBA 63 70 77 255 TOLERANCE 1
EXPECT framebuffer IDX 10 0 SIZE 1 128 EQ_RGBA 70 77 84 255 TOLERANCE 1
EXPECT framebuffer IDX 11 0 SIZE 1 128 EQ_RGBA 77 84 91 255 TOLERANCE 1
EXPECT framebuffer IDX 12 0 SIZE 1 128 EQ_RGBA 84 91 98 255 TOLERANCE 1
EXPECT framebuffer IDX 13 0 SIZE 1 128 EQ_RGBA 91 98 105 255 TOLERANCE 1
EXPECT framebuffer IDX 14 0 SIZE 1 128 EQ_RGBA 98 105 112 255 TOLERANCE 1
EXPECT framebuffer IDX 15 0 SIZE 1 128 EQ_RGBA 105 112 119 255 TOLERANCE 1
EXPECT framebuffer IDX 16 0 SIZE 1 128 EQ_RGBA 112 119 126 255 TOLERANCE 1
EXPECT framebuffer IDX 17 0 SIZE 1 128 EQ_RGBA 119 126 133 255 TOLERANCE 1
EXPECT framebuffer IDX 18 0 SIZE 1 128 EQ_RGBA 126 133 140 255 TOLERANCE 1
EXPECT framebuffer IDX 19 0 SIZE 1 128 EQ_RGBA 133 140 147 255 TOLERANCE 1
EXPECT framebuffer IDX 20 0 SIZE 1 128 EQ_RGBA 140 147 154 255 TOLERANCE 1
EXPECT framebuffer IDX 21 0 SIZE 1 128 EQ_RGBA 147 154 161 255 TOLERANCE 1
EXPECT framebuffer IDX 22 0 SIZE 1 128 EQ_RGBA 154 161 168 255 TOLERANCE 1
EXPECT framebuffer IDX 23 0 SIZE 1 128 EQ_RGBA 161 168 175 255 TOLERANCE 1
EXPECT framebuffer IDX 24 0 SIZE 1 128 EQ_RGBA 168 175 182 255 TOLERANCE 1
EXPECT framebuffer IDX 25 0 SIZE 1 128 EQ_RGBA 175 182 189 255 TOLERANCE 1
EXPECT framebuffer IDX 26 0 SIZE 1 128 EQ_RGBA 182 189 196 255 TOLERANCE 1
EXPECT framebuffer IDX 27 0 SIZE 1 128 EQ_RGBA 189 196 203 255 TOLERANCE 1
EXPECT framebuffer IDX 28 0 SIZE 1 128 EQ_RGBA 196 203 210 255 TOLERANCE 1
EXPECT framebuffer IDX 29 0 SIZE 1 128 EQ_RGBA 203 210 217 255 TOLERANCE 1
EXPECT framebuffer IDX 30 0 SIZE 1 128 EQ_RGBA 210 217 224 255 TOLERANCE 1
EXPECT framebuffer IDX 31 0 SIZE 1 128 EQ_RGBA 217 224 231 255 TOLERANCE 1
EXPECT framebuffer IDX 32 0 SIZE 1 128 EQ_RGBA 224 231 238 255 TOLERANCE 1
EXPECT framebuffer IDX 33 0 SIZE 1 128 EQ_RGBA 231 238 245 255 TOLERANCE 1
EXPECT framebuffer IDX 34 0 SIZE 1 128 EQ_RGBA 238 245 252 255 TOLERANCE 1
EXPECT framebuffer IDX 35 0 SIZE 1 128 EQ_RGBA 245 252 0 255 TOLERANCE 1
EXPECT framebuffer IDX 36 0 SIZE 1 128 EQ_RGBA 252 0 127 255 TOLERANCE 1
EXPECT framebuffer IDX 37 0 SIZE 1 128 EQ_RGBA 0 127 0 255 TOLERANCE 1
EXPECT framebuffer IDX 38 0 SIZE 1 128 EQ_RGBA 127 0 7 255 TOLERANCE 1
@@ -0,0 +1,98 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = (texelFetch(texels, int(gl_FragCoord.x) % 39) + vec4(1.0)) / vec4(2.0);
}
END
BUFFER texel_buffer DATA_TYPE B8G8R8A8_SNORM DATA
0x81 0x88 0x8f 0x96 0x88 0x8f 0x96 0x9d 0x8f 0x96 0x9d 0xa4
0x96 0x9d 0xa4 0xab 0x9d 0xa4 0xab 0xb2 0xa4 0xab 0xb2 0xb9
0xab 0xb2 0xb9 0xc0 0xb2 0xb9 0xc0 0xc7 0xb9 0xc0 0xc7 0xce
0xc0 0xc7 0xce 0xd5 0xc7 0xce 0xd5 0xdc 0xce 0xd5 0xdc 0xe3
0xd5 0xdc 0xe3 0xea 0xdc 0xe3 0xea 0xf1 0xe3 0xea 0xf1 0xf8
0xea 0xf1 0xf8 0xff 0xf1 0xf8 0xff 0x06 0xf8 0xff 0x06 0x0d
0xff 0x06 0x0d 0x14 0x06 0x0d 0x14 0x1b 0x0d 0x14 0x1b 0x22
0x14 0x1b 0x22 0x29 0x1b 0x22 0x29 0x30 0x22 0x29 0x30 0x37
0x29 0x30 0x37 0x3e 0x30 0x37 0x3e 0x45 0x37 0x3e 0x45 0x4c
0x3e 0x45 0x4c 0x53 0x45 0x4c 0x53 0x5a 0x4c 0x53 0x5a 0x61
0x53 0x5a 0x61 0x68 0x5a 0x61 0x68 0x6f 0x61 0x68 0x6f 0x76
0x68 0x6f 0x76 0x7d 0x6f 0x76 0x7d 0x80 0x76 0x7d 0x80 0x00
0x7d 0x80 0x00 0x81 0x80 0x00 0x81 0x88 0x00 0x81 0x88 0x8f
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 0 0 SIZE 100 128
EXPECT framebuffer IDX 0 0 SIZE 1 128 EQ_RGBA 0 7 14 21 TOLERANCE 1
EXPECT framebuffer IDX 1 0 SIZE 1 128 EQ_RGBA 7 14 21 28 TOLERANCE 1
EXPECT framebuffer IDX 2 0 SIZE 1 128 EQ_RGBA 14 21 28 35 TOLERANCE 1
EXPECT framebuffer IDX 3 0 SIZE 1 128 EQ_RGBA 21 28 35 42 TOLERANCE 1
EXPECT framebuffer IDX 4 0 SIZE 1 128 EQ_RGBA 28 35 42 49 TOLERANCE 1
EXPECT framebuffer IDX 5 0 SIZE 1 128 EQ_RGBA 35 42 49 56 TOLERANCE 1
EXPECT framebuffer IDX 6 0 SIZE 1 128 EQ_RGBA 42 49 56 63 TOLERANCE 1
EXPECT framebuffer IDX 7 0 SIZE 1 128 EQ_RGBA 49 56 63 70 TOLERANCE 1
EXPECT framebuffer IDX 8 0 SIZE 1 128 EQ_RGBA 56 63 70 77 TOLERANCE 1
EXPECT framebuffer IDX 9 0 SIZE 1 128 EQ_RGBA 63 70 77 84 TOLERANCE 1
EXPECT framebuffer IDX 10 0 SIZE 1 128 EQ_RGBA 70 77 84 91 TOLERANCE 1
EXPECT framebuffer IDX 11 0 SIZE 1 128 EQ_RGBA 77 84 91 98 TOLERANCE 1
EXPECT framebuffer IDX 12 0 SIZE 1 128 EQ_RGBA 84 91 98 105 TOLERANCE 1
EXPECT framebuffer IDX 13 0 SIZE 1 128 EQ_RGBA 91 98 105 112 TOLERANCE 1
EXPECT framebuffer IDX 14 0 SIZE 1 128 EQ_RGBA 98 105 112 119 TOLERANCE 1
EXPECT framebuffer IDX 15 0 SIZE 1 128 EQ_RGBA 105 112 119 126 TOLERANCE 1
EXPECT framebuffer IDX 16 0 SIZE 1 128 EQ_RGBA 112 119 126 133 TOLERANCE 1
EXPECT framebuffer IDX 17 0 SIZE 1 128 EQ_RGBA 119 126 133 140 TOLERANCE 1
EXPECT framebuffer IDX 18 0 SIZE 1 128 EQ_RGBA 126 133 140 147 TOLERANCE 1
EXPECT framebuffer IDX 19 0 SIZE 1 128 EQ_RGBA 133 140 147 154 TOLERANCE 1
EXPECT framebuffer IDX 20 0 SIZE 1 128 EQ_RGBA 140 147 154 161 TOLERANCE 1
EXPECT framebuffer IDX 21 0 SIZE 1 128 EQ_RGBA 147 154 161 168 TOLERANCE 1
EXPECT framebuffer IDX 22 0 SIZE 1 128 EQ_RGBA 154 161 168 175 TOLERANCE 1
EXPECT framebuffer IDX 23 0 SIZE 1 128 EQ_RGBA 161 168 175 182 TOLERANCE 1
EXPECT framebuffer IDX 24 0 SIZE 1 128 EQ_RGBA 168 175 182 189 TOLERANCE 1
EXPECT framebuffer IDX 25 0 SIZE 1 128 EQ_RGBA 175 182 189 196 TOLERANCE 1
EXPECT framebuffer IDX 26 0 SIZE 1 128 EQ_RGBA 182 189 196 203 TOLERANCE 1
EXPECT framebuffer IDX 27 0 SIZE 1 128 EQ_RGBA 189 196 203 210 TOLERANCE 1
EXPECT framebuffer IDX 28 0 SIZE 1 128 EQ_RGBA 196 203 210 217 TOLERANCE 1
EXPECT framebuffer IDX 29 0 SIZE 1 128 EQ_RGBA 203 210 217 224 TOLERANCE 1
EXPECT framebuffer IDX 30 0 SIZE 1 128 EQ_RGBA 210 217 224 231 TOLERANCE 1
EXPECT framebuffer IDX 31 0 SIZE 1 128 EQ_RGBA 217 224 231 238 TOLERANCE 1
EXPECT framebuffer IDX 32 0 SIZE 1 128 EQ_RGBA 224 231 238 245 TOLERANCE 1
EXPECT framebuffer IDX 33 0 SIZE 1 128 EQ_RGBA 231 238 245 252 TOLERANCE 1
EXPECT framebuffer IDX 34 0 SIZE 1 128 EQ_RGBA 238 245 252 0 TOLERANCE 1
EXPECT framebuffer IDX 35 0 SIZE 1 128 EQ_RGBA 245 252 0 127 TOLERANCE 1
EXPECT framebuffer IDX 36 0 SIZE 1 128 EQ_RGBA 252 0 127 0 TOLERANCE 1
EXPECT framebuffer IDX 37 0 SIZE 1 128 EQ_RGBA 0 127 0 7 TOLERANCE 1
EXPECT framebuffer IDX 38 0 SIZE 1 128 EQ_RGBA 127 0 7 14 TOLERANCE 1
@@ -0,0 +1,88 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = (texelFetch(texels, int(gl_FragCoord.x) % 35) + vec4(1.0)) / vec4(2.0);
color_out.g = 0;
color_out.b = 0;
color_out.a = 1;
}
END
BUFFER texel_buffer DATA_TYPE R16_SNORM DATA
0x8001 0x8800 0x8fff 0x97fe 0x9ffd 0xa7fc 0xaffb 0xb7fa 0xbff9 0xc7f8
0xcff7 0xd7f6 0xdff5 0xe7f4 0xeff3 0xf7f2 0xfff1 0x07f0 0x0fef 0x17ee
0x1fed 0x27ec 0x2feb 0x37ea 0x3fe9 0x47e8 0x4fe7 0x57e6 0x5fe5 0x67e4
0x6fe3 0x77e2 0x7fe1 0x8000 0x0000
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 0 0 SIZE 100 128
EXPECT framebuffer IDX 0 0 SIZE 1 128 EQ_RGBA 0 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 1 0 SIZE 1 128 EQ_RGBA 7 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 2 0 SIZE 1 128 EQ_RGBA 15 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 3 0 SIZE 1 128 EQ_RGBA 23 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 4 0 SIZE 1 128 EQ_RGBA 31 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 5 0 SIZE 1 128 EQ_RGBA 39 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 6 0 SIZE 1 128 EQ_RGBA 47 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 7 0 SIZE 1 128 EQ_RGBA 55 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 8 0 SIZE 1 128 EQ_RGBA 63 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 9 0 SIZE 1 128 EQ_RGBA 71 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 10 0 SIZE 1 128 EQ_RGBA 79 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 11 0 SIZE 1 128 EQ_RGBA 87 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 12 0 SIZE 1 128 EQ_RGBA 95 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 13 0 SIZE 1 128 EQ_RGBA 103 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 14 0 SIZE 1 128 EQ_RGBA 111 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 15 0 SIZE 1 128 EQ_RGBA 119 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 16 0 SIZE 1 128 EQ_RGBA 127 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 17 0 SIZE 1 128 EQ_RGBA 135 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 18 0 SIZE 1 128 EQ_RGBA 143 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 19 0 SIZE 1 128 EQ_RGBA 151 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 20 0 SIZE 1 128 EQ_RGBA 159 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 21 0 SIZE 1 128 EQ_RGBA 167 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 22 0 SIZE 1 128 EQ_RGBA 175 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 23 0 SIZE 1 128 EQ_RGBA 183 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 24 0 SIZE 1 128 EQ_RGBA 191 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 25 0 SIZE 1 128 EQ_RGBA 199 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 26 0 SIZE 1 128 EQ_RGBA 207 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 27 0 SIZE 1 128 EQ_RGBA 215 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 28 0 SIZE 1 128 EQ_RGBA 223 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 29 0 SIZE 1 128 EQ_RGBA 230 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 30 0 SIZE 1 128 EQ_RGBA 238 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 31 0 SIZE 1 128 EQ_RGBA 246 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 32 0 SIZE 1 128 EQ_RGBA 254 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 33 0 SIZE 1 128 EQ_RGBA 0 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 34 0 SIZE 1 128 EQ_RGBA 127 0 0 255 TOLERANCE 1
@@ -0,0 +1,90 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = (texelFetch(texels, int(gl_FragCoord.x) % 35) + vec4(1.0)) / vec4(2.0);
color_out.b = 0;
color_out.a = 1;
}
END
BUFFER texel_buffer DATA_TYPE R16G16_SNORM DATA
0x8001 0x8800 0x8800 0x8fff 0x8fff 0x97fe 0x97fe 0x9ffd 0x9ffd 0xa7fc
0xa7fc 0xaffb 0xaffb 0xb7fa 0xb7fa 0xbff9 0xbff9 0xc7f8 0xc7f8 0xcff7
0xcff7 0xd7f6 0xd7f6 0xdff5 0xdff5 0xe7f4 0xe7f4 0xeff3 0xeff3 0xf7f2
0xf7f2 0xfff1 0xfff1 0x07f0 0x07f0 0x0fef 0x0fef 0x17ee 0x17ee 0x1fed
0x1fed 0x27ec 0x27ec 0x2feb 0x2feb 0x37ea 0x37ea 0x3fe9 0x3fe9 0x47e8
0x47e8 0x4fe7 0x4fe7 0x57e6 0x57e6 0x5fe5 0x5fe5 0x67e4 0x67e4 0x6fe3
0x6fe3 0x77e2 0x77e2 0x7fe1 0x7fe1 0x8000 0x8000 0x0000 0x0000 0x8001
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 0 0 SIZE 100 128
EXPECT framebuffer IDX 0 0 SIZE 1 128 EQ_RGBA 0 7 0 255 TOLERANCE 1
EXPECT framebuffer IDX 1 0 SIZE 1 128 EQ_RGBA 7 15 0 255 TOLERANCE 1
EXPECT framebuffer IDX 2 0 SIZE 1 128 EQ_RGBA 15 23 0 255 TOLERANCE 1
EXPECT framebuffer IDX 3 0 SIZE 1 128 EQ_RGBA 23 31 0 255 TOLERANCE 1
EXPECT framebuffer IDX 4 0 SIZE 1 128 EQ_RGBA 31 39 0 255 TOLERANCE 1
EXPECT framebuffer IDX 5 0 SIZE 1 128 EQ_RGBA 39 47 0 255 TOLERANCE 1
EXPECT framebuffer IDX 6 0 SIZE 1 128 EQ_RGBA 47 55 0 255 TOLERANCE 1
EXPECT framebuffer IDX 7 0 SIZE 1 128 EQ_RGBA 55 63 0 255 TOLERANCE 1
EXPECT framebuffer IDX 8 0 SIZE 1 128 EQ_RGBA 63 71 0 255 TOLERANCE 1
EXPECT framebuffer IDX 9 0 SIZE 1 128 EQ_RGBA 71 79 0 255 TOLERANCE 1
EXPECT framebuffer IDX 10 0 SIZE 1 128 EQ_RGBA 79 87 0 255 TOLERANCE 1
EXPECT framebuffer IDX 11 0 SIZE 1 128 EQ_RGBA 87 95 0 255 TOLERANCE 1
EXPECT framebuffer IDX 12 0 SIZE 1 128 EQ_RGBA 95 103 0 255 TOLERANCE 1
EXPECT framebuffer IDX 13 0 SIZE 1 128 EQ_RGBA 103 111 0 255 TOLERANCE 1
EXPECT framebuffer IDX 14 0 SIZE 1 128 EQ_RGBA 111 119 0 255 TOLERANCE 1
EXPECT framebuffer IDX 15 0 SIZE 1 128 EQ_RGBA 119 127 0 255 TOLERANCE 1
EXPECT framebuffer IDX 16 0 SIZE 1 128 EQ_RGBA 127 135 0 255 TOLERANCE 1
EXPECT framebuffer IDX 17 0 SIZE 1 128 EQ_RGBA 135 143 0 255 TOLERANCE 1
EXPECT framebuffer IDX 18 0 SIZE 1 128 EQ_RGBA 143 151 0 255 TOLERANCE 1
EXPECT framebuffer IDX 19 0 SIZE 1 128 EQ_RGBA 151 159 0 255 TOLERANCE 1
EXPECT framebuffer IDX 20 0 SIZE 1 128 EQ_RGBA 159 167 0 255 TOLERANCE 1
EXPECT framebuffer IDX 21 0 SIZE 1 128 EQ_RGBA 167 175 0 255 TOLERANCE 1
EXPECT framebuffer IDX 22 0 SIZE 1 128 EQ_RGBA 175 183 0 255 TOLERANCE 1
EXPECT framebuffer IDX 23 0 SIZE 1 128 EQ_RGBA 183 191 0 255 TOLERANCE 1
EXPECT framebuffer IDX 24 0 SIZE 1 128 EQ_RGBA 191 199 0 255 TOLERANCE 1
EXPECT framebuffer IDX 25 0 SIZE 1 128 EQ_RGBA 199 207 0 255 TOLERANCE 1
EXPECT framebuffer IDX 26 0 SIZE 1 128 EQ_RGBA 207 215 0 255 TOLERANCE 1
EXPECT framebuffer IDX 27 0 SIZE 1 128 EQ_RGBA 215 223 0 255 TOLERANCE 1
EXPECT framebuffer IDX 28 0 SIZE 1 128 EQ_RGBA 223 230 0 255 TOLERANCE 1
EXPECT framebuffer IDX 29 0 SIZE 1 128 EQ_RGBA 230 238 0 255 TOLERANCE 1
EXPECT framebuffer IDX 30 0 SIZE 1 128 EQ_RGBA 238 246 0 255 TOLERANCE 1
EXPECT framebuffer IDX 31 0 SIZE 1 128 EQ_RGBA 246 254 0 255 TOLERANCE 1
EXPECT framebuffer IDX 32 0 SIZE 1 128 EQ_RGBA 254 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 33 0 SIZE 1 128 EQ_RGBA 0 127 0 255 TOLERANCE 1
EXPECT framebuffer IDX 34 0 SIZE 1 128 EQ_RGBA 127 0 0 255 TOLERANCE 1
@@ -0,0 +1,91 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = (texelFetch(texels, int(gl_FragCoord.x) % 35) + vec4(1.0)) / vec4(2.0);
color_out.a = 1;
}
END
BUFFER texel_buffer DATA_TYPE R16G16B16_SNORM DATA
0x8001 0x8800 0x8fff 0x8800 0x8fff 0x97fe 0x8fff 0x97fe 0x9ffd 0x97fe 0x9ffd 0xa7fc
0x9ffd 0xa7fc 0xaffb 0xa7fc 0xaffb 0xb7fa 0xaffb 0xb7fa 0xbff9 0xb7fa 0xbff9 0xc7f8
0xbff9 0xc7f8 0xcff7 0xc7f8 0xcff7 0xd7f6 0xcff7 0xd7f6 0xdff5 0xd7f6 0xdff5 0xe7f4
0xdff5 0xe7f4 0xeff3 0xe7f4 0xeff3 0xf7f2 0xeff3 0xf7f2 0xfff1 0xf7f2 0xfff1 0x07f0
0xfff1 0x07f0 0x0fef 0x07f0 0x0fef 0x17ee 0x0fef 0x17ee 0x1fed 0x17ee 0x1fed 0x27ec
0x1fed 0x27ec 0x2feb 0x27ec 0x2feb 0x37ea 0x2feb 0x37ea 0x3fe9 0x37ea 0x3fe9 0x47e8
0x3fe9 0x47e8 0x4fe7 0x47e8 0x4fe7 0x57e6 0x4fe7 0x57e6 0x5fe5 0x57e6 0x5fe5 0x67e4
0x5fe5 0x67e4 0x6fe3 0x67e4 0x6fe3 0x77e2 0x6fe3 0x77e2 0x7fe1 0x77e2 0x7fe1 0x8000
0x7fe1 0x8000 0x0000 0x8000 0x0000 0x8001 0x0000 0x8001 0x8800
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 0 0 SIZE 100 128
EXPECT framebuffer IDX 0 0 SIZE 1 128 EQ_RGBA 0 7 15 255 TOLERANCE 1
EXPECT framebuffer IDX 1 0 SIZE 1 128 EQ_RGBA 7 15 23 255 TOLERANCE 1
EXPECT framebuffer IDX 2 0 SIZE 1 128 EQ_RGBA 15 23 31 255 TOLERANCE 1
EXPECT framebuffer IDX 3 0 SIZE 1 128 EQ_RGBA 23 31 39 255 TOLERANCE 1
EXPECT framebuffer IDX 4 0 SIZE 1 128 EQ_RGBA 31 39 47 255 TOLERANCE 1
EXPECT framebuffer IDX 5 0 SIZE 1 128 EQ_RGBA 39 47 55 255 TOLERANCE 1
EXPECT framebuffer IDX 6 0 SIZE 1 128 EQ_RGBA 47 55 63 255 TOLERANCE 1
EXPECT framebuffer IDX 7 0 SIZE 1 128 EQ_RGBA 55 63 71 255 TOLERANCE 1
EXPECT framebuffer IDX 8 0 SIZE 1 128 EQ_RGBA 63 71 79 255 TOLERANCE 1
EXPECT framebuffer IDX 9 0 SIZE 1 128 EQ_RGBA 71 79 87 255 TOLERANCE 1
EXPECT framebuffer IDX 10 0 SIZE 1 128 EQ_RGBA 79 87 95 255 TOLERANCE 1
EXPECT framebuffer IDX 11 0 SIZE 1 128 EQ_RGBA 87 95 103 255 TOLERANCE 1
EXPECT framebuffer IDX 12 0 SIZE 1 128 EQ_RGBA 95 103 111 255 TOLERANCE 1
EXPECT framebuffer IDX 13 0 SIZE 1 128 EQ_RGBA 103 111 119 255 TOLERANCE 1
EXPECT framebuffer IDX 14 0 SIZE 1 128 EQ_RGBA 111 119 127 255 TOLERANCE 1
EXPECT framebuffer IDX 15 0 SIZE 1 128 EQ_RGBA 119 127 135 255 TOLERANCE 1
EXPECT framebuffer IDX 16 0 SIZE 1 128 EQ_RGBA 127 135 143 255 TOLERANCE 1
EXPECT framebuffer IDX 17 0 SIZE 1 128 EQ_RGBA 135 143 151 255 TOLERANCE 1
EXPECT framebuffer IDX 18 0 SIZE 1 128 EQ_RGBA 143 151 159 255 TOLERANCE 1
EXPECT framebuffer IDX 19 0 SIZE 1 128 EQ_RGBA 151 159 167 255 TOLERANCE 1
EXPECT framebuffer IDX 20 0 SIZE 1 128 EQ_RGBA 159 167 175 255 TOLERANCE 1
EXPECT framebuffer IDX 21 0 SIZE 1 128 EQ_RGBA 167 175 183 255 TOLERANCE 1
EXPECT framebuffer IDX 22 0 SIZE 1 128 EQ_RGBA 175 183 191 255 TOLERANCE 1
EXPECT framebuffer IDX 23 0 SIZE 1 128 EQ_RGBA 183 191 199 255 TOLERANCE 1
EXPECT framebuffer IDX 24 0 SIZE 1 128 EQ_RGBA 191 199 207 255 TOLERANCE 1
EXPECT framebuffer IDX 25 0 SIZE 1 128 EQ_RGBA 199 207 215 255 TOLERANCE 1
EXPECT framebuffer IDX 26 0 SIZE 1 128 EQ_RGBA 207 215 223 255 TOLERANCE 1
EXPECT framebuffer IDX 27 0 SIZE 1 128 EQ_RGBA 215 223 230 255 TOLERANCE 1
EXPECT framebuffer IDX 28 0 SIZE 1 128 EQ_RGBA 223 230 238 255 TOLERANCE 1
EXPECT framebuffer IDX 29 0 SIZE 1 128 EQ_RGBA 230 238 246 255 TOLERANCE 1
EXPECT framebuffer IDX 30 0 SIZE 1 128 EQ_RGBA 238 246 254 255 TOLERANCE 1
EXPECT framebuffer IDX 31 0 SIZE 1 128 EQ_RGBA 246 254 0 255 TOLERANCE 1
EXPECT framebuffer IDX 32 0 SIZE 1 128 EQ_RGBA 254 0 127 255 TOLERANCE 1
EXPECT framebuffer IDX 33 0 SIZE 1 128 EQ_RGBA 0 127 0 255 TOLERANCE 1
EXPECT framebuffer IDX 34 0 SIZE 1 128 EQ_RGBA 127 0 7 255 TOLERANCE 1
@@ -0,0 +1,93 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = (texelFetch(texels, int(gl_FragCoord.x) % 35) + vec4(1.0)) / vec4(2.0);
}
END
BUFFER texel_buffer DATA_TYPE R16G16B16A16_SNORM DATA
0x8001 0x8800 0x8fff 0x97fe 0x8800 0x8fff 0x97fe 0x9ffd 0x8fff 0x97fe 0x9ffd 0xa7fc
0x97fe 0x9ffd 0xa7fc 0xaffb 0x9ffd 0xa7fc 0xaffb 0xb7fa 0xa7fc 0xaffb 0xb7fa 0xbff9
0xaffb 0xb7fa 0xbff9 0xc7f8 0xb7fa 0xbff9 0xc7f8 0xcff7 0xbff9 0xc7f8 0xcff7 0xd7f6
0xc7f8 0xcff7 0xd7f6 0xdff5 0xcff7 0xd7f6 0xdff5 0xe7f4 0xd7f6 0xdff5 0xe7f4 0xeff3
0xdff5 0xe7f4 0xeff3 0xf7f2 0xe7f4 0xeff3 0xf7f2 0xfff1 0xeff3 0xf7f2 0xfff1 0x07f0
0xf7f2 0xfff1 0x07f0 0x0fef 0xfff1 0x07f0 0x0fef 0x17ee 0x07f0 0x0fef 0x17ee 0x1fed
0x0fef 0x17ee 0x1fed 0x27ec 0x17ee 0x1fed 0x27ec 0x2feb 0x1fed 0x27ec 0x2feb 0x37ea
0x27ec 0x2feb 0x37ea 0x3fe9 0x2feb 0x37ea 0x3fe9 0x47e8 0x37ea 0x3fe9 0x47e8 0x4fe7
0x3fe9 0x47e8 0x4fe7 0x57e6 0x47e8 0x4fe7 0x57e6 0x5fe5 0x4fe7 0x57e6 0x5fe5 0x67e4
0x57e6 0x5fe5 0x67e4 0x6fe3 0x5fe5 0x67e4 0x6fe3 0x77e2 0x67e4 0x6fe3 0x77e2 0x7fe1
0x6fe3 0x77e2 0x7fe1 0x8000 0x77e2 0x7fe1 0x8000 0x0000 0x7fe1 0x8000 0x0000 0x8001
0x8000 0x0000 0x8001 0x8800 0x0000 0x8001 0x8800 0x8fff
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 0 0 SIZE 100 128
EXPECT framebuffer IDX 0 0 SIZE 1 128 EQ_RGBA 0 7 15 23 TOLERANCE 1
EXPECT framebuffer IDX 1 0 SIZE 1 128 EQ_RGBA 7 15 23 31 TOLERANCE 1
EXPECT framebuffer IDX 2 0 SIZE 1 128 EQ_RGBA 15 23 31 39 TOLERANCE 1
EXPECT framebuffer IDX 3 0 SIZE 1 128 EQ_RGBA 23 31 39 47 TOLERANCE 1
EXPECT framebuffer IDX 4 0 SIZE 1 128 EQ_RGBA 31 39 47 55 TOLERANCE 1
EXPECT framebuffer IDX 5 0 SIZE 1 128 EQ_RGBA 39 47 55 63 TOLERANCE 1
EXPECT framebuffer IDX 6 0 SIZE 1 128 EQ_RGBA 47 55 63 71 TOLERANCE 1
EXPECT framebuffer IDX 7 0 SIZE 1 128 EQ_RGBA 55 63 71 79 TOLERANCE 1
EXPECT framebuffer IDX 8 0 SIZE 1 128 EQ_RGBA 63 71 79 87 TOLERANCE 1
EXPECT framebuffer IDX 9 0 SIZE 1 128 EQ_RGBA 71 79 87 95 TOLERANCE 1
EXPECT framebuffer IDX 10 0 SIZE 1 128 EQ_RGBA 79 87 95 103 TOLERANCE 1
EXPECT framebuffer IDX 11 0 SIZE 1 128 EQ_RGBA 87 95 103 111 TOLERANCE 1
EXPECT framebuffer IDX 12 0 SIZE 1 128 EQ_RGBA 95 103 111 119 TOLERANCE 1
EXPECT framebuffer IDX 13 0 SIZE 1 128 EQ_RGBA 103 111 119 127 TOLERANCE 1
EXPECT framebuffer IDX 14 0 SIZE 1 128 EQ_RGBA 111 119 127 135 TOLERANCE 1
EXPECT framebuffer IDX 15 0 SIZE 1 128 EQ_RGBA 119 127 135 143 TOLERANCE 1
EXPECT framebuffer IDX 16 0 SIZE 1 128 EQ_RGBA 127 135 143 151 TOLERANCE 1
EXPECT framebuffer IDX 17 0 SIZE 1 128 EQ_RGBA 135 143 151 159 TOLERANCE 1
EXPECT framebuffer IDX 18 0 SIZE 1 128 EQ_RGBA 143 151 159 167 TOLERANCE 1
EXPECT framebuffer IDX 19 0 SIZE 1 128 EQ_RGBA 151 159 167 175 TOLERANCE 1
EXPECT framebuffer IDX 20 0 SIZE 1 128 EQ_RGBA 159 167 175 183 TOLERANCE 1
EXPECT framebuffer IDX 21 0 SIZE 1 128 EQ_RGBA 167 175 183 191 TOLERANCE 1
EXPECT framebuffer IDX 22 0 SIZE 1 128 EQ_RGBA 175 183 191 199 TOLERANCE 1
EXPECT framebuffer IDX 23 0 SIZE 1 128 EQ_RGBA 183 191 199 207 TOLERANCE 1
EXPECT framebuffer IDX 24 0 SIZE 1 128 EQ_RGBA 191 199 207 215 TOLERANCE 1
EXPECT framebuffer IDX 25 0 SIZE 1 128 EQ_RGBA 199 207 215 223 TOLERANCE 1
EXPECT framebuffer IDX 26 0 SIZE 1 128 EQ_RGBA 207 215 223 230 TOLERANCE 1
EXPECT framebuffer IDX 27 0 SIZE 1 128 EQ_RGBA 215 223 230 238 TOLERANCE 1
EXPECT framebuffer IDX 28 0 SIZE 1 128 EQ_RGBA 223 230 238 246 TOLERANCE 1
EXPECT framebuffer IDX 29 0 SIZE 1 128 EQ_RGBA 230 238 246 254 TOLERANCE 1
EXPECT framebuffer IDX 30 0 SIZE 1 128 EQ_RGBA 238 246 254 0 TOLERANCE 1
EXPECT framebuffer IDX 31 0 SIZE 1 128 EQ_RGBA 246 254 0 127 TOLERANCE 1
EXPECT framebuffer IDX 32 0 SIZE 1 128 EQ_RGBA 254 0 127 0 TOLERANCE 1
EXPECT framebuffer IDX 33 0 SIZE 1 128 EQ_RGBA 0 127 0 7 TOLERANCE 1
EXPECT framebuffer IDX 34 0 SIZE 1 128 EQ_RGBA 127 0 7 15 TOLERANCE 1
@@ -0,0 +1,92 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = (texelFetch(texels, int(gl_FragCoord.x) % 39) + vec4(1.0)) / vec4(2.0);
color_out.g = 0;
color_out.b = 0;
color_out.a = 1;
}
END
BUFFER texel_buffer DATA_TYPE R8_SNORM DATA
0x81 0x88 0x8f 0x96 0x9d 0xa4 0xab 0xb2 0xb9 0xc0
0xc7 0xce 0xd5 0xdc 0xe3 0xea 0xf1 0xf8 0xff 0x06
0x0d 0x14 0x1b 0x22 0x29 0x30 0x37 0x3e 0x45 0x4c
0x53 0x5a 0x61 0x68 0x6f 0x76 0x7d 0x80 0x00
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 0 0 SIZE 100 128
EXPECT framebuffer IDX 0 0 SIZE 1 128 EQ_RGBA 0 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 1 0 SIZE 1 128 EQ_RGBA 7 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 2 0 SIZE 1 128 EQ_RGBA 14 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 3 0 SIZE 1 128 EQ_RGBA 21 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 4 0 SIZE 1 128 EQ_RGBA 28 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 5 0 SIZE 1 128 EQ_RGBA 35 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 6 0 SIZE 1 128 EQ_RGBA 42 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 7 0 SIZE 1 128 EQ_RGBA 49 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 8 0 SIZE 1 128 EQ_RGBA 56 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 9 0 SIZE 1 128 EQ_RGBA 63 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 10 0 SIZE 1 128 EQ_RGBA 70 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 11 0 SIZE 1 128 EQ_RGBA 77 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 12 0 SIZE 1 128 EQ_RGBA 84 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 13 0 SIZE 1 128 EQ_RGBA 91 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 14 0 SIZE 1 128 EQ_RGBA 98 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 15 0 SIZE 1 128 EQ_RGBA 105 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 16 0 SIZE 1 128 EQ_RGBA 112 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 17 0 SIZE 1 128 EQ_RGBA 119 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 18 0 SIZE 1 128 EQ_RGBA 126 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 19 0 SIZE 1 128 EQ_RGBA 133 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 20 0 SIZE 1 128 EQ_RGBA 140 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 21 0 SIZE 1 128 EQ_RGBA 147 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 22 0 SIZE 1 128 EQ_RGBA 154 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 23 0 SIZE 1 128 EQ_RGBA 161 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 24 0 SIZE 1 128 EQ_RGBA 168 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 25 0 SIZE 1 128 EQ_RGBA 175 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 26 0 SIZE 1 128 EQ_RGBA 182 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 27 0 SIZE 1 128 EQ_RGBA 189 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 28 0 SIZE 1 128 EQ_RGBA 196 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 29 0 SIZE 1 128 EQ_RGBA 203 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 30 0 SIZE 1 128 EQ_RGBA 210 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 31 0 SIZE 1 128 EQ_RGBA 217 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 32 0 SIZE 1 128 EQ_RGBA 224 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 33 0 SIZE 1 128 EQ_RGBA 231 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 34 0 SIZE 1 128 EQ_RGBA 238 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 35 0 SIZE 1 128 EQ_RGBA 245 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 36 0 SIZE 1 128 EQ_RGBA 252 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 37 0 SIZE 1 128 EQ_RGBA 0 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 38 0 SIZE 1 128 EQ_RGBA 127 0 0 255 TOLERANCE 1
@@ -0,0 +1,95 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = (texelFetch(texels, int(gl_FragCoord.x) % 39) + vec4(1.0)) / vec4(2.0);
color_out.b = 0;
color_out.a = 1;
}
END
BUFFER texel_buffer DATA_TYPE R8G8_SNORM DATA
0x81 0x88 0x88 0x8f 0x8f 0x96 0x96 0x9d 0x9d 0xa4
0xa4 0xab 0xab 0xb2 0xb2 0xb9 0xb9 0xc0 0xc0 0xc7
0xc7 0xce 0xce 0xd5 0xd5 0xdc 0xdc 0xe3 0xe3 0xea
0xea 0xf1 0xf1 0xf8 0xf8 0xff 0xff 0x06 0x06 0x0d
0x0d 0x14 0x14 0x1b 0x1b 0x22 0x22 0x29 0x29 0x30
0x30 0x37 0x37 0x3e 0x3e 0x45 0x45 0x4c 0x4c 0x53
0x53 0x5a 0x5a 0x61 0x61 0x68 0x68 0x6f 0x6f 0x76
0x76 0x7d 0x7d 0x80 0x80 0x00 0x00 0x81
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 0 0 SIZE 100 128
EXPECT framebuffer IDX 0 0 SIZE 1 128 EQ_RGBA 0 7 0 255 TOLERANCE 1
EXPECT framebuffer IDX 1 0 SIZE 1 128 EQ_RGBA 7 14 0 255 TOLERANCE 1
EXPECT framebuffer IDX 2 0 SIZE 1 128 EQ_RGBA 14 21 0 255 TOLERANCE 1
EXPECT framebuffer IDX 3 0 SIZE 1 128 EQ_RGBA 21 28 0 255 TOLERANCE 1
EXPECT framebuffer IDX 4 0 SIZE 1 128 EQ_RGBA 28 35 0 255 TOLERANCE 1
EXPECT framebuffer IDX 5 0 SIZE 1 128 EQ_RGBA 35 42 0 255 TOLERANCE 1
EXPECT framebuffer IDX 6 0 SIZE 1 128 EQ_RGBA 42 49 0 255 TOLERANCE 1
EXPECT framebuffer IDX 7 0 SIZE 1 128 EQ_RGBA 49 56 0 255 TOLERANCE 1
EXPECT framebuffer IDX 8 0 SIZE 1 128 EQ_RGBA 56 63 0 255 TOLERANCE 1
EXPECT framebuffer IDX 9 0 SIZE 1 128 EQ_RGBA 63 70 0 255 TOLERANCE 1
EXPECT framebuffer IDX 10 0 SIZE 1 128 EQ_RGBA 70 77 0 255 TOLERANCE 1
EXPECT framebuffer IDX 11 0 SIZE 1 128 EQ_RGBA 77 84 0 255 TOLERANCE 1
EXPECT framebuffer IDX 12 0 SIZE 1 128 EQ_RGBA 84 91 0 255 TOLERANCE 1
EXPECT framebuffer IDX 13 0 SIZE 1 128 EQ_RGBA 91 98 0 255 TOLERANCE 1
EXPECT framebuffer IDX 14 0 SIZE 1 128 EQ_RGBA 98 105 0 255 TOLERANCE 1
EXPECT framebuffer IDX 15 0 SIZE 1 128 EQ_RGBA 105 112 0 255 TOLERANCE 1
EXPECT framebuffer IDX 16 0 SIZE 1 128 EQ_RGBA 112 119 0 255 TOLERANCE 1
EXPECT framebuffer IDX 17 0 SIZE 1 128 EQ_RGBA 119 126 0 255 TOLERANCE 1
EXPECT framebuffer IDX 18 0 SIZE 1 128 EQ_RGBA 126 133 0 255 TOLERANCE 1
EXPECT framebuffer IDX 19 0 SIZE 1 128 EQ_RGBA 133 140 0 255 TOLERANCE 1
EXPECT framebuffer IDX 20 0 SIZE 1 128 EQ_RGBA 140 147 0 255 TOLERANCE 1
EXPECT framebuffer IDX 21 0 SIZE 1 128 EQ_RGBA 147 154 0 255 TOLERANCE 1
EXPECT framebuffer IDX 22 0 SIZE 1 128 EQ_RGBA 154 161 0 255 TOLERANCE 1
EXPECT framebuffer IDX 23 0 SIZE 1 128 EQ_RGBA 161 168 0 255 TOLERANCE 1
EXPECT framebuffer IDX 24 0 SIZE 1 128 EQ_RGBA 168 175 0 255 TOLERANCE 1
EXPECT framebuffer IDX 25 0 SIZE 1 128 EQ_RGBA 175 182 0 255 TOLERANCE 1
EXPECT framebuffer IDX 26 0 SIZE 1 128 EQ_RGBA 182 189 0 255 TOLERANCE 1
EXPECT framebuffer IDX 27 0 SIZE 1 128 EQ_RGBA 189 196 0 255 TOLERANCE 1
EXPECT framebuffer IDX 28 0 SIZE 1 128 EQ_RGBA 196 203 0 255 TOLERANCE 1
EXPECT framebuffer IDX 29 0 SIZE 1 128 EQ_RGBA 203 210 0 255 TOLERANCE 1
EXPECT framebuffer IDX 30 0 SIZE 1 128 EQ_RGBA 210 217 0 255 TOLERANCE 1
EXPECT framebuffer IDX 31 0 SIZE 1 128 EQ_RGBA 217 224 0 255 TOLERANCE 1
EXPECT framebuffer IDX 32 0 SIZE 1 128 EQ_RGBA 224 231 0 255 TOLERANCE 1
EXPECT framebuffer IDX 33 0 SIZE 1 128 EQ_RGBA 231 238 0 255 TOLERANCE 1
EXPECT framebuffer IDX 34 0 SIZE 1 128 EQ_RGBA 238 245 0 255 TOLERANCE 1
EXPECT framebuffer IDX 35 0 SIZE 1 128 EQ_RGBA 245 252 0 255 TOLERANCE 1
EXPECT framebuffer IDX 36 0 SIZE 1 128 EQ_RGBA 252 0 0 255 TOLERANCE 1
EXPECT framebuffer IDX 37 0 SIZE 1 128 EQ_RGBA 0 127 0 255 TOLERANCE 1
EXPECT framebuffer IDX 38 0 SIZE 1 128 EQ_RGBA 127 0 0 255 TOLERANCE 1
@@ -0,0 +1,96 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = (texelFetch(texels, int(gl_FragCoord.x) % 39) + vec4(1.0)) / vec4(2.0);
color_out.a = 1;
}
END
BUFFER texel_buffer DATA_TYPE R8G8B8_SNORM DATA
0x81 0x88 0x8f 0x88 0x8f 0x96 0x8f 0x96 0x9d 0x96 0x9d 0xa4
0x9d 0xa4 0xab 0xa4 0xab 0xb2 0xab 0xb2 0xb9 0xb2 0xb9 0xc0
0xb9 0xc0 0xc7 0xc0 0xc7 0xce 0xc7 0xce 0xd5 0xce 0xd5 0xdc
0xd5 0xdc 0xe3 0xdc 0xe3 0xea 0xe3 0xea 0xf1 0xea 0xf1 0xf8
0xf1 0xf8 0xff 0xf8 0xff 0x06 0xff 0x06 0x0d 0x06 0x0d 0x14
0x0d 0x14 0x1b 0x14 0x1b 0x22 0x1b 0x22 0x29 0x22 0x29 0x30
0x29 0x30 0x37 0x30 0x37 0x3e 0x37 0x3e 0x45 0x3e 0x45 0x4c
0x45 0x4c 0x53 0x4c 0x53 0x5a 0x53 0x5a 0x61 0x5a 0x61 0x68
0x61 0x68 0x6f 0x68 0x6f 0x76 0x6f 0x76 0x7d 0x76 0x7d 0x80
0x7d 0x80 0x00 0x80 0x00 0x81 0x00 0x81 0x88
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 0 0 SIZE 100 128
EXPECT framebuffer IDX 0 0 SIZE 1 128 EQ_RGBA 0 7 14 255 TOLERANCE 1
EXPECT framebuffer IDX 1 0 SIZE 1 128 EQ_RGBA 7 14 21 255 TOLERANCE 1
EXPECT framebuffer IDX 2 0 SIZE 1 128 EQ_RGBA 14 21 28 255 TOLERANCE 1
EXPECT framebuffer IDX 3 0 SIZE 1 128 EQ_RGBA 21 28 35 255 TOLERANCE 1
EXPECT framebuffer IDX 4 0 SIZE 1 128 EQ_RGBA 28 35 42 255 TOLERANCE 1
EXPECT framebuffer IDX 5 0 SIZE 1 128 EQ_RGBA 35 42 49 255 TOLERANCE 1
EXPECT framebuffer IDX 6 0 SIZE 1 128 EQ_RGBA 42 49 56 255 TOLERANCE 1
EXPECT framebuffer IDX 7 0 SIZE 1 128 EQ_RGBA 49 56 63 255 TOLERANCE 1
EXPECT framebuffer IDX 8 0 SIZE 1 128 EQ_RGBA 56 63 70 255 TOLERANCE 1
EXPECT framebuffer IDX 9 0 SIZE 1 128 EQ_RGBA 63 70 77 255 TOLERANCE 1
EXPECT framebuffer IDX 10 0 SIZE 1 128 EQ_RGBA 70 77 84 255 TOLERANCE 1
EXPECT framebuffer IDX 11 0 SIZE 1 128 EQ_RGBA 77 84 91 255 TOLERANCE 1
EXPECT framebuffer IDX 12 0 SIZE 1 128 EQ_RGBA 84 91 98 255 TOLERANCE 1
EXPECT framebuffer IDX 13 0 SIZE 1 128 EQ_RGBA 91 98 105 255 TOLERANCE 1
EXPECT framebuffer IDX 14 0 SIZE 1 128 EQ_RGBA 98 105 112 255 TOLERANCE 1
EXPECT framebuffer IDX 15 0 SIZE 1 128 EQ_RGBA 105 112 119 255 TOLERANCE 1
EXPECT framebuffer IDX 16 0 SIZE 1 128 EQ_RGBA 112 119 126 255 TOLERANCE 1
EXPECT framebuffer IDX 17 0 SIZE 1 128 EQ_RGBA 119 126 133 255 TOLERANCE 1
EXPECT framebuffer IDX 18 0 SIZE 1 128 EQ_RGBA 126 133 140 255 TOLERANCE 1
EXPECT framebuffer IDX 19 0 SIZE 1 128 EQ_RGBA 133 140 147 255 TOLERANCE 1
EXPECT framebuffer IDX 20 0 SIZE 1 128 EQ_RGBA 140 147 154 255 TOLERANCE 1
EXPECT framebuffer IDX 21 0 SIZE 1 128 EQ_RGBA 147 154 161 255 TOLERANCE 1
EXPECT framebuffer IDX 22 0 SIZE 1 128 EQ_RGBA 154 161 168 255 TOLERANCE 1
EXPECT framebuffer IDX 23 0 SIZE 1 128 EQ_RGBA 161 168 175 255 TOLERANCE 1
EXPECT framebuffer IDX 24 0 SIZE 1 128 EQ_RGBA 168 175 182 255 TOLERANCE 1
EXPECT framebuffer IDX 25 0 SIZE 1 128 EQ_RGBA 175 182 189 255 TOLERANCE 1
EXPECT framebuffer IDX 26 0 SIZE 1 128 EQ_RGBA 182 189 196 255 TOLERANCE 1
EXPECT framebuffer IDX 27 0 SIZE 1 128 EQ_RGBA 189 196 203 255 TOLERANCE 1
EXPECT framebuffer IDX 28 0 SIZE 1 128 EQ_RGBA 196 203 210 255 TOLERANCE 1
EXPECT framebuffer IDX 29 0 SIZE 1 128 EQ_RGBA 203 210 217 255 TOLERANCE 1
EXPECT framebuffer IDX 30 0 SIZE 1 128 EQ_RGBA 210 217 224 255 TOLERANCE 1
EXPECT framebuffer IDX 31 0 SIZE 1 128 EQ_RGBA 217 224 231 255 TOLERANCE 1
EXPECT framebuffer IDX 32 0 SIZE 1 128 EQ_RGBA 224 231 238 255 TOLERANCE 1
EXPECT framebuffer IDX 33 0 SIZE 1 128 EQ_RGBA 231 238 245 255 TOLERANCE 1
EXPECT framebuffer IDX 34 0 SIZE 1 128 EQ_RGBA 238 245 252 255 TOLERANCE 1
EXPECT framebuffer IDX 35 0 SIZE 1 128 EQ_RGBA 245 252 0 255 TOLERANCE 1
EXPECT framebuffer IDX 36 0 SIZE 1 128 EQ_RGBA 252 0 127 255 TOLERANCE 1
EXPECT framebuffer IDX 37 0 SIZE 1 128 EQ_RGBA 0 127 0 255 TOLERANCE 1
EXPECT framebuffer IDX 38 0 SIZE 1 128 EQ_RGBA 127 0 7 255 TOLERANCE 1
@@ -0,0 +1,98 @@
#!amber
# Copyright 2020 The Amber Authors.
#
# 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.
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
uniform layout(set=0, binding=0) samplerBuffer texels;
void main()
{
color_out = (texelFetch(texels, int(gl_FragCoord.x) % 39) + vec4(1.0)) / vec4(2.0);
}
END
BUFFER texel_buffer DATA_TYPE R8G8B8A8_SNORM DATA
0x81 0x88 0x8f 0x96 0x88 0x8f 0x96 0x9d 0x8f 0x96 0x9d 0xa4
0x96 0x9d 0xa4 0xab 0x9d 0xa4 0xab 0xb2 0xa4 0xab 0xb2 0xb9
0xab 0xb2 0xb9 0xc0 0xb2 0xb9 0xc0 0xc7 0xb9 0xc0 0xc7 0xce
0xc0 0xc7 0xce 0xd5 0xc7 0xce 0xd5 0xdc 0xce 0xd5 0xdc 0xe3
0xd5 0xdc 0xe3 0xea 0xdc 0xe3 0xea 0xf1 0xe3 0xea 0xf1 0xf8
0xea 0xf1 0xf8 0xff 0xf1 0xf8 0xff 0x06 0xf8 0xff 0x06 0x0d
0xff 0x06 0x0d 0x14 0x06 0x0d 0x14 0x1b 0x0d 0x14 0x1b 0x22
0x14 0x1b 0x22 0x29 0x1b 0x22 0x29 0x30 0x22 0x29 0x30 0x37
0x29 0x30 0x37 0x3e 0x30 0x37 0x3e 0x45 0x37 0x3e 0x45 0x4c
0x3e 0x45 0x4c 0x53 0x45 0x4c 0x53 0x5a 0x4c 0x53 0x5a 0x61
0x53 0x5a 0x61 0x68 0x5a 0x61 0x68 0x6f 0x61 0x68 0x6f 0x76
0x68 0x6f 0x76 0x7d 0x6f 0x76 0x7d 0x80 0x76 0x7d 0x80 0x00
0x7d 0x80 0x00 0x81 0x80 0x00 0x81 0x88 0x00 0x81 0x88 0x8f
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texel_buffer AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 0
FRAMEBUFFER_SIZE 256 256
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 255 255
CLEAR pipeline
RUN pipeline DRAW_RECT POS 0 0 SIZE 100 128
EXPECT framebuffer IDX 0 0 SIZE 1 128 EQ_RGBA 0 7 14 21 TOLERANCE 1
EXPECT framebuffer IDX 1 0 SIZE 1 128 EQ_RGBA 7 14 21 28 TOLERANCE 1
EXPECT framebuffer IDX 2 0 SIZE 1 128 EQ_RGBA 14 21 28 35 TOLERANCE 1
EXPECT framebuffer IDX 3 0 SIZE 1 128 EQ_RGBA 21 28 35 42 TOLERANCE 1
EXPECT framebuffer IDX 4 0 SIZE 1 128 EQ_RGBA 28 35 42 49 TOLERANCE 1
EXPECT framebuffer IDX 5 0 SIZE 1 128 EQ_RGBA 35 42 49 56 TOLERANCE 1
EXPECT framebuffer IDX 6 0 SIZE 1 128 EQ_RGBA 42 49 56 63 TOLERANCE 1
EXPECT framebuffer IDX 7 0 SIZE 1 128 EQ_RGBA 49 56 63 70 TOLERANCE 1
EXPECT framebuffer IDX 8 0 SIZE 1 128 EQ_RGBA 56 63 70 77 TOLERANCE 1
EXPECT framebuffer IDX 9 0 SIZE 1 128 EQ_RGBA 63 70 77 84 TOLERANCE 1
EXPECT framebuffer IDX 10 0 SIZE 1 128 EQ_RGBA 70 77 84 91 TOLERANCE 1
EXPECT framebuffer IDX 11 0 SIZE 1 128 EQ_RGBA 77 84 91 98 TOLERANCE 1
EXPECT framebuffer IDX 12 0 SIZE 1 128 EQ_RGBA 84 91 98 105 TOLERANCE 1
EXPECT framebuffer IDX 13 0 SIZE 1 128 EQ_RGBA 91 98 105 112 TOLERANCE 1
EXPECT framebuffer IDX 14 0 SIZE 1 128 EQ_RGBA 98 105 112 119 TOLERANCE 1
EXPECT framebuffer IDX 15 0 SIZE 1 128 EQ_RGBA 105 112 119 126 TOLERANCE 1
EXPECT framebuffer IDX 16 0 SIZE 1 128 EQ_RGBA 112 119 126 133 TOLERANCE 1
EXPECT framebuffer IDX 17 0 SIZE 1 128 EQ_RGBA 119 126 133 140 TOLERANCE 1
EXPECT framebuffer IDX 18 0 SIZE 1 128 EQ_RGBA 126 133 140 147 TOLERANCE 1
EXPECT framebuffer IDX 19 0 SIZE 1 128 EQ_RGBA 133 140 147 154 TOLERANCE 1
EXPECT framebuffer IDX 20 0 SIZE 1 128 EQ_RGBA 140 147 154 161 TOLERANCE 1
EXPECT framebuffer IDX 21 0 SIZE 1 128 EQ_RGBA 147 154 161 168 TOLERANCE 1
EXPECT framebuffer IDX 22 0 SIZE 1 128 EQ_RGBA 154 161 168 175 TOLERANCE 1
EXPECT framebuffer IDX 23 0 SIZE 1 128 EQ_RGBA 161 168 175 182 TOLERANCE 1
EXPECT framebuffer IDX 24 0 SIZE 1 128 EQ_RGBA 168 175 182 189 TOLERANCE 1
EXPECT framebuffer IDX 25 0 SIZE 1 128 EQ_RGBA 175 182 189 196 TOLERANCE 1
EXPECT framebuffer IDX 26 0 SIZE 1 128 EQ_RGBA 182 189 196 203 TOLERANCE 1
EXPECT framebuffer IDX 27 0 SIZE 1 128 EQ_RGBA 189 196 203 210 TOLERANCE 1
EXPECT framebuffer IDX 28 0 SIZE 1 128 EQ_RGBA 196 203 210 217 TOLERANCE 1
EXPECT framebuffer IDX 29 0 SIZE 1 128 EQ_RGBA 203 210 217 224 TOLERANCE 1
EXPECT framebuffer IDX 30 0 SIZE 1 128 EQ_RGBA 210 217 224 231 TOLERANCE 1
EXPECT framebuffer IDX 31 0 SIZE 1 128 EQ_RGBA 217 224 231 238 TOLERANCE 1
EXPECT framebuffer IDX 32 0 SIZE 1 128 EQ_RGBA 224 231 238 245 TOLERANCE 1
EXPECT framebuffer IDX 33 0 SIZE 1 128 EQ_RGBA 231 238 245 252 TOLERANCE 1
EXPECT framebuffer IDX 34 0 SIZE 1 128 EQ_RGBA 238 245 252 0 TOLERANCE 1
EXPECT framebuffer IDX 35 0 SIZE 1 128 EQ_RGBA 245 252 0 127 TOLERANCE 1
EXPECT framebuffer IDX 36 0 SIZE 1 128 EQ_RGBA 252 0 127 0 TOLERANCE 1
EXPECT framebuffer IDX 37 0 SIZE 1 128 EQ_RGBA 0 127 0 7 TOLERANCE 1
EXPECT framebuffer IDX 38 0 SIZE 1 128 EQ_RGBA 127 0 7 14 TOLERANCE 1
@@ -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
#
# 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.
SHADER vertex vertShaderTex GLSL
#version 430
layout(location = 0) in vec4 position;
layout(location = 1) in vec2 texCoordsIn;
layout(location = 0) out vec2 texCoordsOut;
void main() {
gl_Position = position;
texCoordsOut = texCoordsIn;
}
END
SHADER fragment fragShaderTex GLSL
#version 430
layout(location = 0) in vec2 texCoordsIn;
layout(location = 0) out vec4 colorOut;
layout(set=0, binding=0) uniform sampler2D referenceSampler;
layout(set=0, binding=1) uniform samplerBuffer bufferSampler;
void main() {
vec4 referenceValue = texture(referenceSampler, texCoordsIn);
vec4 bufferValue = texelFetch(bufferSampler, int((gl_FragCoord.y-0.5) * 8 + (gl_FragCoord.x-0.5)));
if (bufferValue == referenceValue)
colorOut = vec4(0., 1., 0., 1.);
else
colorOut = vec4(1., 0., 0., 1.);
}
END
IMAGE texture FORMAT B8G8R8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0
255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0
255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0
0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0
0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0
0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0
0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255
0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255
END
IMAGE texture2 FORMAT B8G8R8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0
255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0
255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0
0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0
0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0
0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0
0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255
0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
SAMPLER sampler
BUFFER position DATA_TYPE vec2<float> DATA
-1. -1.
1. -1.
-1. 1.
1. -1.
1. 1.
-1. 1.
END
BUFFER texcoords DATA_TYPE vec2<float> DATA
0.0 0.0
1.0 0.0
0.0 1.0
1.0 0.0
1.0 1.0
0.0 1.0
END
PIPELINE graphics pipeline
ATTACH vertShaderTex
ATTACH fragShaderTex
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER texture2 AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 1
VERTEX_DATA position LOCATION 0
VERTEX_DATA texcoords LOCATION 1
FRAMEBUFFER_SIZE 8 8
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 0 0
CLEAR pipeline
RUN pipeline DRAW_ARRAY AS TRIANGLE_LIST START_IDX 0 COUNT 6
EXPECT framebuffer IDX 0 0 SIZE 8 8 EQ_RGBA 0 255 0 255
@@ -0,0 +1,110 @@
#!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
#
# 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.
SHADER vertex vertShaderTex GLSL
#version 430
layout(location = 0) in vec4 position;
layout(location = 1) in vec2 texCoordsIn;
layout(location = 0) out vec2 texCoordsOut;
void main() {
gl_Position = position;
texCoordsOut = texCoordsIn;
}
END
SHADER fragment fragShaderTex GLSL
#version 430
layout(location = 0) in vec2 texCoordsIn;
layout(location = 0) out vec4 colorOut;
layout(set=0, binding=0) uniform sampler2D referenceSampler;
layout(set=0, binding=1) uniform samplerBuffer bufferSampler;
void main() {
vec4 referenceValue = texture(referenceSampler, texCoordsIn);
vec4 bufferValue = texelFetch(bufferSampler, int((gl_FragCoord.y-0.5) * 8 + (gl_FragCoord.x-0.5)));
if (bufferValue == referenceValue)
colorOut = vec4(0., 1., 0., 1.);
else
colorOut = vec4(1., 0., 0., 1.);
}
END
IMAGE texture FORMAT B8G8R8A8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
255 100 0 255 255 80 0 255 255 33 19 255 255 44 70 255 255 9 8 253 155 0 0 212
255 0 0 255 255 60 60 255 255 40 17 205 255 45 120 255 255 2 8 153 250 0 0 115
255 0 0 255 255 80 23 255 255 50 12 215 255 46 11 255 255 34 78 255 221 0 0 222
255 0 0 255 255 80 44 255 255 80 90 155 255 13 12 255 255 32 56 255
80 255 20 255 40 255 36 251 0 255 110 175 0 225 0 55 0 151 0 51 0 225 0 235
20 215 32 255 30 255 34 215 20 255 32 255 220 255 0 25 0 215 0 25 0 208 0 205
90 255 34 255 30 255 0 215 80 255 44 255 110 255 0 152 0 225 0 21 0 203 0 215
130 215 35 255 11 255 33 251 90 255 55 255 110
50 255 255 160 11 105 214 0 10 134 158 190 0 255 255 0 0 255 255 0 90 255 255 0
55 151 205 170 10 103 254 20 0 123 238 35 10 215 250 10 22 255 235 33 80 255 255 0
66 115 205 120 11 212 244 44 53 250 250 0 20 255 255 0 23 255 253 0 43 255 255 0
68 255 255 0 0 222 233
END
IMAGE texture2 FORMAT B8G8R8A8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
255 100 0 255 255 80 0 255 255 33 19 255 255 44 70 255 255 9 8 253 155 0 0 212
255 0 0 255 255 60 60 255 255 40 17 205 255 45 120 255 255 2 8 153 250 0 0 115
255 0 0 255 255 80 23 255 255 50 12 215 255 46 11 255 255 34 78 255 221 0 0 222
255 0 0 255 255 80 44 255 255 80 90 155 255 13 12 255 255 32 56 255
80 255 20 255 40 255 36 251 0 255 110 175 0 225 0 55 0 151 0 51 0 225 0 235
20 215 32 255 30 255 34 215 20 255 32 255 220 255 0 25 0 215 0 25 0 208 0 205
90 255 34 255 30 255 0 215 80 255 44 255 110 255 0 152 0 225 0 21 0 203 0 215
130 215 35 255 11 255 33 251 90 255 55 255 110
50 255 255 160 11 105 214 0 10 134 158 190 0 255 255 0 0 255 255 0 90 255 255 0
55 151 205 170 10 103 254 20 0 123 238 35 10 215 250 10 22 255 235 33 80 255 255 0
66 115 205 120 11 212 244 44 53 250 250 0 20 255 255 0 23 255 253 0 43 255 255 0
68 255 255 0 0 222 233
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
SAMPLER sampler
BUFFER position DATA_TYPE vec2<float> DATA
-1. -1.
1. -1.
-1. 1.
1. -1.
1. 1.
-1. 1.
END
BUFFER texcoords DATA_TYPE vec2<float> DATA
0.0 0.0
1.0 0.0
0.0 1.0
1.0 0.0
1.0 1.0
0.0 1.0
END
PIPELINE graphics pipeline
ATTACH vertShaderTex
ATTACH fragShaderTex
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER texture2 AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 1
VERTEX_DATA position LOCATION 0
VERTEX_DATA texcoords LOCATION 1
FRAMEBUFFER_SIZE 8 8
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 0 0
CLEAR pipeline
RUN pipeline DRAW_ARRAY AS TRIANGLE_LIST START_IDX 0 COUNT 6
EXPECT framebuffer IDX 0 0 SIZE 8 8 EQ_RGBA 0 255 0 255
@@ -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
#
# 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.
SHADER vertex vertShaderTex GLSL
#version 430
layout(location = 0) in vec4 position;
layout(location = 1) in vec2 texCoordsIn;
layout(location = 0) out vec2 texCoordsOut;
void main() {
gl_Position = position;
texCoordsOut = texCoordsIn;
}
END
SHADER fragment fragShaderTex GLSL
#version 430
layout(location = 0) in vec2 texCoordsIn;
layout(location = 0) out vec4 colorOut;
layout(set=0, binding=0) uniform sampler2D referenceSampler;
layout(set=0, binding=1) uniform samplerBuffer bufferSampler;
void main() {
vec4 referenceValue = texture(referenceSampler, texCoordsIn);
vec4 bufferValue = texelFetch(bufferSampler, int((gl_FragCoord.y-0.5) * 8 + (gl_FragCoord.x-0.5)));
if (bufferValue.r == referenceValue.r)
colorOut = vec4(0., 1., 0., 1.);
else
colorOut = vec4(1., 0., 0., 1.);
}
END
IMAGE texture FORMAT R8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
185 120 185 20 185 120 189 120
145 122 185 10 185 12 188 122
135 222 15 12 185 121 186 113
175 124 5 130 185 100 185 123
177 221 6 140 185 101 182 29
188 121 67 150 185 120 184 127
189 27 88 22 185 120 15 123
111 18 185 24 185 120 17 220
END
IMAGE texture2 FORMAT R8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
185 120 185 20 185 120 189 120
145 122 185 10 185 12 188 122
135 222 15 12 185 121 186 113
175 124 5 130 185 100 185 123
177 221 6 140 185 101 182 29
188 121 67 150 185 120 184 127
189 27 88 22 185 120 15 123
111 18 185 24 185 120 17 220
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
SAMPLER sampler
BUFFER position DATA_TYPE vec2<float> DATA
-1. -1.
1. -1.
-1. 1.
1. -1.
1. 1.
-1. 1.
END
BUFFER texcoords DATA_TYPE vec2<float> DATA
0.0 0.0
1.0 0.0
0.0 1.0
1.0 0.0
1.0 1.0
0.0 1.0
END
PIPELINE graphics pipeline
ATTACH vertShaderTex
ATTACH fragShaderTex
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER texture2 AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 1
VERTEX_DATA position LOCATION 0
VERTEX_DATA texcoords LOCATION 1
FRAMEBUFFER_SIZE 8 8
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 0 0
CLEAR pipeline
RUN pipeline DRAW_ARRAY AS TRIANGLE_LIST START_IDX 0 COUNT 6
EXPECT framebuffer IDX 0 0 SIZE 8 8 EQ_RGBA 0 255 0 255
@@ -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
#
# 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.
SHADER vertex vertShaderTex GLSL
#version 430
layout(location = 0) in vec4 position;
layout(location = 1) in vec2 texCoordsIn;
layout(location = 0) out vec2 texCoordsOut;
void main() {
gl_Position = position;
texCoordsOut = texCoordsIn;
}
END
SHADER fragment fragShaderTex GLSL
#version 430
layout(location = 0) in vec2 texCoordsIn;
layout(location = 0) out vec4 colorOut;
layout(set=0, binding=0) uniform sampler2D referenceSampler;
layout(set=0, binding=1) uniform samplerBuffer bufferSampler;
void main() {
vec4 referenceValue = texture(referenceSampler, texCoordsIn);
vec4 bufferValue = texelFetch(bufferSampler, int((gl_FragCoord.y-0.5) * 8 + (gl_FragCoord.x-0.5)));
if (bufferValue == referenceValue)
colorOut = vec4(0., 1., 0., 1.);
else
colorOut = vec4(1., 0., 0., 1.);
}
END
IMAGE texture FORMAT R8G8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
152 10 255 20 254 3 255 7 255 55 255 255 251 255 255
272 81 205 22 244 20 255 20 255 155 112 255 111 215 190 255 0
126 44 201 23 133 229 255 10 255 207 255 255 125 255 255
56 120 101 48 177 2 255 10 255 207 0 255 132 33 0 255 0
45 130 189 89 77 88 255 120 255 201 255 211 233 255 255
135 134 202 42 88 76 255 9 255 41 0 255 36 244 0 255 0
185 34 133 199 87 176 255 12 255 244 255 255 2 255 255
142 88 177 99 150 190 255 16 17 25 39 39 11 151 23 255 0
END
IMAGE texture2 FORMAT R8G8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
152 10 255 20 254 3 255 7 255 55 255 255 251 255 255
272 81 205 22 244 20 255 20 255 155 112 255 111 215 190 255 0
126 44 201 23 133 229 255 10 255 207 255 255 125 255 255
56 120 101 48 177 2 255 10 255 207 0 255 132 33 0 255 0
45 130 189 89 77 88 255 120 255 201 255 211 233 255 255
135 134 202 42 88 76 255 9 255 41 0 255 36 244 0 255 0
185 34 133 199 87 176 255 12 255 244 255 255 2 255 255
142 88 177 99 150 190 255 16 17 25 39 39 11 151 23 255 0
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
SAMPLER sampler
BUFFER position DATA_TYPE vec2<float> DATA
-1. -1.
1. -1.
-1. 1.
1. -1.
1. 1.
-1. 1.
END
BUFFER texcoords DATA_TYPE vec2<float> DATA
0.0 0.0
1.0 0.0
0.0 1.0
1.0 0.0
1.0 1.0
0.0 1.0
END
PIPELINE graphics pipeline
ATTACH vertShaderTex
ATTACH fragShaderTex
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER texture2 AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 1
VERTEX_DATA position LOCATION 0
VERTEX_DATA texcoords LOCATION 1
FRAMEBUFFER_SIZE 8 8
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 0 0
CLEAR pipeline
RUN pipeline DRAW_ARRAY AS TRIANGLE_LIST START_IDX 0 COUNT 6
EXPECT framebuffer IDX 0 0 SIZE 8 8 EQ_RGBA 0 255 0 255
@@ -0,0 +1,104 @@
#!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
#
# 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.
SHADER vertex vertShaderTex GLSL
#version 430
layout(location = 0) in vec4 position;
layout(location = 1) in vec2 texCoordsIn;
layout(location = 0) out vec2 texCoordsOut;
void main() {
gl_Position = position;
texCoordsOut = texCoordsIn;
}
END
SHADER fragment fragShaderTex GLSL
#version 430
layout(location = 0) in vec2 texCoordsIn;
layout(location = 0) out vec4 colorOut;
layout(set=0, binding=0) uniform sampler2D referenceSampler;
layout(set=0, binding=1) uniform samplerBuffer bufferSampler;
void main() {
vec4 referenceValue = texture(referenceSampler, texCoordsIn);
vec4 bufferValue = texelFetch(bufferSampler, int((gl_FragCoord.y-0.5) * 8 + (gl_FragCoord.x-0.5)));
if (bufferValue == referenceValue)
colorOut = vec4(0., 1., 0., 1.);
else
colorOut = vec4(1., 0., 0., 1.);
}
END
IMAGE texture FORMAT R8G8B8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
125 87 23 255 0 0 155 0 0 255 110 110 212 11 0 255 11 10 115 12 11 255 0 0
215 8 21 255 0 0 55 0 0 255 180 230 220 22 13 215 12 231 215 44 23 255 0 0
152 35 0 255 0 0 155 0 0 255 88 20 255 12 23 121 122 123 241 4 10
2 255 1 0 255 0 0 255 0 0 255 77 0 255 0 0 255 0 0 255 0 0 255 0
230 255 66 0 255 0 0 255 0 0 255 54 74 255 0 0 255 0 0 255 0 0 255 0
33 255 0 0 255 0 0 155 0 0 255 76 75 255 0
23 120 233 0 0 255 0 0 155 43 34 212 111 120 255 0 10 252 22 123 215 33 30 223
44 220 35 22 24 255 0 0 215 120 33 211 122 120 255 130 12 251 22 23 221 210 211 215
55 0 244 0 87 85 82 0 251 220 32 205
END
IMAGE texture2 FORMAT R8G8B8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
125 87 23 255 0 0 155 0 0 255 110 110 212 11 0 255 11 10 115 12 11 255 0 0
215 8 21 255 0 0 55 0 0 255 180 230 220 22 13 215 12 231 215 44 23 255 0 0
152 35 0 255 0 0 155 0 0 255 88 20 255 12 23 121 122 123 241 4 10
2 255 1 0 255 0 0 255 0 0 255 77 0 255 0 0 255 0 0 255 0 0 255 0
230 255 66 0 255 0 0 255 0 0 255 54 74 255 0 0 255 0 0 255 0 0 255 0
33 255 0 0 255 0 0 155 0 0 255 76 75 255 0
23 120 233 0 0 255 0 0 155 43 34 212 111 120 255 0 10 252 22 123 215 33 30 223
44 220 35 22 24 255 0 0 215 120 33 211 122 120 255 130 12 251 22 23 221 210 211 215
55 0 244 0 87 85 82 0 251 220 32 205
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
SAMPLER sampler
BUFFER position DATA_TYPE vec2<float> DATA
-1. -1.
1. -1.
-1. 1.
1. -1.
1. 1.
-1. 1.
END
BUFFER texcoords DATA_TYPE vec2<float> DATA
0.0 0.0
1.0 0.0
0.0 1.0
1.0 0.0
1.0 1.0
0.0 1.0
END
PIPELINE graphics pipeline
ATTACH vertShaderTex
ATTACH fragShaderTex
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER texture2 AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 1
VERTEX_DATA position LOCATION 0
VERTEX_DATA texcoords LOCATION 1
FRAMEBUFFER_SIZE 8 8
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 0 0
CLEAR pipeline
RUN pipeline DRAW_ARRAY AS TRIANGLE_LIST START_IDX 0 COUNT 6
EXPECT framebuffer IDX 0 0 SIZE 8 8 EQ_RGBA 0 255 0 255
@@ -0,0 +1,110 @@
#!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
#
# 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.
SHADER vertex vertShaderTex GLSL
#version 430
layout(location = 0) in vec4 position;
layout(location = 1) in vec2 texCoordsIn;
layout(location = 0) out vec2 texCoordsOut;
void main() {
gl_Position = position;
texCoordsOut = texCoordsIn;
}
END
SHADER fragment fragShaderTex GLSL
#version 430
layout(location = 0) in vec2 texCoordsIn;
layout(location = 0) out vec4 colorOut;
layout(set=0, binding=0) uniform sampler2D referenceSampler;
layout(set=0, binding=1) uniform samplerBuffer bufferSampler;
void main() {
vec4 referenceValue = texture(referenceSampler, texCoordsIn);
vec4 bufferValue = texelFetch(bufferSampler, int((gl_FragCoord.y-0.5) * 8 + (gl_FragCoord.x-0.5)));
if (bufferValue == referenceValue)
colorOut = vec4(0., 1., 0., 1.);
else
colorOut = vec4(1., 0., 0., 1.);
}
END
IMAGE texture FORMAT R8G8B8A8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
255 100 0 255 255 80 0 255 255 33 19 255 255 44 70 255 255 9 8 253 155 0 0 212
255 0 0 255 255 60 60 255 255 40 17 205 255 45 120 255 255 2 8 153 250 0 0 115
255 0 0 255 255 80 23 255 255 50 12 215 255 46 11 255 255 34 78 255 221 0 0 222
255 0 0 255 255 80 44 255 255 80 90 155 255 13 12 255 255 32 56 255
80 255 20 255 40 255 36 251 0 255 110 175 0 225 0 55 0 151 0 51 0 225 0 235
20 215 32 255 30 255 34 215 20 255 32 255 220 255 0 25 0 215 0 25 0 208 0 205
90 255 34 255 30 255 0 215 80 255 44 255 110 255 0 152 0 225 0 21 0 203 0 215
130 215 35 255 11 255 33 251 90 255 55 255 110
50 255 255 160 11 105 214 0 10 134 158 190 0 255 255 0 0 255 255 0 90 255 255 0
55 151 205 170 10 103 254 20 0 123 238 35 10 215 250 10 22 255 235 33 80 255 255 0
66 115 205 120 11 212 244 44 53 250 250 0 20 255 255 0 23 255 253 0 43 255 255 0
68 255 255 0 0 222 233
END
IMAGE texture2 FORMAT R8G8B8A8_SRGB DIM_2D WIDTH 8 HEIGHT 8 DATA
255 100 0 255 255 80 0 255 255 33 19 255 255 44 70 255 255 9 8 253 155 0 0 212
255 0 0 255 255 60 60 255 255 40 17 205 255 45 120 255 255 2 8 153 250 0 0 115
255 0 0 255 255 80 23 255 255 50 12 215 255 46 11 255 255 34 78 255 221 0 0 222
255 0 0 255 255 80 44 255 255 80 90 155 255 13 12 255 255 32 56 255
80 255 20 255 40 255 36 251 0 255 110 175 0 225 0 55 0 151 0 51 0 225 0 235
20 215 32 255 30 255 34 215 20 255 32 255 220 255 0 25 0 215 0 25 0 208 0 205
90 255 34 255 30 255 0 215 80 255 44 255 110 255 0 152 0 225 0 21 0 203 0 215
130 215 35 255 11 255 33 251 90 255 55 255 110
50 255 255 160 11 105 214 0 10 134 158 190 0 255 255 0 0 255 255 0 90 255 255 0
55 151 205 170 10 103 254 20 0 123 238 35 10 215 250 10 22 255 235 33 80 255 255 0
66 115 205 120 11 212 244 44 53 250 250 0 20 255 255 0 23 255 253 0 43 255 255 0
68 255 255 0 0 222 233
END
BUFFER framebuffer FORMAT B8G8R8A8_UNORM
SAMPLER sampler
BUFFER position DATA_TYPE vec2<float> DATA
-1. -1.
1. -1.
-1. 1.
1. -1.
1. 1.
-1. 1.
END
BUFFER texcoords DATA_TYPE vec2<float> DATA
0.0 0.0
1.0 0.0
0.0 1.0
1.0 0.0
1.0 1.0
0.0 1.0
END
PIPELINE graphics pipeline
ATTACH vertShaderTex
ATTACH fragShaderTex
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER texture2 AS uniform_texel_buffer DESCRIPTOR_SET 0 BINDING 1
VERTEX_DATA position LOCATION 0
VERTEX_DATA texcoords LOCATION 1
FRAMEBUFFER_SIZE 8 8
BIND BUFFER framebuffer AS color LOCATION 0
END
CLEAR_COLOR pipeline 0 0 0 0
CLEAR pipeline
RUN pipeline DRAW_ARRAY AS TRIANGLE_LIST START_IDX 0 COUNT 6
EXPECT framebuffer IDX 0 0 SIZE 8 8 EQ_RGBA 0 255 0 255
@@ -0,0 +1,58 @@
#!amber
SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_setup GLSL
#version 430
layout(location = 0) out vec4 result;
void main() {
result = vec4(floor(gl_FragCoord.x) / 255.0f, floor(gl_FragCoord.y) / 255.0f, 0, 0);
}
END
SHADER fragment frag_shader GLSL
#version 430
layout(binding = 0) uniform sampler2D tex;
layout(location = 0) out vec4 result;
void main() {
vec2 base = floor(gl_FragCoord.xy) / 255.0f;
uint mask = 0;
mask |= textureOffset(tex, base, ivec2(0, -1)).g < base.y ? 1 : 0;
mask |= textureOffset(tex, base, ivec2(0, 1)).g > base.y ? 2 : 0;
mask |= textureOffset(tex, base, ivec2(-1, 0)).r < base.x ? 4 : 0;
mask |= textureOffset(tex, base, ivec2(1, 0)).r > base.x ? 8 : 0;
result = vec4(mask/255.0f, 0, 0, 0);
}
END
IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 256 HEIGHT 256
SAMPLER sampler
PIPELINE graphics setup
ATTACH vert_shader
ATTACH frag_setup
BIND BUFFER texture AS color LOCATION 0
FRAMEBUFFER_SIZE 256 256
END
RUN setup DRAW_RECT POS 0 0 SIZE 256 256
BUFFER framebuffer FORMAT R8G8B8A8_UNORM
PIPELINE graphics pipeline
ATTACH vert_shader
ATTACH frag_shader
BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER framebuffer AS color LOCATION 0
FRAMEBUFFER_SIZE 256 256
END
RUN pipeline DRAW_RECT POS 0 0 SIZE 256 256
EXPECT framebuffer IDX 1 1 SIZE 254 254 EQ_RGBA 15 0 0 0