75 lines
1.7 KiB
Plaintext
75 lines
1.7 KiB
Plaintext
#!amber
|
|
#
|
|
# 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 DepthClampZeroOneFeatures.depthClampZeroOne
|
|
DEVICE_FEATURE fragmentStoresAndAtomics
|
|
|
|
SHADER vertex vert_shader GLSL
|
|
#version 430
|
|
layout(location = 0) in vec2 position_in;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = vec4(position_in, 1, 1);
|
|
}
|
|
END
|
|
|
|
SHADER fragment frag_shader GLSL
|
|
#version 430
|
|
layout (binding=0) buffer B {
|
|
float d;
|
|
};
|
|
|
|
layout(location = 0) out highp vec4 frag_out;
|
|
void main()
|
|
{
|
|
d = gl_FragCoord.z;
|
|
frag_out = vec4(0, 1, 0, 1);
|
|
}
|
|
END
|
|
|
|
BUFFER framebuffer0 FORMAT R8G8B8A8_UNORM
|
|
BUFFER depth0 FORMAT D32_SFLOAT
|
|
|
|
BUFFER fs_depth DATA_TYPE float DATA
|
|
0.0
|
|
END
|
|
|
|
PIPELINE graphics pipeline
|
|
DEPTH
|
|
TEST on
|
|
WRITE on
|
|
BIAS constant 2097152.0 clamp 0.0 slope 0.0
|
|
END
|
|
|
|
VIEWPORT 0 0 SIZE 60 60 MIN_DEPTH 0.1 MAX_DEPTH 0.5
|
|
|
|
ATTACH vert_shader
|
|
ATTACH frag_shader
|
|
BIND BUFFER framebuffer0 AS color LOCATION 0
|
|
BIND BUFFER depth0 AS depth_stencil
|
|
FRAMEBUFFER_SIZE 60 60
|
|
|
|
BIND BUFFER fs_depth AS storage DESCRIPTOR_SET 0 BINDING 0
|
|
END
|
|
|
|
CLEAR_COLOR pipeline 0 0 0 0
|
|
CLEAR_DEPTH pipeline 1.0
|
|
CLEAR pipeline
|
|
RUN pipeline DRAW_RECT POS 0 0 SIZE 60 60
|
|
|
|
EXPECT framebuffer0 IDX 0 0 SIZE 60 60 EQ_RGBA 0 255 0 255
|
|
EXPECT depth0 IDX 0 EQ 0.625
|
|
EXPECT fs_depth IDX 0 TOLERANCE 1.0e-6 EQ 0.625
|