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
054378d9
Commit
054378d9
authored
Jun 19, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Non-functional: Make test valid HLSL, and related comments/cleanup.
parent
e2ff404f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
24 deletions
+29
-24
hlsl.buffer.frag.out
Test/baseResults/hlsl.buffer.frag.out
+0
-0
hlsl.buffer.frag
Test/hlsl.buffer.frag
+12
-12
reflection.cpp
glslang/MachineIndependent/reflection.cpp
+3
-1
hlslGrammar.cpp
hlsl/hlslGrammar.cpp
+14
-11
No files found.
Test/baseResults/hlsl.buffer.frag.out
View file @
054378d9
This diff is collapsed.
Click to expand it.
Test/hlsl.buffer.frag
View file @
054378d9
cbuffer
{
cbuffer
buf1
{
float4
v1
;
float4
v1
;
};
};
tbuffer
{
tbuffer
buf2
{
float4
v2
;
float4
v2
;
};
};
cbuffer
cbufName
:
register
(
b2
,
space10
)
{
cbuffer
cbufName
{
float4
v3
;
float4
v3
:
packoffset
(
c0
)
;
int
i3
:
packoffset
(
c1
.
y
);
int
i3
:
packoffset
(
c1
.
y
);
}
// no semicolon is okay
}
// no semicolon is okay
tbuffer
tbufName
:
register
(
b
8
)
{
tbuffer
tbufName
:
register
(
t
8
)
{
float4
v4
:
packoffset
(
c1
);
float4
v4
:
packoffset
(
c1
);
int
i4
:
packoffset
(
c3
);
int
i4
:
packoffset
(
c3
);
float
f1
:
packoffset
(
c3
.
w
);
float
f1
:
packoffset
(
c3
.
w
);
...
@@ -19,14 +19,14 @@ tbuffer tbufName : register(b8) {
...
@@ -19,14 +19,14 @@ tbuffer tbufName : register(b8) {
float
f4
:
packoffset
(
c4
.
y
);
float
f4
:
packoffset
(
c4
.
y
);
float
f5
:
packoffset
(
c4
.
z
);
float
f5
:
packoffset
(
c4
.
z
);
float
f6
:
packoffset
(
c
);
float
f6
:
packoffset
(
c
);
float
f7
;
float
f7
:
packoffset
(
c8
)
;
float3x4
m1
;
float3x4
m1
:
packoffset
(
c7
)
;
row_major
float3x4
m2
;
row_major
float3x4
m2
:
packoffset
(
c11
)
;
column_major
float3x4
m3
;
column_major
float3x4
m3
:
packoffset
(
c15
)
;
float3x4
m4
;
float3x4
m4
:
packoffset
(
c19
)
;
}
// no semicolon is okay
}
// no semicolon is okay
float4
PixelShaderFunction
(
float4
input
)
:
COLOR
0
float4
PixelShaderFunction
(
float4
input
:
SV_POSITION
)
:
SV_TARGET
0
{
{
return
input
+
v1
+
v2
+
v3
+
v4
;
return
input
+
v1
+
v2
+
v3
+
v4
;
}
}
glslang/MachineIndependent/reflection.cpp
View file @
054378d9
...
@@ -725,7 +725,9 @@ void TReflection::buildCounterIndices()
...
@@ -725,7 +725,9 @@ void TReflection::buildCounterIndices()
// Returns false if the input is too malformed to do this.
// Returns false if the input is too malformed to do this.
bool
TReflection
::
addStage
(
EShLanguage
stage
,
const
TIntermediate
&
intermediate
)
bool
TReflection
::
addStage
(
EShLanguage
stage
,
const
TIntermediate
&
intermediate
)
{
{
if
(
intermediate
.
getNumEntryPoints
()
!=
1
||
intermediate
.
isRecursive
())
if
(
intermediate
.
getTreeRoot
()
==
nullptr
||
intermediate
.
getNumEntryPoints
()
!=
1
||
intermediate
.
isRecursive
())
return
false
;
return
false
;
buildAttributeReflection
(
stage
,
intermediate
);
buildAttributeReflection
(
stage
,
intermediate
);
...
...
hlsl/hlslGrammar.cpp
View file @
054378d9
...
@@ -296,7 +296,8 @@ bool HlslGrammar::acceptSamplerDeclarationDX9(TType& /*type*/)
...
@@ -296,7 +296,8 @@ bool HlslGrammar::acceptSamplerDeclarationDX9(TType& /*type*/)
// declaration
// declaration
// : sampler_declaration_dx9 post_decls SEMICOLON
// : sampler_declaration_dx9 post_decls SEMICOLON
// | fully_specified_type declarator_list SEMICOLON(optional for cbuffer/tbuffer)
// | fully_specified_type // for cbuffer/tbuffer
// | fully_specified_type declarator_list SEMICOLON // for non cbuffer/tbuffer
// | fully_specified_type identifier function_parameters post_decls compound_statement // function definition
// | fully_specified_type identifier function_parameters post_decls compound_statement // function definition
// | fully_specified_type identifier sampler_state post_decls compound_statement // sampler definition
// | fully_specified_type identifier sampler_state post_decls compound_statement // sampler definition
// | typedef declaration
// | typedef declaration
...
@@ -374,7 +375,9 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
...
@@ -374,7 +375,9 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
if
(
!
acceptFullySpecifiedType
(
declaredType
,
nodeList
))
if
(
!
acceptFullySpecifiedType
(
declaredType
,
nodeList
))
return
false
;
return
false
;
// identifier
// declarator_list
// : declarator
// : identifier
HlslToken
idToken
;
HlslToken
idToken
;
TIntermAggregate
*
initializers
=
nullptr
;
TIntermAggregate
*
initializers
=
nullptr
;
while
(
acceptIdentifier
(
idToken
))
{
while
(
acceptIdentifier
(
idToken
))
{
...
@@ -483,11 +486,10 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
...
@@ -483,11 +486,10 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
}
}
}
}
if
(
acceptTokenClass
(
EHTokComma
))
{
// COMMA
if
(
acceptTokenClass
(
EHTokComma
))
declarator_list
=
true
;
declarator_list
=
true
;
continue
;
}
}
};
// The top-level initializer node is a sequence.
// The top-level initializer node is a sequence.
if
(
initializers
!=
nullptr
)
if
(
initializers
!=
nullptr
)
...
@@ -1901,18 +1903,19 @@ bool HlslGrammar::acceptStruct(TType& type, TIntermNode*& nodeList)
...
@@ -1901,18 +1903,19 @@ bool HlslGrammar::acceptStruct(TType& type, TIntermNode*& nodeList)
TStorageQualifier
storageQualifier
=
EvqTemporary
;
TStorageQualifier
storageQualifier
=
EvqTemporary
;
bool
readonly
=
false
;
bool
readonly
=
false
;
// CBUFFER
if
(
acceptTokenClass
(
EHTokCBuffer
))
{
if
(
acceptTokenClass
(
EHTokCBuffer
))
{
// CBUFFER
storageQualifier
=
EvqUniform
;
storageQualifier
=
EvqUniform
;
// TBUFFER
}
else
if
(
acceptTokenClass
(
EHTokTBuffer
))
{
}
else
if
(
acceptTokenClass
(
EHTokTBuffer
))
{
// TBUFFER
storageQualifier
=
EvqBuffer
;
storageQualifier
=
EvqBuffer
;
readonly
=
true
;
readonly
=
true
;
}
}
else
if
(
!
acceptTokenClass
(
EHTokClass
)
&&
!
acceptTokenClass
(
EHTokStruct
))
{
// CLASS
// Neither CLASS nor STRUCT
// STRUCT
else
if
(
!
acceptTokenClass
(
EHTokClass
)
&&
!
acceptTokenClass
(
EHTokStruct
))
return
false
;
return
false
;
}
// Now known to be one of CBUFFER, TBUFFER, CLASS, or STRUCT
// IDENTIFIER
// IDENTIFIER
TString
structName
=
""
;
TString
structName
=
""
;
...
...
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