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
3c0d2e5b
Commit
3c0d2e5b
authored
Nov 14, 2019
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Fix #1976: Don't let ENABLE_HLSL change struct/class layout.
parent
37dcb894
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
34 additions
and
40 deletions
+34
-40
web.array.frag.out
Test/baseResults/web.array.frag.out
+1
-1
web.basic.vert.out
Test/baseResults/web.basic.vert.out
+1
-1
web.builtins.frag.out
Test/baseResults/web.builtins.frag.out
+1
-1
web.builtins.vert.out
Test/baseResults/web.builtins.vert.out
+1
-1
web.comp.out
Test/baseResults/web.comp.out
+1
-1
web.controlFlow.frag.out
Test/baseResults/web.controlFlow.frag.out
+1
-1
web.operations.frag.out
Test/baseResults/web.operations.frag.out
+1
-1
web.separate.frag.out
Test/baseResults/web.separate.frag.out
+1
-1
web.texture.frag.out
Test/baseResults/web.texture.frag.out
+1
-1
Types.h
glslang/Include/Types.h
+15
-17
intermediate.h
glslang/Include/intermediate.h
+3
-3
localintermediate.h
glslang/MachineIndependent/localintermediate.h
+7
-11
No files found.
Test/baseResults/web.array.frag.out
View file @
3c0d2e5b
; SPIR-V
; SPIR-V
; Version: 1.0
; Version: 1.0
; Generator: Khronos Glslang Reference Front End;
7
; Generator: Khronos Glslang Reference Front End;
8
; Bound: 74
; Bound: 74
; Schema: 0
; Schema: 0
OpCapability Shader
OpCapability Shader
...
...
Test/baseResults/web.basic.vert.out
View file @
3c0d2e5b
; SPIR-V
; SPIR-V
; Version: 1.0
; Version: 1.0
; Generator: Khronos Glslang Reference Front End;
7
; Generator: Khronos Glslang Reference Front End;
8
; Bound: 38
; Bound: 38
; Schema: 0
; Schema: 0
OpCapability Shader
OpCapability Shader
...
...
Test/baseResults/web.builtins.frag.out
View file @
3c0d2e5b
; SPIR-V
; SPIR-V
; Version: 1.0
; Version: 1.0
; Generator: Khronos Glslang Reference Front End;
7
; Generator: Khronos Glslang Reference Front End;
8
; Bound: 69
; Bound: 69
; Schema: 0
; Schema: 0
OpCapability Shader
OpCapability Shader
...
...
Test/baseResults/web.builtins.vert.out
View file @
3c0d2e5b
; SPIR-V
; SPIR-V
; Version: 1.0
; Version: 1.0
; Generator: Khronos Glslang Reference Front End;
7
; Generator: Khronos Glslang Reference Front End;
8
; Bound: 33
; Bound: 33
; Schema: 0
; Schema: 0
OpCapability Shader
OpCapability Shader
...
...
Test/baseResults/web.comp.out
View file @
3c0d2e5b
; SPIR-V
; SPIR-V
; Version: 1.0
; Version: 1.0
; Generator: Khronos Glslang Reference Front End;
7
; Generator: Khronos Glslang Reference Front End;
8
; Bound: 108
; Bound: 108
; Schema: 0
; Schema: 0
OpCapability Shader
OpCapability Shader
...
...
Test/baseResults/web.controlFlow.frag.out
View file @
3c0d2e5b
; SPIR-V
; SPIR-V
; Version: 1.0
; Version: 1.0
; Generator: Khronos Glslang Reference Front End;
7
; Generator: Khronos Glslang Reference Front End;
8
; Bound: 193
; Bound: 193
; Schema: 0
; Schema: 0
OpCapability Shader
OpCapability Shader
...
...
Test/baseResults/web.operations.frag.out
View file @
3c0d2e5b
; SPIR-V
; SPIR-V
; Version: 1.0
; Version: 1.0
; Generator: Khronos Glslang Reference Front End;
7
; Generator: Khronos Glslang Reference Front End;
8
; Bound: 207
; Bound: 207
; Schema: 0
; Schema: 0
OpCapability Shader
OpCapability Shader
...
...
Test/baseResults/web.separate.frag.out
View file @
3c0d2e5b
; SPIR-V
; SPIR-V
; Version: 1.0
; Version: 1.0
; Generator: Khronos Glslang Reference Front End;
7
; Generator: Khronos Glslang Reference Front End;
8
; Bound: 99
; Bound: 99
; Schema: 0
; Schema: 0
OpCapability Shader
OpCapability Shader
...
...
Test/baseResults/web.texture.frag.out
View file @
3c0d2e5b
; SPIR-V
; SPIR-V
; Version: 1.0
; Version: 1.0
; Generator: Khronos Glslang Reference Front End;
7
; Generator: Khronos Glslang Reference Front End;
8
; Bound: 189
; Bound: 189
; Schema: 0
; Schema: 0
OpCapability Shader
OpCapability Shader
...
...
glslang/Include/Types.h
View file @
3c0d2e5b
...
@@ -80,27 +80,13 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
...
@@ -80,27 +80,13 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool
image
:
1
;
// image, combined should be false
bool
image
:
1
;
// image, combined should be false
bool
combined
:
1
;
// true means texture is combined with a sampler, false means texture with no sampler
bool
combined
:
1
;
// true means texture is combined with a sampler, false means texture with no sampler
bool
sampler
:
1
;
// true means a pure sampler, other fields should be clear()
bool
sampler
:
1
;
// true means a pure sampler, other fields should be clear()
#ifdef ENABLE_HLSL
unsigned
int
vectorSize
:
3
;
// vector return type size.
unsigned
int
getVectorSize
()
const
{
return
vectorSize
;
}
void
clearReturnStruct
()
{
structReturnIndex
=
noReturnStruct
;
}
bool
hasReturnStruct
()
const
{
return
structReturnIndex
!=
noReturnStruct
;
}
unsigned
getStructReturnIndex
()
const
{
return
structReturnIndex
;
}
static
const
unsigned
structReturnIndexBits
=
4
;
// number of index bits to use.
static
const
unsigned
structReturnSlots
=
(
1
<<
structReturnIndexBits
)
-
1
;
// number of valid values
static
const
unsigned
noReturnStruct
=
structReturnSlots
;
// value if no return struct type.
// Index into a language specific table of texture return structures.
#ifdef GLSLANG_WEB
unsigned
int
structReturnIndex
:
structReturnIndexBits
;
#else
unsigned
int
getVectorSize
()
const
{
return
4
;
}
unsigned
int
getVectorSize
()
const
{
return
4
;
}
void
clearReturnStruct
()
const
{
}
void
clearReturnStruct
()
const
{
}
bool
hasReturnStruct
()
const
{
return
false
;
}
bool
hasReturnStruct
()
const
{
return
false
;
}
unsigned
getStructReturnIndex
()
const
{
return
0
;
}
unsigned
getStructReturnIndex
()
const
{
return
0
;
}
#endif
#ifdef GLSLANG_WEB
bool
is1D
()
const
{
return
false
;
}
bool
is1D
()
const
{
return
false
;
}
bool
isBuffer
()
const
{
return
false
;
}
bool
isBuffer
()
const
{
return
false
;
}
bool
isRect
()
const
{
return
false
;
}
bool
isRect
()
const
{
return
false
;
}
...
@@ -113,10 +99,22 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
...
@@ -113,10 +99,22 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
void
setExternal
(
bool
e
)
{
}
void
setExternal
(
bool
e
)
{
}
bool
isYuv
()
const
{
return
false
;
}
bool
isYuv
()
const
{
return
false
;
}
#else
#else
bool
external
:
1
;
// GL_OES_EGL_image_external
unsigned
int
vectorSize
:
3
;
// vector return type size.
bool
yuv
:
1
;
// GL_EXT_YUV_target
// Some languages support structures as sample results. Storing the whole structure in the
// Some languages support structures as sample results. Storing the whole structure in the
// TSampler is too large, so there is an index to a separate table.
// TSampler is too large, so there is an index to a separate table.
static
const
unsigned
structReturnIndexBits
=
4
;
// number of index bits to use.
static
const
unsigned
structReturnSlots
=
(
1
<<
structReturnIndexBits
)
-
1
;
// number of valid values
static
const
unsigned
noReturnStruct
=
structReturnSlots
;
// value if no return struct type.
// Index into a language specific table of texture return structures.
unsigned
int
structReturnIndex
:
structReturnIndexBits
;
bool
external
:
1
;
// GL_OES_EGL_image_external
bool
yuv
:
1
;
// GL_EXT_YUV_target
unsigned
int
getVectorSize
()
const
{
return
vectorSize
;
}
void
clearReturnStruct
()
{
structReturnIndex
=
noReturnStruct
;
}
bool
hasReturnStruct
()
const
{
return
structReturnIndex
!=
noReturnStruct
;
}
unsigned
getStructReturnIndex
()
const
{
return
structReturnIndex
;
}
bool
is1D
()
const
{
return
dim
==
Esd1D
;
}
bool
is1D
()
const
{
return
dim
==
Esd1D
;
}
bool
isBuffer
()
const
{
return
dim
==
EsdBuffer
;
}
bool
isBuffer
()
const
{
return
dim
==
EsdBuffer
;
}
...
...
glslang/Include/intermediate.h
View file @
3c0d2e5b
...
@@ -1223,7 +1223,7 @@ public:
...
@@ -1223,7 +1223,7 @@ public:
// it is essential to use "symbol = sym" to assign to symbol
// it is essential to use "symbol = sym" to assign to symbol
TIntermSymbol
(
int
i
,
const
TString
&
n
,
const
TType
&
t
)
TIntermSymbol
(
int
i
,
const
TString
&
n
,
const
TType
&
t
)
:
TIntermTyped
(
t
),
id
(
i
),
:
TIntermTyped
(
t
),
id
(
i
),
#if
def ENABLE_HLSL
#if
ndef GLSLANG_WEB
flattenSubset
(
-
1
),
flattenSubset
(
-
1
),
#endif
#endif
constSubtree
(
nullptr
)
constSubtree
(
nullptr
)
...
@@ -1238,7 +1238,7 @@ public:
...
@@ -1238,7 +1238,7 @@ public:
const
TConstUnionArray
&
getConstArray
()
const
{
return
constArray
;
}
const
TConstUnionArray
&
getConstArray
()
const
{
return
constArray
;
}
void
setConstSubtree
(
TIntermTyped
*
subtree
)
{
constSubtree
=
subtree
;
}
void
setConstSubtree
(
TIntermTyped
*
subtree
)
{
constSubtree
=
subtree
;
}
TIntermTyped
*
getConstSubtree
()
const
{
return
constSubtree
;
}
TIntermTyped
*
getConstSubtree
()
const
{
return
constSubtree
;
}
#if
def ENABLE_HLSL
#if
ndef GLSLANG_WEB
void
setFlattenSubset
(
int
subset
)
{
flattenSubset
=
subset
;
}
void
setFlattenSubset
(
int
subset
)
{
flattenSubset
=
subset
;
}
int
getFlattenSubset
()
const
{
return
flattenSubset
;
}
// -1 means full object
int
getFlattenSubset
()
const
{
return
flattenSubset
;
}
// -1 means full object
#endif
#endif
...
@@ -1249,7 +1249,7 @@ public:
...
@@ -1249,7 +1249,7 @@ public:
protected
:
protected
:
int
id
;
// the unique id of the symbol this node represents
int
id
;
// the unique id of the symbol this node represents
#if
def ENABLE_HLSL
#if
ndef GLSLANG_WEB
int
flattenSubset
;
// how deeply the flattened object rooted at id has been dereferenced
int
flattenSubset
;
// how deeply the flattened object rooted at id has been dereferenced
#endif
#endif
TString
name
;
// the name of the symbol this node represents
TString
name
;
// the name of the symbol this node represents
...
...
glslang/MachineIndependent/localintermediate.h
View file @
3c0d2e5b
...
@@ -229,10 +229,6 @@ class TIntermediate {
...
@@ -229,10 +229,6 @@ class TIntermediate {
public
:
public
:
explicit
TIntermediate
(
EShLanguage
l
,
int
v
=
0
,
EProfile
p
=
ENoProfile
)
:
explicit
TIntermediate
(
EShLanguage
l
,
int
v
=
0
,
EProfile
p
=
ENoProfile
)
:
language
(
l
),
language
(
l
),
#ifdef ENABLE_HLSL
implicitThisName
(
"@this"
),
implicitCounterName
(
"@count"
),
source
(
EShSourceNone
),
#endif
profile
(
p
),
version
(
v
),
treeRoot
(
0
),
profile
(
p
),
version
(
v
),
treeRoot
(
0
),
numEntryPoints
(
0
),
numErrors
(
0
),
numPushConstants
(
0
),
recursive
(
false
),
numEntryPoints
(
0
),
numErrors
(
0
),
numPushConstants
(
0
),
recursive
(
false
),
invertY
(
false
),
invertY
(
false
),
...
@@ -241,6 +237,8 @@ public:
...
@@ -241,6 +237,8 @@ public:
depthReplacing
(
false
)
depthReplacing
(
false
)
#ifndef GLSLANG_WEB
#ifndef GLSLANG_WEB
,
,
implicitThisName
(
"@this"
),
implicitCounterName
(
"@count"
),
source
(
EShSourceNone
),
useVulkanMemoryModel
(
false
),
useVulkanMemoryModel
(
false
),
invocations
(
TQualifier
::
layoutNotSet
),
vertices
(
TQualifier
::
layoutNotSet
),
invocations
(
TQualifier
::
layoutNotSet
),
vertices
(
TQualifier
::
layoutNotSet
),
inputPrimitive
(
ElgNone
),
outputPrimitive
(
ElgNone
),
inputPrimitive
(
ElgNone
),
outputPrimitive
(
ElgNone
),
...
@@ -895,13 +893,6 @@ protected:
...
@@ -895,13 +893,6 @@ protected:
static
const
char
*
getResourceName
(
TResourceType
);
static
const
char
*
getResourceName
(
TResourceType
);
const
EShLanguage
language
;
// stage, known at construction time
const
EShLanguage
language
;
// stage, known at construction time
#ifdef ENABLE_HLSL
public
:
const
char
*
const
implicitThisName
;
const
char
*
const
implicitCounterName
;
protected
:
EShSource
source
;
// source language, known a bit later
#endif
std
::
string
entryPointName
;
std
::
string
entryPointName
;
std
::
string
entryPointMangledName
;
std
::
string
entryPointMangledName
;
typedef
std
::
list
<
TCall
>
TGraph
;
typedef
std
::
list
<
TCall
>
TGraph
;
...
@@ -925,6 +916,11 @@ protected:
...
@@ -925,6 +916,11 @@ protected:
bool
localSizeNotDefault
[
3
];
bool
localSizeNotDefault
[
3
];
int
localSizeSpecId
[
3
];
int
localSizeSpecId
[
3
];
#ifndef GLSLANG_WEB
#ifndef GLSLANG_WEB
public
:
const
char
*
const
implicitThisName
;
const
char
*
const
implicitCounterName
;
protected
:
EShSource
source
;
// source language, known a bit later
bool
useVulkanMemoryModel
;
bool
useVulkanMemoryModel
;
int
invocations
;
int
invocations
;
int
vertices
;
int
vertices
;
...
...
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