1#!amber 2# Copyright 2019 The Amber Authors. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# https://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16 17VIRTUAL_FILE "relative.hlsl" 18#error "Wrong include picked!" 19END 20 21VIRTUAL_FILE "subdir/relative.hlsl" 22// Correct include! 23struct VS_OUTPUT { 24 float4 pos : SV_POSITION; 25 float4 color : COLOR; 26}; 27 28VS_OUTPUT main(float4 pos : POSITION, 29 float4 color : COLOR) { 30 VS_OUTPUT vout; 31 vout.pos = pos; 32 vout.color = color; 33 return vout; 34} 35END 36 37VIRTUAL_FILE "subdir/include.hlsl" 38#include "relative.hlsl" 39END 40 41VIRTUAL_FILE "main.hlsl" 42#include "subdir/include.hlsl" 43END 44 45SHADER vertex vtex_shader HLSL VIRTUAL_FILE main.hlsl 46 47SHADER fragment frag_shader HLSL 48float4 main(float4 color : COLOR) : SV_TARGET { 49 return color; 50} 51END 52 53PIPELINE graphics pipeline 54 ATTACH vtex_shader 55 ATTACH frag_shader 56END 57