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
a353bf1f
Commit
a353bf1f
authored
7 years ago
by
John Kessenich
Browse files
Options
Downloads
Patches
Plain Diff
Nonfunctional: Add reflect test case, and fix long lines in reflection code.
parent
2ceec681
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
Test/baseResults/reflection.vert.out
+8
-0
8 additions, 0 deletions
Test/baseResults/reflection.vert.out
Test/reflection.vert
+24
-0
24 additions, 0 deletions
Test/reflection.vert
glslang/MachineIndependent/reflection.cpp
+17
-9
17 additions, 9 deletions
glslang/MachineIndependent/reflection.cpp
with
49 additions
and
9 deletions
Test/baseResults/reflection.vert.out
+
8
−
0
View file @
a353bf1f
...
...
@@ -70,6 +70,9 @@ deepD[1].d2.d1[3].b: offset -1, type 8b56, size 1, index -1, binding -1
deepD[1].v3: offset -1, type 8b54, size 1, index -1, binding -1
abl.foo: offset 0, type 1406, size 1, index 7, binding -1
abl2.foo: offset 0, type 1406, size 1, index 11, binding -1
buf1.runtimeArray: offset 4, type 1406, size 4, index 12, binding -1
buf2.runtimeArray.c: offset 8, type 1406, size 1, index 13, binding -1
buf3.runtimeArray: offset 4, type 1406, size 0, index 14, binding -1
anonMember1: offset 0, type 8b51, size 1, index 0, binding -1
uf1: offset -1, type 1406, size 1, index -1, binding -1
uf2: offset -1, type 1406, size 1, index -1, binding -1
...
...
@@ -88,6 +91,10 @@ abl2[0]: offset -1, type ffffffff, size 4, index -1, binding -1
abl2[1]: offset -1, type ffffffff, size 4, index -1, binding -1
abl2[2]: offset -1, type ffffffff, size 4, index -1, binding -1
abl2[3]: offset -1, type ffffffff, size 4, index -1, binding -1
buf1: offset -1, type ffffffff, size 4, index -1, binding -1
buf2: offset -1, type ffffffff, size 4, index -1, binding -1
buf3: offset -1, type ffffffff, size 4, index -1, binding -1
buf4: offset -1, type ffffffff, size 4, index -1, binding -1
Vertex attribute reflection:
attributeFloat: offset 0, type 1406, size 0, index 0, binding -1
...
...
@@ -95,4 +102,5 @@ attributeFloat2: offset 0, type 8b50, size 0, index 0, binding -1
attributeFloat3: offset 0, type 8b51, size 0, index 0, binding -1
attributeFloat4: offset 0, type 8b52, size 0, index 0, binding -1
attributeMat4: offset 0, type 8b5c, size 0, index 0, binding -1
gl_InstanceID: offset 0, type 1404, size 0, index 0, binding -1
This diff is collapsed.
Click to expand it.
Test/reflection.vert
+
24
−
0
View file @
a353bf1f
...
...
@@ -133,6 +133,26 @@ uniform abl2 {
float
foo
;
}
arrBl2
[
4
];
buffer
buf1
{
float
scalar
;
float
runtimeArray
[];
}
buf1i
;
buffer
buf2
{
float
scalar
;
N2
runtimeArray
[];
}
buf2i
;
buffer
buf3
{
float
scalar
;
float
runtimeArray
[];
}
buf3i
;
buffer
buf4
{
float
scalar
;
N2
runtimeArray
[];
}
buf4i
;
void
main
()
{
liveFunction1
(
image_ui2D
,
sampler_2D
,
sampler_2DMSArray
);
...
...
@@ -179,4 +199,8 @@ void main()
f
+=
attributeFloat3
.
x
;
f
+=
attributeFloat4
.
x
;
f
+=
attributeMat4
[
0
][
1
];
f
+=
buf1i
.
runtimeArray
[
3
];
f
+=
buf2i
.
runtimeArray
[
3
].
c
;
f
+=
buf3i
.
runtimeArray
[
gl_InstanceID
];
f
+=
buf4i
.
runtimeArray
[
gl_InstanceID
].
c
;
}
This diff is collapsed.
Click to expand it.
glslang/MachineIndependent/reflection.cpp
+
17
−
9
View file @
a353bf1f
...
...
@@ -131,8 +131,11 @@ public:
for
(
int
m
=
0
;
m
<=
index
;
++
m
)
{
// modify just the children's view of matrix layout, if there is one for this member
TLayoutMatrix
subMatrixLayout
=
memberList
[
m
].
type
->
getQualifier
().
layoutMatrix
;
int
memberAlignment
=
intermediate
.
getBaseAlignment
(
*
memberList
[
m
].
type
,
memberSize
,
dummyStride
,
type
.
getQualifier
().
layoutPacking
==
ElpStd140
,
subMatrixLayout
!=
ElmNone
?
subMatrixLayout
==
ElmRowMajor
:
type
.
getQualifier
().
layoutMatrix
==
ElmRowMajor
);
int
memberAlignment
=
intermediate
.
getBaseAlignment
(
*
memberList
[
m
].
type
,
memberSize
,
dummyStride
,
type
.
getQualifier
().
layoutPacking
==
ElpStd140
,
subMatrixLayout
!=
ElmNone
?
subMatrixLayout
==
ElmRowMajor
:
type
.
getQualifier
().
layoutMatrix
==
ElmRowMajor
);
RoundToPow2
(
offset
,
memberAlignment
);
if
(
m
<
index
)
offset
+=
memberSize
;
...
...
@@ -151,7 +154,8 @@ public:
int
lastMemberSize
;
int
dummyStride
;
intermediate
.
getBaseAlignment
(
*
memberList
[
lastIndex
].
type
,
lastMemberSize
,
dummyStride
,
blockType
.
getQualifier
().
layoutPacking
==
ElpStd140
,
intermediate
.
getBaseAlignment
(
*
memberList
[
lastIndex
].
type
,
lastMemberSize
,
dummyStride
,
blockType
.
getQualifier
().
layoutPacking
==
ElpStd140
,
blockType
.
getQualifier
().
layoutMatrix
==
ElmRowMajor
);
return
lastOffset
+
lastMemberSize
;
...
...
@@ -167,7 +171,7 @@ public:
void
blowUpActiveAggregate
(
const
TType
&
baseType
,
const
TString
&
baseName
,
const
TList
<
TIntermBinary
*>&
derefs
,
TList
<
TIntermBinary
*>::
const_iterator
deref
,
int
offset
,
int
blockIndex
,
int
arraySize
)
{
// process the part of the derefence chain that was explicit in the shader
// process the part of the derefe
re
nce chain that was explicit in the shader
TString
name
=
baseName
;
const
TType
*
terminalType
=
&
baseType
;
for
(;
deref
!=
derefs
.
end
();
++
deref
)
{
...
...
@@ -235,7 +239,7 @@ public:
}
// Finally, add a full string to the reflection database, and update the array size if necessary.
// If the derefenced entity to record is an array, compute the size and update the maximum size.
// If the derefe
re
nced entity to record is an array, compute the size and update the maximum size.
// there might not be a final array dereference, it could have been copied as an array object
if
(
arraySize
==
0
)
...
...
@@ -244,7 +248,8 @@ public:
TReflection
::
TNameToIndex
::
const_iterator
it
=
reflection
.
nameToIndex
.
find
(
name
);
if
(
it
==
reflection
.
nameToIndex
.
end
())
{
reflection
.
nameToIndex
[
name
]
=
(
int
)
reflection
.
indexToUniform
.
size
();
reflection
.
indexToUniform
.
push_back
(
TObjectReflection
(
name
,
*
terminalType
,
offset
,
mapToGlType
(
*
terminalType
),
reflection
.
indexToUniform
.
push_back
(
TObjectReflection
(
name
,
*
terminalType
,
offset
,
mapToGlType
(
*
terminalType
),
arraySize
,
blockIndex
));
}
else
if
(
arraySize
>
1
)
{
int
&
reflectedArraySize
=
reflection
.
indexToUniform
[
it
->
second
].
size
;
...
...
@@ -417,7 +422,8 @@ public:
case
Esd2D
:
switch
((
int
)
sampler
.
ms
)
{
case
false
:
return
sampler
.
arrayed
?
GL_INT_SAMPLER_2D_ARRAY
:
GL_INT_SAMPLER_2D
;
case
true
:
return
sampler
.
arrayed
?
GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
:
GL_INT_SAMPLER_2D_MULTISAMPLE
;
case
true
:
return
sampler
.
arrayed
?
GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
:
GL_INT_SAMPLER_2D_MULTISAMPLE
;
}
case
Esd3D
:
return
GL_INT_SAMPLER_3D
;
...
...
@@ -435,7 +441,8 @@ public:
case
Esd2D
:
switch
((
int
)
sampler
.
ms
)
{
case
false
:
return
sampler
.
arrayed
?
GL_UNSIGNED_INT_SAMPLER_2D_ARRAY
:
GL_UNSIGNED_INT_SAMPLER_2D
;
case
true
:
return
sampler
.
arrayed
?
GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
:
GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE
;
case
true
:
return
sampler
.
arrayed
?
GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
:
GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE
;
}
case
Esd3D
:
return
GL_UNSIGNED_INT_SAMPLER_3D
;
...
...
@@ -495,7 +502,8 @@ public:
case
Esd2D
:
switch
((
int
)
sampler
.
ms
)
{
case
false
:
return
sampler
.
arrayed
?
GL_UNSIGNED_INT_IMAGE_2D_ARRAY
:
GL_UNSIGNED_INT_IMAGE_2D
;
case
true
:
return
sampler
.
arrayed
?
GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY
:
GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE
;
case
true
:
return
sampler
.
arrayed
?
GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY
:
GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE
;
}
case
Esd3D
:
return
GL_UNSIGNED_INT_IMAGE_3D
;
...
...
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