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
0bd6d117
Commit
0bd6d117
authored
Aug 29, 2013
by
Zhenyao Mo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose the packing function so we can check varyings packing per program
ANGLEBUG=471 R=kbr@chromium.org Review URL:
https://codereview.appspot.com/13322043
parent
521c8364
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
1 deletion
+42
-1
ShaderLang.h
include/GLSLANG/ShaderLang.h
+24
-0
version.h
src/common/version.h
+1
-1
ShaderLang.cpp
src/compiler/ShaderLang.cpp
+17
-0
No files found.
include/GLSLANG/ShaderLang.h
View file @
0bd6d117
...
...
@@ -163,6 +163,11 @@ typedef enum {
SH_DEPENDENCY_GRAPH
=
0x0400
,
// Enforce the GLSL 1.017 Appendix A section 7 packing restrictions.
// This flag only enforces (and can only enforce) the packing
// restrictions for uniform variables in both vertex and fragment
// shaders. ShCheckVariablesWithinPackingLimits() lets embedders
// enforce the packing restrictions for varying variables during
// program link time.
SH_ENFORCE_PACKING_RESTRICTIONS
=
0x0800
,
// This flag ensures all indirect (expression-based) array indexing
...
...
@@ -434,6 +439,25 @@ COMPILER_EXPORT void ShGetInfoPointer(const ShHandle handle,
ShShaderInfo
pname
,
void
**
params
);
typedef
struct
{
ShDataType
type
;
int
size
;
}
ShVariableInfo
;
// Returns 1 if the passed in variables pack in maxVectors following
// the packing rules from the GLSL 1.017 spec, Appendix A, section 7.
// Returns 0 otherwise. Also look at the SH_ENFORCE_PACKING_RESTRICTIONS
// flag above.
// Parameters:
// maxVectors: the available rows of registers.
// varInfoArray: an array of variable info (types and sizes).
// varInfoArraySize: the size of the variable array.
COMPILER_EXPORT
int
ShCheckVariablesWithinPackingLimits
(
int
maxVectors
,
ShVariableInfo
*
varInfoArray
,
size_t
varInfoArraySize
);
#ifdef __cplusplus
}
#endif
...
...
src/common/version.h
View file @
0bd6d117
#define MAJOR_VERSION 1
#define MINOR_VERSION 2
#define BUILD_VERSION 0
#define BUILD_REVISION 244
2
#define BUILD_REVISION 244
3
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
...
...
src/compiler/ShaderLang.cpp
View file @
0bd6d117
...
...
@@ -15,6 +15,7 @@
#include "compiler/preprocessor/length_limits.h"
#include "compiler/ShHandle.h"
#include "compiler/TranslatorHLSL.h"
#include "compiler/VariablePacker.h"
//
// This is the platform independent interface between an OGL driver
...
...
@@ -368,3 +369,19 @@ void ShGetInfoPointer(const ShHandle handle, ShShaderInfo pname, void** params)
default:
UNREACHABLE
();
}
}
int
ShCheckVariablesWithinPackingLimits
(
int
maxVectors
,
ShVariableInfo
*
varInfoArray
,
size_t
varInfoArraySize
)
{
if
(
varInfoArraySize
==
0
)
return
1
;
ASSERT
(
varInfoArray
);
TVariableInfoList
variables
;
for
(
size_t
ii
=
0
;
ii
<
varInfoArraySize
;
++
ii
)
{
TVariableInfo
var
(
varInfoArray
[
ii
].
type
,
varInfoArray
[
ii
].
size
);
variables
.
push_back
(
var
);
}
VariablePacker
packer
;
return
packer
.
CheckVariablesWithinPackingLimits
(
maxVectors
,
variables
)
?
1
:
0
;
}
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