Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
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
angle
Commits
529077d9
Commit
529077d9
authored
Jun 20, 2013
by
Jamie Madill
Committed by
Shannon Woods
Jul 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for column/row major layout qualifiers in generated HLSL.
TRAC #23271 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Authored-by: Jamie Madill
parent
9cf6c070
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
OutputHLSL.cpp
src/compiler/OutputHLSL.cpp
+15
-13
No files found.
src/compiler/OutputHLSL.cpp
View file @
529077d9
...
@@ -214,17 +214,19 @@ TString OutputHLSL::interfaceBlockInstanceString(const TType& interfaceBlockType
...
@@ -214,17 +214,19 @@ TString OutputHLSL::interfaceBlockInstanceString(const TType& interfaceBlockType
TString
OutputHLSL
::
interfaceBlockMemberTypeString
(
const
TType
&
memberType
)
TString
OutputHLSL
::
interfaceBlockMemberTypeString
(
const
TType
&
memberType
)
{
{
// TODO: layout support
const
TLayoutMatrixPacking
matrixPacking
=
memberType
.
getLayoutQualifier
().
matrixPacking
;
ASSERT
(
matrixPacking
!=
EmpUnspecified
);
if
(
memberType
.
isMatrix
())
if
(
memberType
.
isMatrix
())
{
{
// Use HLSL row-major packing for GLSL column-major matrices
// Use HLSL row-major packing for GLSL column-major matrices
return
"row_major "
+
typeString
(
memberType
);
const
TString
&
matrixPackString
=
(
matrixPacking
==
EmpRowMajor
?
"column_major"
:
"row_major"
);
return
matrixPackString
+
" "
+
typeString
(
memberType
);
}
}
else
if
(
memberType
.
getBasicType
()
==
EbtStruct
)
else
if
(
memberType
.
getBasicType
()
==
EbtStruct
)
{
{
// Use HLSL row-major packing for GLSL column-major matrices
// Use HLSL row-major packing for GLSL column-major matrices
return
structureTypeName
(
memberType
,
true
);
return
structureTypeName
(
memberType
,
matrixPacking
==
EmpColumnMajor
);
}
}
else
else
{
{
...
@@ -287,16 +289,6 @@ void OutputHLSL::header()
...
@@ -287,16 +289,6 @@ void OutputHLSL::header()
ShShaderType
shaderType
=
mContext
.
shaderType
;
ShShaderType
shaderType
=
mContext
.
shaderType
;
TInfoSinkBase
&
out
=
mHeader
;
TInfoSinkBase
&
out
=
mHeader
;
for
(
StructDeclarations
::
iterator
structDeclaration
=
mStructDeclarations
.
begin
();
structDeclaration
!=
mStructDeclarations
.
end
();
structDeclaration
++
)
{
out
<<
*
structDeclaration
;
}
for
(
Constructors
::
iterator
constructor
=
mConstructors
.
begin
();
constructor
!=
mConstructors
.
end
();
constructor
++
)
{
out
<<
*
constructor
;
}
TString
uniforms
;
TString
uniforms
;
TString
interfaceBlocks
;
TString
interfaceBlocks
;
TString
interfaceBlockInit
;
TString
interfaceBlockInit
;
...
@@ -402,6 +394,16 @@ void OutputHLSL::header()
...
@@ -402,6 +394,16 @@ void OutputHLSL::header()
mActiveAttributes
.
push_back
(
shaderVar
);
mActiveAttributes
.
push_back
(
shaderVar
);
}
}
for
(
StructDeclarations
::
iterator
structDeclaration
=
mStructDeclarations
.
begin
();
structDeclaration
!=
mStructDeclarations
.
end
();
structDeclaration
++
)
{
out
<<
*
structDeclaration
;
}
for
(
Constructors
::
iterator
constructor
=
mConstructors
.
begin
();
constructor
!=
mConstructors
.
end
();
constructor
++
)
{
out
<<
*
constructor
;
}
if
(
shaderType
==
SH_FRAGMENT_SHADER
)
if
(
shaderType
==
SH_FRAGMENT_SHADER
)
{
{
TExtensionBehavior
::
const_iterator
iter
=
mContext
.
extensionBehavior
().
find
(
"GL_EXT_draw_buffers"
);
TExtensionBehavior
::
const_iterator
iter
=
mContext
.
extensionBehavior
().
find
(
"GL_EXT_draw_buffers"
);
...
...
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