Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
eaecfe71
Commit
eaecfe71
authored
Jan 09, 2017
by
John Kessenich
Committed by
GitHub
Jan 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #668 from slime73/DisableHLSL
Add a CMake option to disable compilation of HLSL input support.
parents
5d89d4d4
ff21a25b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
+30
-4
CMakeLists.txt
CMakeLists.txt
+9
-1
CMakeLists.txt
StandAlone/CMakeLists.txt
+4
-1
ShaderLang.cpp
glslang/MachineIndependent/ShaderLang.cpp
+17
-2
No files found.
CMakeLists.txt
View file @
eaecfe71
...
...
@@ -6,6 +6,8 @@ option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)
option
(
ENABLE_NV_EXTENSIONS
"Enables support of Nvidia-specific extensions"
ON
)
option
(
ENABLE_HLSL
"Enables HLSL input support"
ON
)
enable_testing
()
set
(
CMAKE_INSTALL_PREFIX
"install"
CACHE STRING
"prefix"
)
...
...
@@ -20,6 +22,10 @@ if(ENABLE_NV_EXTENSIONS)
add_definitions
(
-DNV_EXTENSIONS
)
endif
(
ENABLE_NV_EXTENSIONS
)
if
(
ENABLE_HLSL
)
add_definitions
(
-DENABLE_HLSL
)
endif
(
ENABLE_HLSL
)
if
(
WIN32
)
set
(
CMAKE_DEBUG_POSTFIX
"d"
)
include
(
ChooseMSVCCRT.cmake
)
...
...
@@ -63,5 +69,7 @@ if(ENABLE_GLSLANG_BINARIES)
add_subdirectory
(
StandAlone
)
endif
()
add_subdirectory
(
SPIRV
)
add_subdirectory
(
hlsl
)
if
(
ENABLE_HLSL
)
add_subdirectory
(
hlsl
)
endif
()
add_subdirectory
(
gtests
)
StandAlone/CMakeLists.txt
View file @
eaecfe71
...
...
@@ -22,11 +22,14 @@ set(LIBRARIES
glslang
OGLCompiler
OSDependent
HLSL
SPIRV
SPVRemapper
glslang-default-resource-limits
)
if
(
ENABLE_HLSL
)
set
(
LIBRARIES
${
LIBRARIES
}
HLSL
)
endif
()
if
(
WIN32
)
set
(
LIBRARIES
${
LIBRARIES
}
psapi
)
elseif
(
UNIX
)
...
...
glslang/MachineIndependent/ShaderLang.cpp
View file @
eaecfe71
...
...
@@ -47,11 +47,14 @@
#include <memory>
#include "SymbolTable.h"
#include "ParseHelper.h"
#include "../../hlsl/hlslParseHelper.h"
#include "../../hlsl/hlslParseables.h"
#include "Scan.h"
#include "ScanContext.h"
#ifdef ENABLE_HLSL
#include "../../hlsl/hlslParseHelper.h"
#include "../../hlsl/hlslParseables.h"
#include "../../hlsl/hlslScanContext.h"
#endif
#include "../Include/ShHandle.h"
#include "../../OGLCompilersDLL/InitializeDll.h"
...
...
@@ -73,7 +76,9 @@ TBuiltInParseables* CreateBuiltInParseables(TInfoSink& infoSink, EShSource sourc
{
switch
(
source
)
{
case
EShSourceGlsl
:
return
new
TBuiltIns
();
// GLSL builtIns
#ifdef ENABLE_HLSL
case
EShSourceHlsl
:
return
new
TBuiltInParseablesHlsl
();
// HLSL intrinsics
#endif
default:
infoSink
.
info
.
message
(
EPrefixInternalError
,
"Unable to determine source language"
);
...
...
@@ -88,15 +93,21 @@ TParseContextBase* CreateParseContext(TSymbolTable& symbolTable, TIntermediate&
SpvVersion
spvVersion
,
bool
forwardCompatible
,
EShMessages
messages
,
bool
parsingBuiltIns
,
const
std
::
string
sourceEntryPointName
=
""
)
{
#ifndef ENABLE_HLSL
(
void
)
sourceEntryPointName
;
// Unused argument.
#endif
switch
(
source
)
{
case
EShSourceGlsl
:
intermediate
.
setEntryPointName
(
"main"
);
return
new
TParseContext
(
symbolTable
,
intermediate
,
parsingBuiltIns
,
version
,
profile
,
spvVersion
,
language
,
infoSink
,
forwardCompatible
,
messages
);
#ifdef ENABLE_HLSL
case
EShSourceHlsl
:
return
new
HlslParseContext
(
symbolTable
,
intermediate
,
parsingBuiltIns
,
version
,
profile
,
spvVersion
,
language
,
infoSink
,
sourceEntryPointName
.
c_str
(),
forwardCompatible
,
messages
);
#endif
default:
infoSink
.
info
.
message
(
EPrefixInternalError
,
"Unable to determine source language"
);
return
nullptr
;
...
...
@@ -1085,7 +1096,9 @@ int ShInitialize()
PerProcessGPA
=
new
TPoolAllocator
();
glslang
::
TScanContext
::
fillInKeywordMap
();
#ifdef ENABLE_HLSL
glslang
::
HlslScanContext
::
fillInKeywordMap
();
#endif
return
1
;
}
...
...
@@ -1178,7 +1191,9 @@ int __fastcall ShFinalize()
}
glslang
::
TScanContext
::
deleteKeywordMap
();
#ifdef ENABLE_HLSL
glslang
::
HlslScanContext
::
deleteKeywordMap
();
#endif
return
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment