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
e6050884
Commit
e6050884
authored
Jul 08, 2013
by
Nicolas Capens
Committed by
Shannon Woods
Jul 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle new sampler types.
TRAC #23472 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Author: Nicolas Capens
parent
a940ae49
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
178 additions
and
8 deletions
+178
-8
utilities.cpp
src/common/utilities.cpp
+62
-0
utilities.h
src/common/utilities.h
+1
-0
BaseTypes.h
src/compiler/BaseTypes.h
+110
-0
ProgramBinary.cpp
src/libGLESv2/ProgramBinary.cpp
+4
-7
Renderer11.cpp
src/libGLESv2/renderer/Renderer11.cpp
+1
-1
No files found.
src/common/utilities.cpp
View file @
e6050884
...
@@ -22,7 +22,17 @@ int UniformComponentCount(GLenum type)
...
@@ -22,7 +22,17 @@ int UniformComponentCount(GLenum type)
case
GL_FLOAT
:
case
GL_FLOAT
:
case
GL_INT
:
case
GL_INT
:
case
GL_SAMPLER_2D
:
case
GL_SAMPLER_2D
:
case
GL_SAMPLER_3D
:
case
GL_SAMPLER_CUBE
:
case
GL_SAMPLER_CUBE
:
case
GL_SAMPLER_2D_ARRAY
:
case
GL_INT_SAMPLER_2D
:
case
GL_INT_SAMPLER_3D
:
case
GL_INT_SAMPLER_CUBE
:
case
GL_INT_SAMPLER_2D_ARRAY
:
case
GL_UNSIGNED_INT_SAMPLER_2D
:
case
GL_UNSIGNED_INT_SAMPLER_3D
:
case
GL_UNSIGNED_INT_SAMPLER_CUBE
:
case
GL_UNSIGNED_INT_SAMPLER_2D_ARRAY
:
case
GL_UNSIGNED_INT
:
case
GL_UNSIGNED_INT
:
return
1
;
return
1
;
case
GL_BOOL_VEC2
:
case
GL_BOOL_VEC2
:
...
@@ -86,7 +96,17 @@ GLenum UniformComponentType(GLenum type)
...
@@ -86,7 +96,17 @@ GLenum UniformComponentType(GLenum type)
return
GL_FLOAT
;
return
GL_FLOAT
;
case
GL_INT
:
case
GL_INT
:
case
GL_SAMPLER_2D
:
case
GL_SAMPLER_2D
:
case
GL_SAMPLER_3D
:
case
GL_SAMPLER_CUBE
:
case
GL_SAMPLER_CUBE
:
case
GL_SAMPLER_2D_ARRAY
:
case
GL_INT_SAMPLER_2D
:
case
GL_INT_SAMPLER_3D
:
case
GL_INT_SAMPLER_CUBE
:
case
GL_INT_SAMPLER_2D_ARRAY
:
case
GL_UNSIGNED_INT_SAMPLER_2D
:
case
GL_UNSIGNED_INT_SAMPLER_3D
:
case
GL_UNSIGNED_INT_SAMPLER_CUBE
:
case
GL_UNSIGNED_INT_SAMPLER_2D_ARRAY
:
case
GL_INT_VEC2
:
case
GL_INT_VEC2
:
case
GL_INT_VEC3
:
case
GL_INT_VEC3
:
case
GL_INT_VEC4
:
case
GL_INT_VEC4
:
...
@@ -178,7 +198,17 @@ int VariableRowCount(GLenum type)
...
@@ -178,7 +198,17 @@ int VariableRowCount(GLenum type)
case
GL_INT_VEC4
:
case
GL_INT_VEC4
:
case
GL_UNSIGNED_INT_VEC4
:
case
GL_UNSIGNED_INT_VEC4
:
case
GL_SAMPLER_2D
:
case
GL_SAMPLER_2D
:
case
GL_SAMPLER_3D
:
case
GL_SAMPLER_CUBE
:
case
GL_SAMPLER_CUBE
:
case
GL_SAMPLER_2D_ARRAY
:
case
GL_INT_SAMPLER_2D
:
case
GL_INT_SAMPLER_3D
:
case
GL_INT_SAMPLER_CUBE
:
case
GL_INT_SAMPLER_2D_ARRAY
:
case
GL_UNSIGNED_INT_SAMPLER_2D
:
case
GL_UNSIGNED_INT_SAMPLER_3D
:
case
GL_UNSIGNED_INT_SAMPLER_CUBE
:
case
GL_UNSIGNED_INT_SAMPLER_2D_ARRAY
:
return
1
;
return
1
;
case
GL_FLOAT_MAT2
:
case
GL_FLOAT_MAT2
:
case
GL_FLOAT_MAT3x2
:
case
GL_FLOAT_MAT3x2
:
...
@@ -210,7 +240,17 @@ int VariableColumnCount(GLenum type)
...
@@ -210,7 +240,17 @@ int VariableColumnCount(GLenum type)
case
GL_INT
:
case
GL_INT
:
case
GL_UNSIGNED_INT
:
case
GL_UNSIGNED_INT
:
case
GL_SAMPLER_2D
:
case
GL_SAMPLER_2D
:
case
GL_SAMPLER_3D
:
case
GL_SAMPLER_CUBE
:
case
GL_SAMPLER_CUBE
:
case
GL_SAMPLER_2D_ARRAY
:
case
GL_INT_SAMPLER_2D
:
case
GL_INT_SAMPLER_3D
:
case
GL_INT_SAMPLER_CUBE
:
case
GL_INT_SAMPLER_2D_ARRAY
:
case
GL_UNSIGNED_INT_SAMPLER_2D
:
case
GL_UNSIGNED_INT_SAMPLER_3D
:
case
GL_UNSIGNED_INT_SAMPLER_CUBE
:
case
GL_UNSIGNED_INT_SAMPLER_2D_ARRAY
:
return
1
;
return
1
;
case
GL_BOOL_VEC2
:
case
GL_BOOL_VEC2
:
case
GL_FLOAT_VEC2
:
case
GL_FLOAT_VEC2
:
...
@@ -243,6 +283,28 @@ int VariableColumnCount(GLenum type)
...
@@ -243,6 +283,28 @@ int VariableColumnCount(GLenum type)
return
0
;
return
0
;
}
}
bool
IsSampler
(
GLenum
type
)
{
switch
(
type
)
{
case
GL_SAMPLER_2D
:
case
GL_SAMPLER_3D
:
case
GL_SAMPLER_CUBE
:
case
GL_SAMPLER_2D_ARRAY
:
case
GL_INT_SAMPLER_2D
:
case
GL_INT_SAMPLER_3D
:
case
GL_INT_SAMPLER_CUBE
:
case
GL_INT_SAMPLER_2D_ARRAY
:
case
GL_UNSIGNED_INT_SAMPLER_2D
:
case
GL_UNSIGNED_INT_SAMPLER_3D
:
case
GL_UNSIGNED_INT_SAMPLER_CUBE
:
case
GL_UNSIGNED_INT_SAMPLER_2D_ARRAY
:
return
true
;
}
return
false
;
}
bool
IsMatrixType
(
GLenum
type
)
bool
IsMatrixType
(
GLenum
type
)
{
{
return
VariableRowCount
(
type
)
>
1
;
return
VariableRowCount
(
type
)
>
1
;
...
...
src/common/utilities.h
View file @
e6050884
...
@@ -30,6 +30,7 @@ size_t UniformExternalSize(GLenum type);
...
@@ -30,6 +30,7 @@ size_t UniformExternalSize(GLenum type);
GLenum
UniformBoolVectorType
(
GLenum
type
);
GLenum
UniformBoolVectorType
(
GLenum
type
);
int
VariableRowCount
(
GLenum
type
);
int
VariableRowCount
(
GLenum
type
);
int
VariableColumnCount
(
GLenum
type
);
int
VariableColumnCount
(
GLenum
type
);
bool
IsSampler
(
GLenum
type
);
bool
IsMatrixType
(
GLenum
type
);
bool
IsMatrixType
(
GLenum
type
);
GLenum
TransposeMatrixType
(
GLenum
type
);
GLenum
TransposeMatrixType
(
GLenum
type
);
int
AttributeRegisterCount
(
GLenum
type
);
int
AttributeRegisterCount
(
GLenum
type
);
...
...
src/compiler/BaseTypes.h
View file @
e6050884
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
#ifndef _BASICTYPES_INCLUDED_
#ifndef _BASICTYPES_INCLUDED_
#define _BASICTYPES_INCLUDED_
#define _BASICTYPES_INCLUDED_
#include <assert.h>
//
//
// Precision qualifiers
// Precision qualifiers
//
//
...
@@ -96,6 +98,114 @@ inline bool IsSampler(TBasicType type)
...
@@ -96,6 +98,114 @@ inline bool IsSampler(TBasicType type)
return
type
>
EbtGuardSamplerBegin
&&
type
<
EbtGuardSamplerEnd
;
return
type
>
EbtGuardSamplerBegin
&&
type
<
EbtGuardSamplerEnd
;
}
}
inline
bool
IsIntegerSampler
(
TBasicType
type
)
{
switch
(
type
)
{
case
EbtISampler2D
:
case
EbtISampler3D
:
case
EbtISamplerCube
:
case
EbtISampler2DArray
:
case
EbtUSampler2D
:
case
EbtUSampler3D
:
case
EbtUSamplerCube
:
case
EbtUSampler2DArray
:
return
true
;
case
EbtSampler2D
:
case
EbtSampler3D
:
case
EbtSamplerCube
:
case
EbtSamplerExternalOES
:
case
EbtSampler2DRect
:
case
EbtSampler2DArray
:
return
false
;
default:
assert
(
!
IsSampler
(
type
));
}
return
false
;
}
inline
bool
IsSampler2D
(
TBasicType
type
)
{
switch
(
type
)
{
case
EbtSampler2D
:
case
EbtISampler2D
:
case
EbtUSampler2D
:
case
EbtSampler2DArray
:
case
EbtISampler2DArray
:
case
EbtUSampler2DArray
:
case
EbtSampler2DRect
:
case
EbtSamplerExternalOES
:
return
true
;
case
EbtSampler3D
:
case
EbtISampler3D
:
case
EbtUSampler3D
:
case
EbtISamplerCube
:
case
EbtUSamplerCube
:
case
EbtSamplerCube
:
return
false
;
default:
assert
(
!
IsSampler
(
type
));
}
return
false
;
}
inline
bool
IsSamplerCube
(
TBasicType
type
)
{
switch
(
type
)
{
case
EbtSamplerCube
:
case
EbtISamplerCube
:
case
EbtUSamplerCube
:
return
true
;
case
EbtSampler2D
:
case
EbtSampler3D
:
case
EbtSamplerExternalOES
:
case
EbtSampler2DRect
:
case
EbtSampler2DArray
:
case
EbtISampler2D
:
case
EbtISampler3D
:
case
EbtISampler2DArray
:
case
EbtUSampler2D
:
case
EbtUSampler3D
:
case
EbtUSampler2DArray
:
return
false
;
default:
assert
(
!
IsSampler
(
type
));
}
return
false
;
}
inline
bool
IsSampler3D
(
TBasicType
type
)
{
switch
(
type
)
{
case
EbtSampler3D
:
case
EbtISampler3D
:
case
EbtUSampler3D
:
return
true
;
case
EbtSampler2D
:
case
EbtSamplerCube
:
case
EbtSamplerExternalOES
:
case
EbtSampler2DRect
:
case
EbtSampler2DArray
:
case
EbtISampler2D
:
case
EbtISamplerCube
:
case
EbtISampler2DArray
:
case
EbtUSampler2D
:
case
EbtUSamplerCube
:
case
EbtUSampler2DArray
:
return
false
;
default:
assert
(
!
IsSampler
(
type
));
}
return
false
;
}
//
//
// Qualifiers and built-ins. These are mainly used to see what can be read
// Qualifiers and built-ins. These are mainly used to see what can be read
// or written, and by the machine dependent translator to know which registers
// or written, and by the machine dependent translator to know which registers
...
...
src/libGLESv2/ProgramBinary.cpp
View file @
e6050884
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "libGLESv2/Program.h"
#include "libGLESv2/Program.h"
#include "libGLESv2/renderer/Renderer.h"
#include "libGLESv2/renderer/Renderer.h"
#include "libGLESv2/renderer/VertexDataManager.h"
#include "libGLESv2/renderer/VertexDataManager.h"
#include "libGLESv2/Context.h"
#include "libGLESv2/Buffer.h"
#include "libGLESv2/Buffer.h"
#undef near
#undef near
...
@@ -642,9 +643,7 @@ bool ProgramBinary::setUniform1iv(GLint location, GLsizei count, const GLint *v)
...
@@ -642,9 +643,7 @@ bool ProgramBinary::setUniform1iv(GLint location, GLsizei count, const GLint *v)
count
=
std
::
min
(
elementCount
-
(
int
)
mUniformIndex
[
location
].
element
,
count
);
count
=
std
::
min
(
elementCount
-
(
int
)
mUniformIndex
[
location
].
element
,
count
);
if
(
targetUniform
->
type
==
GL_INT
||
if
(
targetUniform
->
type
==
GL_INT
||
IsSampler
(
targetUniform
->
type
))
targetUniform
->
type
==
GL_SAMPLER_2D
||
targetUniform
->
type
==
GL_SAMPLER_CUBE
)
{
{
GLint
*
target
=
(
GLint
*
)
targetUniform
->
data
+
mUniformIndex
[
location
].
element
*
4
;
GLint
*
target
=
(
GLint
*
)
targetUniform
->
data
+
mUniformIndex
[
location
].
element
*
4
;
...
@@ -837,8 +836,7 @@ void ProgramBinary::applyUniforms()
...
@@ -837,8 +836,7 @@ void ProgramBinary::applyUniforms()
if
(
targetUniform
->
dirty
)
if
(
targetUniform
->
dirty
)
{
{
if
(
targetUniform
->
type
==
GL_SAMPLER_2D
||
if
(
IsSampler
(
targetUniform
->
type
))
targetUniform
->
type
==
GL_SAMPLER_CUBE
)
{
{
int
count
=
targetUniform
->
elementCount
();
int
count
=
targetUniform
->
elementCount
();
GLint
(
*
v
)[
4
]
=
(
GLint
(
*
)[
4
])
targetUniform
->
data
;
GLint
(
*
v
)[
4
]
=
(
GLint
(
*
)[
4
])
targetUniform
->
data
;
...
@@ -2308,8 +2306,7 @@ bool ProgramBinary::defineUniform(GLenum shader, const sh::Uniform &constant, In
...
@@ -2308,8 +2306,7 @@ bool ProgramBinary::defineUniform(GLenum shader, const sh::Uniform &constant, In
return
true
;
return
true
;
}
}
if
(
constant
.
type
==
GL_SAMPLER_2D
||
if
(
IsSampler
(
constant
.
type
))
constant
.
type
==
GL_SAMPLER_CUBE
)
{
{
unsigned
int
samplerIndex
=
constant
.
registerIndex
;
unsigned
int
samplerIndex
=
constant
.
registerIndex
;
...
...
src/libGLESv2/renderer/Renderer11.cpp
View file @
e6050884
...
@@ -1420,7 +1420,7 @@ void Renderer11::applyUniforms(gl::ProgramBinary *programBinary, gl::UniformArra
...
@@ -1420,7 +1420,7 @@ void Renderer11::applyUniforms(gl::ProgramBinary *programBinary, gl::UniformArra
{
{
gl
::
Uniform
*
uniform
=
*
uniform_iterator
;
gl
::
Uniform
*
uniform
=
*
uniform_iterator
;
if
(
uniform
->
type
!=
GL_SAMPLER_2D
&&
uniform
->
type
!=
GL_SAMPLER_CUBE
)
if
(
!
gl
::
IsSampler
(
uniform
->
type
)
)
{
{
if
(
uniform
->
isReferencedByVertexShader
()
&&
mapVS
)
if
(
uniform
->
isReferencedByVertexShader
()
&&
mapVS
)
{
{
...
...
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