Skip to content

Commit

Permalink
Rename glslcc to axslcc (axmolengine#2271)
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 authored Dec 13, 2024
1 parent d403077 commit e9d51ed
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 87 deletions.
32 changes: 16 additions & 16 deletions 1k/1kiss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -850,35 +850,35 @@ function setup_python3() {
}
}

# setup glslcc, not add to path
function setup_glslcc() {
if (!$manifest['glslcc']) { return $null }
$glslcc_bin = Join-Path $external_prefix 'glslcc'
$glslcc_prog, $glslcc_ver = find_prog -name 'glslcc' -path $glslcc_bin -mode 'BOTH'
if ($glslcc_prog) {
return $glslcc_prog
# setup axslcc, not add to path
function setup_axslcc() {
if (!$manifest['axslcc']) { return $null }
$axslcc_bin = Join-Path $external_prefix 'axslcc'
$axslcc_prog, $axslcc_ver = find_prog -name 'axslcc' -path $axslcc_bin -mode 'BOTH'
if ($axslcc_prog) {
return $axslcc_prog
}

$suffix = $('win64.zip', 'linux.tar.gz', 'osx{0}.tar.gz').Get($HOST_OS)
if ($IsMacOS) {
if ([System.VersionEx]$glslcc_ver -ge [System.VersionEx]'1.9.4.1') {
if ([System.VersionEx]$axslcc_ver -ge [System.VersionEx]'1.9.4.1') {
$suffix = $suffix -f "-$HOST_CPU"
}
else {
$suffix = $suffix -f ''
}
}

$glscc_base_url = $mirror_current.glslcc
fetch_pkg "$mirror_url_base$glscc_base_url/v$glslcc_ver/glslcc-$glslcc_ver-$suffix" $glslcc_bin
$glscc_base_url = $mirror_current.axslcc
fetch_pkg "$mirror_url_base$glscc_base_url/v$axslcc_ver/axslcc-$axslcc_ver-$suffix" $axslcc_bin

$glslcc_prog = (Join-Path $glslcc_bin "glslcc$EXE_SUFFIX")
if ($1k.isfile($glslcc_prog)) {
$1k.println("Using glslcc: $glslcc_prog, version: $glslcc_ver")
return $glslcc_prog
$axslcc_prog = (Join-Path $axslcc_bin "axslcc$EXE_SUFFIX")
if ($1k.isfile($axslcc_prog)) {
$1k.println("Using axslcc: $axslcc_prog, version: $axslcc_ver")
return $axslcc_prog
}

throw "Install glslcc fail"
throw "Install axslcc fail"
}

function setup_ninja() {
Expand Down Expand Up @@ -1578,7 +1578,7 @@ validHostAndToolchain

########## setup build tools if not installed #######

$null = setup_glslcc
$null = setup_axslcc

$cmake_prog, $Script:cmake_ver = setup_cmake

Expand Down
2 changes: 1 addition & 1 deletion 1k/manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# add or overwrite tool version like follow
if ($Global:is_axmol_app -or $Global:is_axmol_engine) {
$manifest['nuget'] = '5.5.1' # since 5.6.0, requires .net 4.0
$manifest['glslcc'] = '1.9.5+'
$manifest['axslcc'] = '1.9.6+'
$manifest['cmake'] = '3.29.3~3.30.5+'
$manifest['emsdk'] = '3.1.66~3.1.67+'
$manifest['jdk'] = '17.0.10~17.0.12+'
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/glslcc/sgs-spec.h → 3rdparty/axslcc/sgs-spec.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// sgs spec, define sgs macros and structs, can be include anywhere
// match with glslcc-1.9.0
// match with axslcc-1.9.0

#pragma once

Expand Down
14 changes: 7 additions & 7 deletions cmake/Modules/AXBuildHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ function(ax_setup_app_config app_name)
)
endif()

# auto looking app shaders source dir and add to glslcc compile-list
# auto looking app shaders source dir and add to axslcc compile-list
get_target_property(_APP_SOURCE_DIR ${app_name} SOURCE_DIR)
set(app_shaders_dir "${_APP_SOURCE_DIR}/Source/shaders")

Expand All @@ -496,20 +496,20 @@ function(ax_setup_app_config app_name)
source_group("Source Files/Source/shaders" FILES ${app_shaders})
endif()

if (IS_DIRECTORY ${GLSLCC_OUT_DIR})
if (IS_DIRECTORY ${AXSLCC_OUT_DIR})
get_target_property(rt_output ${app_name} RUNTIME_OUTPUT_DIRECTORY)
if ((WIN32 AND (NOT WINRT)) OR LINUX)
if (NOT DEFINED AX_PREBUILT_DIR)
ax_sync_target_res(${app_name} LINK_TO "${rt_output}/${CMAKE_CFG_INTDIR}/axslc" FOLDERS ${GLSLCC_OUT_DIR} SYM_LINK 1 SYNC_TARGET_ID axslc)
ax_sync_target_res(${app_name} LINK_TO "${rt_output}/${CMAKE_CFG_INTDIR}/axslc" FOLDERS ${AXSLCC_OUT_DIR} SYM_LINK 1 SYNC_TARGET_ID axslc)
else() # linking with prebuilt, can't use symlink
ax_sync_target_res(${app_name} LINK_TO "${rt_output}/${CMAKE_CFG_INTDIR}/axslc" FOLDERS ${GLSLCC_OUT_DIR} SYNC_TARGET_ID axslc)
ax_sync_target_res(${app_name} LINK_TO "${rt_output}/${CMAKE_CFG_INTDIR}/axslc" FOLDERS ${AXSLCC_OUT_DIR} SYNC_TARGET_ID axslc)
endif()
elseif(APPLE)
if (CMAKE_GENERATOR MATCHES "Xcode")
set_target_properties(${app_name} PROPERTIES XCODE_EMBED_RESOURCES ${GLSLCC_OUT_DIR})
set_target_properties(${app_name} PROPERTIES XCODE_EMBED_RESOURCES ${AXSLCC_OUT_DIR})
else()
get_target_compiled_shaders(shaders ${app_name})
ax_mark_resources(FILES ${shaders} BASEDIR ${GLSLCC_OUT_DIR} RESOURCEBASE "Resources/axslc")
ax_mark_resources(FILES ${shaders} BASEDIR ${AXSLCC_OUT_DIR} RESOURCEBASE "Resources/axslc")
target_sources(${app_name} PRIVATE ${shaders})
endif()
elseif(WINRT OR WASM)
Expand All @@ -521,7 +521,7 @@ function(ax_setup_app_config app_name)
else()
# --preload-file
# refer to: https://emscripten.org/docs/porting/files/packaging_files.html
target_link_options(${app_name} PRIVATE "--preload-file" ${GLSLCC_OUT_DIR}@axslc/)
target_link_options(${app_name} PRIVATE "--preload-file" ${AXSLCC_OUT_DIR}@axslc/)
endif()
endif()
endif()
Expand Down
14 changes: 7 additions & 7 deletions cmake/Modules/AXBuildSet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ endif()
# hold the extensions list to auto link to app
set(_AX_EXTENSION_LIBS "" CACHE INTERNAL "extensions for auto link to target application")

# configure android GLSLCC compile output, this is the first include cmake module
# configure android AXSLCC compile output, this is the first include cmake module
if (ANDROID)
file(TO_NATIVE_PATH "${_AX_ANDROID_PROJECT_DIR}/build/runtime/axslc" _GLSLCC_OUT_DIR)
set(GLSLCC_OUT_DIR "${_GLSLCC_OUT_DIR}" CACHE STRING "" FORCE)
message(AUTHOR_WARNING "Set GLSLCC_OUT_DIR to ${GLSLCC_OUT_DIR} for android")
file(TO_NATIVE_PATH "${_AX_ANDROID_PROJECT_DIR}/build/runtime/axslc" _AXSLCC_OUT_DIR)
set(AXSLCC_OUT_DIR "${_AXSLCC_OUT_DIR}" CACHE STRING "" FORCE)
message(AUTHOR_WARNING "Set AXSLCC_OUT_DIR to ${AXSLCC_OUT_DIR} for android")
endif()

# import minimal AXGLSLCC.cmake for shader compiler support
# import minimal axslcc.cmake for shader compiler support
# the function: ax_target_compile_shaders avaiable from it
set(GLSLCC_FIND_PROG_ROOT "${_AX_ROOT}/tools/external/glslcc" "$ENV{AX_ROOT}/tools/external/glslcc")
include(AXGLSLCC)
set(AXSLCC_FIND_PROG_ROOT "${_AX_ROOT}/tools/external/axslcc" "$ENV{AX_ROOT}/tools/external/axslcc")
include(AXSLCC)

# include helper functions
include(AXBuildHelpers)
Expand Down
10 changes: 5 additions & 5 deletions cmake/Modules/AXLinkHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ endmacro()
function(ax_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
# stupid: exclude CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG to avoid cmake generate
# .vcxproj with incorrect debug msvc runtime, should be /MDd but got /MD
set(GLSLCC_OUT_DIR_PROJ "${GLSLCC_OUT_DIR}")
set(AXSLCC_OUT_DIR_PROJ "${AXSLCC_OUT_DIR}")
load_cache("${AX_ROOT_DIR}/${AX_PREBUILT_DIR}" EXCLUDE thirdparty_LIB_DEPENDS CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG)
set(GLSLCC_OUT_DIR_ENGINE ${GLSLCC_OUT_DIR})
set(GLSLCC_OUT_DIR "${GLSLCC_OUT_DIR_PROJ}" CACHE STRING "" FORCE)
unset(GLSLCC_OUT_DIR_PROJ)
set(AXSLCC_OUT_DIR_ENGINE ${AXSLCC_OUT_DIR})
set(AXSLCC_OUT_DIR "${AXSLCC_OUT_DIR_PROJ}" CACHE STRING "" FORCE)
unset(AXSLCC_OUT_DIR_PROJ)

message(STATUS "AX_ENABLE_MSEDGE_WEBVIEW2=${AX_ENABLE_MSEDGE_WEBVIEW2}")
message(STATUS "AX_ENABLE_MFMEDIA=${AX_ENABLE_MFMEDIA}")
Expand Down Expand Up @@ -280,7 +280,7 @@ function(ax_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)

# prebuilt, need copy axslc folder to target output directory
get_target_property(rt_output ${APP_NAME} RUNTIME_OUTPUT_DIRECTORY)
ax_sync_target_res(${APP_NAME} LINK_TO "${rt_output}/${CMAKE_CFG_INTDIR}/axslc" FOLDERS ${GLSLCC_OUT_DIR_ENGINE} SYNC_TARGET_ID axslc-builtin)
ax_sync_target_res(${APP_NAME} LINK_TO "${rt_output}/${CMAKE_CFG_INTDIR}/axslc" FOLDERS ${AXSLCC_OUT_DIR_ENGINE} SYNC_TARGET_ID axslc-builtin)
endfunction(ax_link_cxx_prebuilt)

function(ax_link_lua_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
Expand Down
80 changes: 40 additions & 40 deletions cmake/Modules/AXGLSLCC.cmake → cmake/Modules/AXSLCC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,49 @@ cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW)

##############################################################
## enable shader lang by shader compiler: glslcc
macro(glslcc_option variable value)
## enable shader lang by shader compiler: axslcc
macro(axslcc_option variable value)
if(NOT DEFINED ${variable})
set(${variable} ${value} CACHE STATIC "" FORCE)
endif()
endmacro()

glslcc_option(GLSLCC_FRAG_SOURCE_FILE_EXTENSIONS ".frag;.fsh;.fs")
glslcc_option(GLSLCC_VERT_SOURCE_FILE_EXTENSIONS ".vert;.vsh;.vs")
glslcc_option(GLSLCC_OUT_DIR ${CMAKE_BINARY_DIR}/runtime/axslc)
glslcc_option(GLSLCC_FIND_PROG_ROOT "")
axslcc_option(AXSLCC_FRAG_SOURCE_FILE_EXTENSIONS ".frag;.fsh;.fs")
axslcc_option(AXSLCC_VERT_SOURCE_FILE_EXTENSIONS ".vert;.vsh;.vs")
axslcc_option(AXSLCC_OUT_DIR ${CMAKE_BINARY_DIR}/runtime/axslc)
axslcc_option(AXSLCC_FIND_PROG_ROOT "")

find_program(GLSLCC_EXE NAMES glslcc
PATHS ${GLSLCC_FIND_PROG_ROOT}
find_program(AXSLCC_EXE NAMES axslcc
PATHS ${AXSLCC_FIND_PROG_ROOT}
)

if (NOT GLSLCC_EXE)
message(STATUS, "glslcc not found.")
message(FATAL_ERROR "Please run setup.ps1 again to download glslcc, and run CMake again.")
if (NOT AXSLCC_EXE)
message(STATUS, "axslcc not found.")
message(FATAL_ERROR "Please run setup.ps1 again to download axslcc, and run CMake again.")
endif()

message(STATUS "GLSLCC_OUT_DIR=${GLSLCC_OUT_DIR}")
message(STATUS "GLSLCC_FIND_PROG_ROOT=${GLSLCC_FIND_PROG_ROOT}")
message(STATUS "GLSLCC_FRAG_SOURCE_FILE_EXTENSIONS=${GLSLCC_FRAG_SOURCE_FILE_EXTENSIONS}")
message(STATUS "GLSLCC_VERT_SOURCE_FILE_EXTENSIONS=${GLSLCC_VERT_SOURCE_FILE_EXTENSIONS}")
message(STATUS "AXSLCC_OUT_DIR=${AXSLCC_OUT_DIR}")
message(STATUS "AXSLCC_FIND_PROG_ROOT=${AXSLCC_FIND_PROG_ROOT}")
message(STATUS "AXSLCC_FRAG_SOURCE_FILE_EXTENSIONS=${AXSLCC_FRAG_SOURCE_FILE_EXTENSIONS}")
message(STATUS "AXSLCC_VERT_SOURCE_FILE_EXTENSIONS=${AXSLCC_VERT_SOURCE_FILE_EXTENSIONS}")

# PROPERTY: include direcotries (optional)
define_property(SOURCE PROPERTY GLSLCC_INCLUDE_DIRS
define_property(SOURCE PROPERTY AXSLCC_INCLUDE_DIRS
BRIEF_DOCS "Compiled shader include directories"
FULL_DOCS "Compiled shader include directories, seperated with comma")

# PROPERTY: defines (optional) TODO: rename to PREPROCESSOR_LIST
define_property(SOURCE PROPERTY GLSLCC_DEFINES
define_property(SOURCE PROPERTY AXSLCC_DEFINES
BRIEF_DOCS "Compiled shader defines"
FULL_DOCS "Compiled shader defines, seperated with comma")

# PROPERTY: output1 (optional) TODO: rename to PREPROCESSOR_LIST
define_property(SOURCE PROPERTY GLSLCC_OUTPUT1
define_property(SOURCE PROPERTY AXSLCC_OUTPUT1
BRIEF_DOCS "Compiled shader output1 additional defines"
FULL_DOCS "Compiled shader output1 additional defines, seperated with comma")

# PROPERTY: glscc output (optional)
define_property(SOURCE PROPERTY GLSLCC_OUTPUT
define_property(SOURCE PROPERTY AXSLCC_OUTPUT
BRIEF_DOCS "The compiled sources shader output path list"
FULL_DOCS "The compiled shaders output list, seperated with comma")

Expand All @@ -58,10 +58,10 @@ function (ax_find_shaders dir varName)
cmake_parse_arguments(opt "${options}" "" "" ${ARGN})

set(SC_FILTERS "")
foreach(fileext ${GLSLCC_FRAG_SOURCE_FILE_EXTENSIONS})
foreach(fileext ${AXSLCC_FRAG_SOURCE_FILE_EXTENSIONS})
list(APPEND SC_FILTERS "${dir}/*${fileext}")
endforeach()
foreach(fileext ${GLSLCC_VERT_SOURCE_FILE_EXTENSIONS})
foreach(fileext ${AXSLCC_VERT_SOURCE_FILE_EXTENSIONS})
list(APPEND SC_FILTERS "${dir}/*${fileext}")
endforeach()
if (opt_RECURSE)
Expand All @@ -72,14 +72,14 @@ function (ax_find_shaders dir varName)
set(${varName} ${out_files} PARENT_SCOPE)
endfunction()

# This function allow make shader files (.frag, .vert) compiled with glslcc
# This function allow make shader files (.frag, .vert) compiled with axslcc
# usage:
# - ax_target_compile_shaders(axmol FILES source_files): output compiled shader to ${CMAKE_BINARY_DIR}/runtime/axslc/xxx_fs
# - ax_target_compile_shaders(axmol FILES source_files CUSTOM): output compiled shader to ${CMAKE_BINARY_DIR}/runtime/axslc/custom/xxx_fs
# - ax_target_compile_shaders(axmol FILES source_files CVAR): the shader will compiled to c hex header for embed include by C/C++ use
# Use global variable to control shader file extension:
# - GLSLCC_FRAG_SOURCE_FILE_EXTENSIONS: default is .frag;.fsh
# - GLSLCC_VERT_SOURCE_FILE_EXTENSIONS: default is .vert;.vsh
# - AXSLCC_FRAG_SOURCE_FILE_EXTENSIONS: default is .frag;.fsh
# - AXSLCC_VERT_SOURCE_FILE_EXTENSIONS: default is .vert;.vsh
#
function (ax_target_compile_shaders target_name)
set(options RUNTIME CVAR CUSTOM)
Expand Down Expand Up @@ -127,7 +127,7 @@ function (ax_target_compile_shaders target_name)
list(APPEND SC_FLAGS "--automap" "--no-suffix")

# defines
get_source_file_property(SOURCE_SC_DEFINES ${SC_FILE} GLSLCC_DEFINES)
get_source_file_property(SOURCE_SC_DEFINES ${SC_FILE} AXSLCC_DEFINES)
if (NOT (SOURCE_SC_DEFINES STREQUAL "NOTFOUND"))
set(SC_DEFINES "${SC_DEFINES},${SOURCE_SC_DEFINES}")
endif()
Expand All @@ -137,7 +137,7 @@ function (ax_target_compile_shaders target_name)
endif()

# includes
get_source_file_property(INC_DIRS ${SC_FILE} GLSLCC_INCLUDE_DIRS)
get_source_file_property(INC_DIRS ${SC_FILE} AXSLCC_INCLUDE_DIRS)
if (INC_DIRS STREQUAL "NOTFOUND")
set(INC_DIRS "")
endif()
Expand All @@ -154,18 +154,18 @@ function (ax_target_compile_shaders target_name)
endif()

# input
if (${FILE_EXT} IN_LIST GLSLCC_FRAG_SOURCE_FILE_EXTENSIONS)
if (${FILE_EXT} IN_LIST AXSLCC_FRAG_SOURCE_FILE_EXTENSIONS)
list(APPEND SC_FLAGS "--frag=${SC_FILE}")
set(SC_TYPE "fs")
elseif(${FILE_EXT} IN_LIST GLSLCC_VERT_SOURCE_FILE_EXTENSIONS)
elseif(${FILE_EXT} IN_LIST AXSLCC_VERT_SOURCE_FILE_EXTENSIONS)
set(SC_TYPE "vs")
list(APPEND SC_FLAGS "--vert=${SC_FILE}")
else()
message(FATAL_ERROR "Invalid shader source, the file extesion must be one of .frag;.vert")
endif()

# output
set(OUT_DIR ${GLSLCC_OUT_DIR})
set(OUT_DIR ${AXSLCC_OUT_DIR})
if(opt_CUSTOM)
set(OUT_DIR "${OUT_DIR}/custom")
endif()
Expand All @@ -177,14 +177,14 @@ function (ax_target_compile_shaders target_name)

set(SC_COMMENT "Compiling shader ${SC_FILE} for ${OUT_LANG}${SC_PROFILE} ...")

get_source_file_property(SOURCE_SC_OUTPUT1 ${SC_FILE} GLSLCC_OUTPUT1)
get_source_file_property(SOURCE_SC_OUTPUT1 ${SC_FILE} AXSLCC_OUTPUT1)

string(REPLACE ";" " " FULL_COMMAND_LINE "${GLSLCC_EXE};${SC_FLAGS} ...")
string(REPLACE ";" " " FULL_COMMAND_LINE "${AXSLCC_EXE};${SC_FLAGS} ...")
if(SOURCE_SC_OUTPUT1 STREQUAL "NOTFOUND") # single output
list(APPEND SC_FLAGS "--output=${SC_OUTPUT}")
set_source_files_properties(${SC_FILE} DIRECTORY ${CMAKE_BINARY_DIR} PROPERTIES GLSLCC_OUTPUT ${SC_OUTPUT})
set_source_files_properties(${SC_FILE} DIRECTORY ${CMAKE_BINARY_DIR} PROPERTIES AXSLCC_OUTPUT ${SC_OUTPUT})
add_custom_command(
MAIN_DEPENDENCY ${SC_FILE} OUTPUT ${SC_OUTPUT} COMMAND ${GLSLCC_EXE} ${SC_FLAGS}
MAIN_DEPENDENCY ${SC_FILE} OUTPUT ${SC_OUTPUT} COMMAND ${AXSLCC_EXE} ${SC_FLAGS}
COMMENT "${SC_COMMENT}"
)
list(APPEND compiled_shaders ${SC_OUTPUT})
Expand All @@ -199,13 +199,13 @@ function (ax_target_compile_shaders target_name)

set(SC_OUTPUT1 "${SC_OUTPUT}_1")
list(APPEND SC_FLAGS1 "--output=${SC_OUTPUT1}")
string(REPLACE ";" " " FULL_COMMAND_LINE1 "${GLSLCC_EXE};${SC_FLAGS1} ...")
set_source_files_properties(${SC_FILE} DIRECTORY ${CMAKE_BINARY_DIR} PROPERTIES GLSLCC_OUTPUT "${SC_OUTPUT};${SC_OUTPUT1}")
string(REPLACE ";" " " FULL_COMMAND_LINE1 "${AXSLCC_EXE};${SC_FLAGS1} ...")
set_source_files_properties(${SC_FILE} DIRECTORY ${CMAKE_BINARY_DIR} PROPERTIES AXSLCC_OUTPUT "${SC_OUTPUT};${SC_OUTPUT1}")
add_custom_command(
MAIN_DEPENDENCY ${SC_FILE}
OUTPUT ${SC_OUTPUT} ${SC_OUTPUT1}
COMMAND ${GLSLCC_EXE} ${SC_FLAGS}
COMMAND ${GLSLCC_EXE} ${SC_FLAGS1}
COMMAND ${AXSLCC_EXE} ${SC_FLAGS}
COMMAND ${AXSLCC_EXE} ${SC_FLAGS1}
COMMENT "${SC_COMMENT}"
)
list(APPEND compiled_shaders ${SC_OUTPUT} ${SC_OUTPUT1})
Expand Down Expand Up @@ -235,12 +235,12 @@ function(ax_target_embed_compiled_shaders target_name rc_output)
string(APPEND _props_xml_content "<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n")
string(APPEND _props_xml_content " <ItemGroup Label=\"axslc\">\n")
foreach(shader ${opt_FILES})
get_source_file_property(compiled_shaders ${shader} DIRECTORY ${CMAKE_BINARY_DIR} GLSLCC_OUTPUT)
get_source_file_property(compiled_shaders ${shader} DIRECTORY ${CMAKE_BINARY_DIR} AXSLCC_OUTPUT)
if(compiled_shaders STREQUAL "NOTFOUND")
message(FATAL_ERROR "Not found property GLSLCC_OUTPUT of file: ${shader}")
message(FATAL_ERROR "Not found property AXSLCC_OUTPUT of file: ${shader}")
endif()
foreach(compiled_shader ${compiled_shaders})
file(RELATIVE_PATH compiled_shader_rp ${GLSLCC_OUT_DIR} ${compiled_shader})
file(RELATIVE_PATH compiled_shader_rp ${AXSLCC_OUT_DIR} ${compiled_shader})
file(TO_NATIVE_PATH "Content/axslc/${compiled_shader_rp}" compiled_shader_target_dir)
file(TO_NATIVE_PATH "${compiled_shader}" compiled_shader_path)
set(app_all_shaders_filters "${app_all_shaders_filters} <ItemGroup Label=\"axslc\">\n")
Expand Down
4 changes: 2 additions & 2 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,14 @@ set_source_files_properties(
${_AX_ROOT}/core/renderer/shaders/colorNormalTexture.frag
${_AX_ROOT}/core/renderer/shaders/positionNormalTexture.vert
${_AX_ROOT}/core/renderer/shaders/skinPositionNormalTexture.vert
PROPERTIES GLSLCC_DEFINES
PROPERTIES AXSLCC_DEFINES
"MAX_DIRECTIONAL_LIGHT_NUM=${AX_MAX_DIRECTIONAL_LIGHT},MAX_POINT_LIGHT_NUM=${AX_MAX_POINT_LIGHT},MAX_SPOT_LIGHT_NUM=${AX_MAX_SPOT_LIGHT}"
)
set_source_files_properties(
${_AX_ROOT}/core/renderer/shaders/colorNormalTexture.frag
${_AX_ROOT}/core/renderer/shaders/positionNormalTexture.vert
${_AX_ROOT}/core/renderer/shaders/skinPositionNormalTexture.vert
PROPERTIES GLSLCC_OUTPUT1 "USE_NORMAL_MAPPING=1"
PROPERTIES AXSLCC_OUTPUT1 "USE_NORMAL_MAPPING=1"
)
ax_target_compile_shaders(${_AX_CORE_LIB} FILES ${BUILTIN_SHADER_SOURCES})

Expand Down
2 changes: 1 addition & 1 deletion core/renderer/backend/ProgramState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <algorithm>
#include "xxhash/xxhash.h"

#include "glslcc/sgs-spec.h"
#include "axslcc/sgs-spec.h"

NS_AX_BACKEND_BEGIN

Expand Down
Loading

0 comments on commit e9d51ed

Please sign in to comment.