Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glslang
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
deqp-deps
glslang
Commits
84eabf7e
Commit
84eabf7e
authored
8 years ago
by
Alex Szpakowski
Browse files
Options
Downloads
Patches
Plain Diff
Add a CMake option to disable compilation of HLSL input support.
parent
5d89d4d4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+9
-1
9 additions, 1 deletion
CMakeLists.txt
StandAlone/CMakeLists.txt
+4
-1
4 additions, 1 deletion
StandAlone/CMakeLists.txt
glslang/MachineIndependent/ShaderLang.cpp
+17
-2
17 additions, 2 deletions
glslang/MachineIndependent/ShaderLang.cpp
with
30 additions
and
4 deletions
CMakeLists.txt
+
9
−
1
View file @
84eabf7e
...
...
@@ -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
(
DISABLE_HLSL
"Disables HLSL input support"
OFF
)
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
(
DISABLE_HLSL
)
add_definitions
(
-DDISABLE_HLSL
)
endif
(
DISABLE_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
(
NOT DISABLE_HLSL
)
add_subdirectory
(
hlsl
)
endif
()
add_subdirectory
(
gtests
)
This diff is collapsed.
Click to expand it.
StandAlone/CMakeLists.txt
+
4
−
1
View file @
84eabf7e
...
...
@@ -22,11 +22,14 @@ set(LIBRARIES
glslang
OGLCompiler
OSDependent
HLSL
SPIRV
SPVRemapper
glslang-default-resource-limits
)
if
(
NOT DISABLE_HLSL
)
set
(
LIBRARIES
${
LIBRARIES
}
HLSL
)
endif
()
if
(
WIN32
)
set
(
LIBRARIES
${
LIBRARIES
}
psapi
)
elseif
(
UNIX
)
...
...
This diff is collapsed.
Click to expand it.
glslang/MachineIndependent/ShaderLang.cpp
+
17
−
2
View file @
84eabf7e
...
...
@@ -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"
#ifndef DISABLE_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
#ifndef DISABLE_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
=
""
)
{
#ifdef DISABLE_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
);
#ifndef DISABLE_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
();
#ifndef DISABLE_HLSL
glslang
::
HlslScanContext
::
fillInKeywordMap
();
#endif
return
1
;
}
...
...
@@ -1178,7 +1191,9 @@ int __fastcall ShFinalize()
}
glslang
::
TScanContext
::
deleteKeywordMap
();
#ifndef DISABLE_HLSL
glslang
::
HlslScanContext
::
deleteKeywordMap
();
#endif
return
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment