68 lines
1.6 KiB
Plaintext
68 lines
1.6 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_EXTENSION VK_EXT_depth_range_unrestricted
|
|
|
|
SHADER vertex vert_shader GLSL
|
|
#version 430
|
|
layout(location = 0) in vec2 position_in;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = vec4(position_in, 0, 1);
|
|
}
|
|
END
|
|
|
|
SHADER fragment frag_shader GLSL
|
|
#version 430
|
|
layout(location = 0) out highp vec4 frag_out;
|
|
void main()
|
|
{
|
|
gl_FragDepth = 2.0;
|
|
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
|
|
COMPARE_OP not_equal
|
|
WRITE on
|
|
END
|
|
|
|
VIEWPORT 0 0 SIZE 60 60 MIN_DEPTH 0.1 MAX_DEPTH 0.9
|
|
|
|
ATTACH vert_shader
|
|
ATTACH frag_shader
|
|
BIND BUFFER framebuffer0 AS color LOCATION 0
|
|
BIND BUFFER depth0 AS depth_stencil
|
|
FRAMEBUFFER_SIZE 60 60
|
|
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 2.0
|