From bd18951be81cc33b608f0c4255639f42b066a19d Mon Sep 17 00:00:00 2001 From: Seiji Emery Date: Mon, 24 Aug 2015 13:13:24 -0700 Subject: [PATCH] fixed AUTOSCRIBE_SHADER_LIB to work for targets outside of libraries/ --- cmake/macros/SetupHifiProject.cmake | 2 +- tests/gpu-test/CMakeLists.txt | 2 +- tests/gpu-test/src/main.cpp | 4 ++-- tests/gpu-test/src/simple.slf | 29 +++++++++++++++++++++++ tests/gpu-test/src/simple.slv | 36 +++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 tests/gpu-test/src/simple.slf create mode 100644 tests/gpu-test/src/simple.slv diff --git a/cmake/macros/SetupHifiProject.cmake b/cmake/macros/SetupHifiProject.cmake index 1ed0d8a202..18a3a73588 100644 --- a/cmake/macros/SetupHifiProject.cmake +++ b/cmake/macros/SetupHifiProject.cmake @@ -23,7 +23,7 @@ macro(SETUP_HIFI_PROJECT) endforeach() # add the executable, include additional optional sources - add_executable(${TARGET_NAME} ${TARGET_SRCS} "${AUTOMTC_SRC}") + add_executable(${TARGET_NAME} ${TARGET_SRCS} "${AUTOMTC_SRC}" "${AUTOSCRIBE_SHADER_LIB_SRC}") set(${TARGET_NAME}_DEPENDENCY_QT_MODULES ${ARGN}) list(APPEND ${TARGET_NAME}_DEPENDENCY_QT_MODULES Core) diff --git a/tests/gpu-test/CMakeLists.txt b/tests/gpu-test/CMakeLists.txt index 19a41df776..abdbfc07f9 100644 --- a/tests/gpu-test/CMakeLists.txt +++ b/tests/gpu-test/CMakeLists.txt @@ -1,7 +1,7 @@ set(TARGET_NAME gpu-test) -AUTOSCRIBE_SHADER_LIB(gpu model render gpu-test) +AUTOSCRIBE_SHADER_LIB(gpu model render-utils) # This is not a testcase -- just set it up as a regular hifi project setup_hifi_project(Quick Gui OpenGL Script Widgets) diff --git a/tests/gpu-test/src/main.cpp b/tests/gpu-test/src/main.cpp index 9d2a3327d7..758d9b29bb 100644 --- a/tests/gpu-test/src/main.cpp +++ b/tests/gpu-test/src/main.cpp @@ -35,8 +35,8 @@ #include #include -#include "../../libraries/render-utils/simple_frag.h" -#include "../../libraries/render-utils/simple_vert.h" +#include "simple_frag.h" +#include "simple_vert.h" class RateCounter { std::vector times; diff --git a/tests/gpu-test/src/simple.slf b/tests/gpu-test/src/simple.slf new file mode 100644 index 0000000000..31d33a73e4 --- /dev/null +++ b/tests/gpu-test/src/simple.slf @@ -0,0 +1,29 @@ +<@include gpu/Config.slh@> +<$VERSION_HEADER$> +// Generated on <$_SCRIBE_DATE$> +// +// simple.frag +// fragment shader +// +// Created by Andrzej Kapolka on 9/15/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +<@include DeferredBufferWrite.slh@> +<@include model/Material.slh@> + +// the interpolated normal +in vec3 _normal; +in vec3 _color; + +void main(void) { + Material material = getMaterial(); + packDeferredFragment( + normalize(_normal.xyz), + glowIntensity, + _color.rgb, + DEFAULT_SPECULAR, DEFAULT_SHININESS); +} diff --git a/tests/gpu-test/src/simple.slv b/tests/gpu-test/src/simple.slv new file mode 100644 index 0000000000..99f404eaec --- /dev/null +++ b/tests/gpu-test/src/simple.slv @@ -0,0 +1,36 @@ +<@include gpu/Config.slh@> +<$VERSION_HEADER$> +// Generated on <$_SCRIBE_DATE$> +// +// simple.vert +// vertex shader +// +// Created by Andrzej Kapolka on 9/15/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +<@include gpu/Inputs.slh@> + +<@include gpu/Transform.slh@> + +<$declareStandardTransform()$> + +// the interpolated normal + +out vec3 _normal; +out vec3 _color; +out vec2 _texCoord0; + +void main(void) { + _color = inColor.rgb; + _texCoord0 = inTexCoord0.st; + + // standard transform + TransformCamera cam = getTransformCamera(); + TransformObject obj = getTransformObject(); + <$transformModelToClipPos(cam, obj, inPosition, gl_Position)$> + <$transformModelToEyeDir(cam, obj, inNormal.xyz, _normal)$> +} \ No newline at end of file