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
f6cc8ccf
Commit
f6cc8ccf
authored
Jul 03, 2013
by
Jamie Madill
Committed by
Shannon Woods
Jul 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement support all sampler object associated GLES 3 API entry points.
TRAC #23454 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Authored-by: Jamie Madill
parent
fb8a830e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
102 additions
and
55 deletions
+102
-55
libGLESv2.cpp
src/libGLESv2/libGLESv2.cpp
+102
-55
No files found.
src/libGLESv2/libGLESv2.cpp
View file @
f6cc8ccf
...
...
@@ -2107,6 +2107,26 @@ gl::Texture *getTargetTexture(gl::Context *context, GLenum target)
}
}
bool
validateSamplerObjectParameter
(
GLenum
pname
)
{
switch
(
pname
)
{
case
GL_TEXTURE_MIN_FILTER
:
case
GL_TEXTURE_MAG_FILTER
:
case
GL_TEXTURE_WRAP_S
:
case
GL_TEXTURE_WRAP_T
:
case
GL_TEXTURE_WRAP_R
:
case
GL_TEXTURE_MIN_LOD
:
case
GL_TEXTURE_MAX_LOD
:
case
GL_TEXTURE_COMPARE_MODE
:
case
GL_TEXTURE_COMPARE_FUNC
:
return
true
;
default
:
return
gl
::
error
(
GL_INVALID_ENUM
,
false
);
}
}
extern
"C"
{
...
...
@@ -11135,8 +11155,15 @@ void __stdcall glGenSamplers(GLsizei count, GLuint* samplers)
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
// glGenSamplers
UNIMPLEMENTED
();
if
(
count
<
0
)
{
return
gl
::
error
(
GL_INVALID_VALUE
);
}
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
samplers
[
i
]
=
context
->
createSampler
();
}
}
}
catch
(
std
::
bad_alloc
&
)
...
...
@@ -11160,8 +11187,15 @@ void __stdcall glDeleteSamplers(GLsizei count, const GLuint* samplers)
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
// glDeleteSamplers
UNIMPLEMENTED
();
if
(
count
<
0
)
{
return
gl
::
error
(
GL_INVALID_VALUE
);
}
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
context
->
deleteSampler
(
samplers
[
i
]);
}
}
}
catch
(
std
::
bad_alloc
&
)
...
...
@@ -11185,8 +11219,7 @@ GLboolean __stdcall glIsSampler(GLuint sampler)
return
gl
::
error
(
GL_INVALID_OPERATION
,
GL_FALSE
);
}
// glIsSampler
UNIMPLEMENTED
();
return
context
->
isSampler
(
sampler
);
}
}
catch
(
std
::
bad_alloc
&
)
...
...
@@ -11212,8 +11245,17 @@ void __stdcall glBindSampler(GLuint unit, GLuint sampler)
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
// glBindSampler
UNIMPLEMENTED
();
if
(
sampler
!=
0
&&
!
context
->
isSampler
(
sampler
))
{
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
if
(
unit
>=
context
->
getMaximumCombinedTextureImageUnits
())
{
return
gl
::
error
(
GL_INVALID_VALUE
);
}
context
->
bindSampler
(
unit
,
sampler
);
}
}
catch
(
std
::
bad_alloc
&
)
...
...
@@ -11237,34 +11279,22 @@ void __stdcall glSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
// glSamplerParameteri
UNIMPLEMENTED
();
}
}
catch
(
std
::
bad_alloc
&
)
{
return
gl
::
error
(
GL_OUT_OF_MEMORY
);
}
}
void
__stdcall
glSamplerParameteriv
(
GLuint
sampler
,
GLenum
pname
,
const
GLint
*
param
)
{
EVENT
(
"(GLuint sampler = %u, GLenum pname = 0x%X, const GLint* param = 0x%0.8p)"
,
sampler
,
pname
,
param
);
if
(
!
validateSamplerObjectParameter
(
pname
))
{
return
;
}
try
{
gl
::
Context
*
context
=
gl
::
getNonLostContext
();
if
(
!
validateTexParamParameters
(
context
,
pname
,
param
))
{
return
;
}
if
(
context
)
{
if
(
context
->
getClientVersion
()
<
3
)
if
(
!
context
->
isSampler
(
sampler
))
{
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
// glSamplerParameteriv
UNIMPLEMENTED
();
context
->
samplerParameteri
(
sampler
,
pname
,
param
);
}
}
catch
(
std
::
bad_alloc
&
)
...
...
@@ -11273,6 +11303,11 @@ void __stdcall glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* p
}
}
void
__stdcall
glSamplerParameteriv
(
GLuint
sampler
,
GLenum
pname
,
const
GLint
*
param
)
{
glSamplerParameteri
(
sampler
,
pname
,
*
param
);
}
void
__stdcall
glSamplerParameterf
(
GLuint
sampler
,
GLenum
pname
,
GLfloat
param
)
{
EVENT
(
"(GLuint sampler = %u, GLenum pname = 0x%X, GLfloat param = %g)"
,
sampler
,
pname
,
param
);
...
...
@@ -11288,33 +11323,22 @@ void __stdcall glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
// glSamplerParameterf
UNIMPLEMENTED
();
}
}
catch
(
std
::
bad_alloc
&
)
{
return
gl
::
error
(
GL_OUT_OF_MEMORY
);
}
}
void
__stdcall
glSamplerParameterfv
(
GLuint
sampler
,
GLenum
pname
,
const
GLfloat
*
param
)
{
EVENT
(
"(GLuint sampler = %u, GLenum pname = 0x%X, const GLfloat* param = 0x%0.8p)"
,
sampler
,
pname
,
param
);
if
(
!
validateSamplerObjectParameter
(
pname
))
{
return
;
}
try
{
gl
::
Context
*
context
=
gl
::
getNonLostContext
();
if
(
!
validateTexParamParameters
(
context
,
pname
,
static_cast
<
GLint
>
(
param
)))
{
return
;
}
if
(
context
)
{
if
(
context
->
getClientVersion
()
<
3
)
if
(
!
context
->
isSampler
(
sampler
))
{
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
// glSamplerParameterfv
UNIMPLEMENTED
();
context
->
samplerParameterf
(
sampler
,
pname
,
param
);
}
}
catch
(
std
::
bad_alloc
&
)
...
...
@@ -11323,6 +11347,11 @@ void __stdcall glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat*
}
}
void
__stdcall
glSamplerParameterfv
(
GLuint
sampler
,
GLenum
pname
,
const
GLfloat
*
param
)
{
glSamplerParameterf
(
sampler
,
pname
,
*
param
);
}
void
__stdcall
glGetSamplerParameteriv
(
GLuint
sampler
,
GLenum
pname
,
GLint
*
params
)
{
EVENT
(
"(GLuint sampler = %u, GLenum pname = 0x%X, GLint* params = 0x%0.8p)"
,
sampler
,
pname
,
params
);
...
...
@@ -11338,8 +11367,17 @@ void __stdcall glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* para
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
// glGetSamplerParameteriv
UNIMPLEMENTED
();
if
(
!
validateSamplerObjectParameter
(
pname
))
{
return
;
}
if
(
!
context
->
isSampler
(
sampler
))
{
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
*
params
=
context
->
getSamplerParameteri
(
sampler
,
pname
);
}
}
catch
(
std
::
bad_alloc
&
)
...
...
@@ -11363,8 +11401,17 @@ void __stdcall glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* pa
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
// glGetSamplerParameterfv
UNIMPLEMENTED
();
if
(
!
validateSamplerObjectParameter
(
pname
))
{
return
;
}
if
(
!
context
->
isSampler
(
sampler
))
{
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
*
params
=
context
->
getSamplerParameterf
(
sampler
,
pname
);
}
}
catch
(
std
::
bad_alloc
&
)
...
...
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