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
a50a9de3
Unverified
Commit
a50a9de3
authored
Nov 09, 2017
by
John Kessenich
Committed by
GitHub
Nov 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1116 from LoopDawg/reverse-shift-args
Reverse order of setShiftBindingForSet parameters
parents
7c2f6d85
e570955c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
16 deletions
+16
-16
StandAlone.cpp
StandAlone/StandAlone.cpp
+10
-10
runtests
Test/runtests
+1
-1
ShaderLang.cpp
glslang/MachineIndependent/ShaderLang.cpp
+2
-2
localintermediate.h
glslang/MachineIndependent/localintermediate.h
+2
-2
ShaderLang.h
glslang/Public/ShaderLang.h
+1
-1
No files found.
StandAlone/StandAlone.cpp
View file @
a50a9de3
...
@@ -268,7 +268,7 @@ void Error(const char* message)
...
@@ -268,7 +268,7 @@ void Error(const char* message)
//
//
// Process an optional binding base of one the forms:
// Process an optional binding base of one the forms:
// --argname [stage] base // base for stage (if given) or all stages (if not)
// --argname [stage] base // base for stage (if given) or all stages (if not)
// --argname [stage] [
set base
]... // set/base pairs: set the base for given binding set.
// --argname [stage] [
base set
]... // set/base pairs: set the base for given binding set.
// Where stage is one of the forms accepted by FindLanguage, and base is an integer
// Where stage is one of the forms accepted by FindLanguage, and base is an integer
//
//
...
@@ -293,8 +293,8 @@ void ProcessBindingBase(int& argc, char**& argv, glslang::TResourceType res)
...
@@ -293,8 +293,8 @@ void ProcessBindingBase(int& argc, char**& argv, glslang::TResourceType res)
if
((
argc
-
arg
)
>
2
&&
isdigit
(
argv
[
arg
+
0
][
0
])
&&
isdigit
(
argv
[
arg
+
1
][
0
]))
{
if
((
argc
-
arg
)
>
2
&&
isdigit
(
argv
[
arg
+
0
][
0
])
&&
isdigit
(
argv
[
arg
+
1
][
0
]))
{
// Parse a per-set binding base
// Parse a per-set binding base
while
((
argc
-
arg
)
>
2
&&
isdigit
(
argv
[
arg
+
0
][
0
])
&&
isdigit
(
argv
[
arg
+
1
][
0
]))
{
while
((
argc
-
arg
)
>
2
&&
isdigit
(
argv
[
arg
+
0
][
0
])
&&
isdigit
(
argv
[
arg
+
1
][
0
]))
{
const
int
setNum
=
atoi
(
argv
[
arg
++
]);
const
int
baseNum
=
atoi
(
argv
[
arg
++
]);
const
int
baseNum
=
atoi
(
argv
[
arg
++
]);
const
int
setNum
=
atoi
(
argv
[
arg
++
]);
perSetBase
[
setNum
]
=
baseNum
;
perSetBase
[
setNum
]
=
baseNum
;
}
}
}
else
{
}
else
{
...
@@ -821,7 +821,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
...
@@ -821,7 +821,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
// TODO: use a range based for loop here, when available in all environments.
// TODO: use a range based for loop here, when available in all environments.
for
(
auto
i
=
baseBindingForSet
[
res
][
compUnit
.
stage
].
begin
();
for
(
auto
i
=
baseBindingForSet
[
res
][
compUnit
.
stage
].
begin
();
i
!=
baseBindingForSet
[
res
][
compUnit
.
stage
].
end
();
++
i
)
i
!=
baseBindingForSet
[
res
][
compUnit
.
stage
].
end
();
++
i
)
shader
->
setShiftBindingForSet
(
res
,
i
->
first
,
i
->
second
);
shader
->
setShiftBindingForSet
(
res
,
i
->
second
,
i
->
first
);
}
}
shader
->
setFlattenUniformArrays
((
Options
&
EOptionFlattenUniformArrays
)
!=
0
);
shader
->
setFlattenUniformArrays
((
Options
&
EOptionFlattenUniformArrays
)
!=
0
);
...
@@ -1302,24 +1302,24 @@ void usage()
...
@@ -1302,24 +1302,24 @@ void usage()
" Set descriptor set for all resources
\n
"
" Set descriptor set for all resources
\n
"
" --rsb [stage] type set binding synonym for --resource-set-binding
\n
"
" --rsb [stage] type set binding synonym for --resource-set-binding
\n
"
" --shift-image-binding [stage] num base binding number for images (uav)
\n
"
" --shift-image-binding [stage] num base binding number for images (uav)
\n
"
" --shift-image-binding [stage] [
set num
]... per-descriptor-set shift values
\n
"
" --shift-image-binding [stage] [
num set
]... per-descriptor-set shift values
\n
"
" --sib [stage] num synonym for --shift-image-binding
\n
"
" --sib [stage] num synonym for --shift-image-binding
\n
"
" --shift-sampler-binding [stage] num base binding number for samplers
\n
"
" --shift-sampler-binding [stage] num base binding number for samplers
\n
"
" --shift-sampler-binding [stage] [
set num
]... per-descriptor-set shift values
\n
"
" --shift-sampler-binding [stage] [
num set
]... per-descriptor-set shift values
\n
"
" --ssb [stage] num synonym for --shift-sampler-binding
\n
"
" --ssb [stage] num synonym for --shift-sampler-binding
\n
"
" --shift-ssbo-binding [stage] num base binding number for SSBOs
\n
"
" --shift-ssbo-binding [stage] num base binding number for SSBOs
\n
"
" --shift-ssbo-binding [stage] [
set num
]... per-descriptor-set shift values
\n
"
" --shift-ssbo-binding [stage] [
num set
]... per-descriptor-set shift values
\n
"
" --sbb [stage] num synonym for --shift-ssbo-binding
\n
"
" --sbb [stage] num synonym for --shift-ssbo-binding
\n
"
" --shift-texture-binding [stage] num base binding number for textures
\n
"
" --shift-texture-binding [stage] num base binding number for textures
\n
"
" --shift-texture-binding [stage] [
set num
]... per-descriptor-set shift values
\n
"
" --shift-texture-binding [stage] [
num set
]... per-descriptor-set shift values
\n
"
" --stb [stage] num synonym for --shift-texture-binding
\n
"
" --stb [stage] num synonym for --shift-texture-binding
\n
"
" --shift-uav-binding [stage] num base binding number for UAVs
\n
"
" --shift-uav-binding [stage] num base binding number for UAVs
\n
"
" --shift-uav-binding [stage] [
set num
]... per-descriptor-set shift values
\n
"
" --shift-uav-binding [stage] [
num set
]... per-descriptor-set shift values
\n
"
" --suavb [stage] num synonym for --shift-uav-binding
\n
"
" --suavb [stage] num synonym for --shift-uav-binding
\n
"
" --shift-UBO-binding [stage] num base binding number for UBOs
\n
"
" --shift-UBO-binding [stage] num base binding number for UBOs
\n
"
" --shift-UBO-binding [stage] [
set num
]... per-descriptor-set shift values
\n
"
" --shift-UBO-binding [stage] [
num set
]... per-descriptor-set shift values
\n
"
" --shift-cbuffer-binding [stage] num synonym for --shift-UBO-binding
\n
"
" --shift-cbuffer-binding [stage] num synonym for --shift-UBO-binding
\n
"
" --shift-cbuffer-binding [stage] [
set num
]... per-descriptor-set shift values
\n
"
" --shift-cbuffer-binding [stage] [
num set
]... per-descriptor-set shift values
\n
"
" --sub [stage] num synonym for --shift-UBO-binding
\n
"
" --sub [stage] num synonym for --shift-UBO-binding
\n
"
" --source-entrypoint <name> the given shader source function is
\n
"
" --source-entrypoint <name> the given shader source function is
\n
"
" renamed to be the <name> given in -e
\n
"
" renamed to be the <name> given in -e
\n
"
...
...
Test/runtests
View file @
a50a9de3
...
@@ -108,7 +108,7 @@ diff -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out $TARGETDIR/hlsl.explicitD
...
@@ -108,7 +108,7 @@ diff -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out $TARGETDIR/hlsl.explicitD
# Testing per-descriptor-set IO map shift
# Testing per-descriptor-set IO map shift
#
#
echo
'Testing per-descriptor-set IO map shift'
echo
'Testing per-descriptor-set IO map shift'
$EXE
-e
main
--hlsl-iomap
--ssb
1
10 2 15
--stb
20
--stb
2 25
--suavb
30
--suavb
2 40
--sub
6 50
-i
-q
-D
-V
hlsl.shift.per-set.frag
>
$TARGETDIR
/hlsl.shift.per-set.frag.out
||
HASERROR
=
1
$EXE
-e
main
--hlsl-iomap
--ssb
1
0 1 15 2
--stb
20
--stb
25 2
--suavb
30
--suavb
40 2
--sub
50 6
-i
-q
-D
-V
hlsl.shift.per-set.frag
>
$TARGETDIR
/hlsl.shift.per-set.frag.out
||
HASERROR
=
1
diff
-b
$BASEDIR
/hlsl.shift.per-set.frag.out
$TARGETDIR
/hlsl.shift.per-set.frag.out
||
HASERROR
=
1
diff
-b
$BASEDIR
/hlsl.shift.per-set.frag.out
$TARGETDIR
/hlsl.shift.per-set.frag.out
||
HASERROR
=
1
#
#
...
...
glslang/MachineIndependent/ShaderLang.cpp
View file @
a50a9de3
...
@@ -1667,8 +1667,8 @@ void TShader::setShiftBinding(TResourceType res, unsigned int base) {
...
@@ -1667,8 +1667,8 @@ void TShader::setShiftBinding(TResourceType res, unsigned int base) {
}
}
// Set binding base for given resource type for a given binding set.
// Set binding base for given resource type for a given binding set.
void
TShader
::
setShiftBindingForSet
(
TResourceType
res
,
unsigned
int
set
,
unsigned
int
base
)
{
void
TShader
::
setShiftBindingForSet
(
TResourceType
res
,
unsigned
int
base
,
unsigned
int
set
)
{
intermediate
->
setShiftBindingForSet
(
res
,
set
,
base
);
intermediate
->
setShiftBindingForSet
(
res
,
base
,
set
);
}
}
// Set binding base for sampler types
// Set binding base for sampler types
...
...
glslang/MachineIndependent/localintermediate.h
View file @
a50a9de3
...
@@ -271,7 +271,7 @@ public:
...
@@ -271,7 +271,7 @@ public:
unsigned
int
getShiftBinding
(
TResourceType
res
)
const
{
return
shiftBinding
[
res
];
}
unsigned
int
getShiftBinding
(
TResourceType
res
)
const
{
return
shiftBinding
[
res
];
}
void
setShiftBindingForSet
(
TResourceType
res
,
unsigned
int
s
et
,
unsigned
int
shif
t
)
void
setShiftBindingForSet
(
TResourceType
res
,
unsigned
int
s
hift
,
unsigned
int
se
t
)
{
{
if
(
shift
==
0
)
// ignore if there's no shift: it's a no-op.
if
(
shift
==
0
)
// ignore if there's no shift: it's a no-op.
return
;
return
;
...
@@ -281,8 +281,8 @@ public:
...
@@ -281,8 +281,8 @@ public:
const
char
*
name
=
getResourceName
(
res
);
const
char
*
name
=
getResourceName
(
res
);
if
(
name
!=
nullptr
)
{
if
(
name
!=
nullptr
)
{
processes
.
addProcess
(
name
);
processes
.
addProcess
(
name
);
processes
.
addArgument
(
set
);
processes
.
addArgument
(
shift
);
processes
.
addArgument
(
shift
);
processes
.
addArgument
(
set
);
}
}
}
}
...
...
glslang/Public/ShaderLang.h
View file @
a50a9de3
...
@@ -368,7 +368,7 @@ public:
...
@@ -368,7 +368,7 @@ public:
void
setShiftUavBinding
(
unsigned
int
base
);
// DEPRECATED: use setShiftBinding
void
setShiftUavBinding
(
unsigned
int
base
);
// DEPRECATED: use setShiftBinding
void
setShiftCbufferBinding
(
unsigned
int
base
);
// synonym for setShiftUboBinding
void
setShiftCbufferBinding
(
unsigned
int
base
);
// synonym for setShiftUboBinding
void
setShiftSsboBinding
(
unsigned
int
base
);
// DEPRECATED: use setShiftBinding
void
setShiftSsboBinding
(
unsigned
int
base
);
// DEPRECATED: use setShiftBinding
void
setShiftBindingForSet
(
TResourceType
res
,
unsigned
int
set
,
unsigned
int
base
);
void
setShiftBindingForSet
(
TResourceType
res
,
unsigned
int
base
,
unsigned
int
set
);
void
setResourceSetBinding
(
const
std
::
vector
<
std
::
string
>&
base
);
void
setResourceSetBinding
(
const
std
::
vector
<
std
::
string
>&
base
);
void
setAutoMapBindings
(
bool
map
);
void
setAutoMapBindings
(
bool
map
);
void
setAutoMapLocations
(
bool
map
);
void
setAutoMapLocations
(
bool
map
);
...
...
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