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
0b83323d
Commit
0b83323d
authored
Aug 21, 2013
by
Geoff Lang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Perform validation of glClear parameters at the API level.
TRAC #23475 Author: Geoff Lang Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
parent
da507fea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
16 deletions
+13
-16
Context.cpp
src/libGLESv2/Context.cpp
+1
-16
libGLESv2.cpp
src/libGLESv2/libGLESv2.cpp
+12
-0
No files found.
src/libGLESv2/Context.cpp
View file @
0b83323d
...
...
@@ -2459,15 +2459,7 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
void
Context
::
clear
(
GLbitfield
mask
)
{
Framebuffer
*
framebufferObject
=
getDrawFramebuffer
();
if
(
!
framebufferObject
||
framebufferObject
->
completeness
()
!=
GL_FRAMEBUFFER_COMPLETE
)
{
return
gl
::
error
(
GL_INVALID_FRAMEBUFFER_OPERATION
);
}
ClearParameters
clearParams
=
{
0
};
for
(
unsigned
int
i
=
0
;
i
<
ArraySize
(
clearParams
.
clearColor
);
i
++
)
{
clearParams
.
clearColor
[
i
]
=
false
;
...
...
@@ -2486,10 +2478,9 @@ void Context::clear(GLbitfield mask)
clearParams
.
scissorEnabled
=
mState
.
scissorTest
;
clearParams
.
scissor
=
mState
.
scissor
;
Framebuffer
*
framebufferObject
=
getDrawFramebuffer
();
if
(
mask
&
GL_COLOR_BUFFER_BIT
)
{
mask
&=
~
GL_COLOR_BUFFER_BIT
;
if
(
framebufferObject
->
hasEnabledColorAttachment
())
{
for
(
unsigned
int
i
=
0
;
i
<
ArraySize
(
clearParams
.
clearColor
);
i
++
)
...
...
@@ -2501,7 +2492,6 @@ void Context::clear(GLbitfield mask)
if
(
mask
&
GL_DEPTH_BUFFER_BIT
)
{
mask
&=
~
GL_DEPTH_BUFFER_BIT
;
if
(
mState
.
depthStencil
.
depthMask
&&
framebufferObject
->
getDepthbufferType
()
!=
GL_NONE
)
{
clearParams
.
clearDepth
=
true
;
...
...
@@ -2510,7 +2500,6 @@ void Context::clear(GLbitfield mask)
if
(
mask
&
GL_STENCIL_BUFFER_BIT
)
{
mask
&=
~
GL_STENCIL_BUFFER_BIT
;
if
(
framebufferObject
->
getStencilbufferType
()
!=
GL_NONE
)
{
rx
::
RenderTarget
*
depthStencil
=
framebufferObject
->
getStencilbuffer
()
->
getDepthStencil
();
...
...
@@ -2527,10 +2516,6 @@ void Context::clear(GLbitfield mask)
}
}
if
(
mask
!=
0
)
{
return
gl
::
error
(
GL_INVALID_VALUE
);
}
if
(
!
applyRenderTarget
(
GL_TRIANGLES
,
true
))
// Clips the clear to the scissor rectangle but not the viewport
{
...
...
src/libGLESv2/libGLESv2.cpp
View file @
0b83323d
...
...
@@ -825,6 +825,18 @@ void __stdcall glClear(GLbitfield mask)
if
(
context
)
{
gl
::
Framebuffer
*
framebufferObject
=
context
->
getDrawFramebuffer
();
if
(
!
framebufferObject
||
framebufferObject
->
completeness
()
!=
GL_FRAMEBUFFER_COMPLETE
)
{
return
gl
::
error
(
GL_INVALID_FRAMEBUFFER_OPERATION
);
}
if
((
mask
&
~
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
|
GL_STENCIL_BUFFER_BIT
))
!=
0
)
{
return
gl
::
error
(
GL_INVALID_VALUE
);
}
context
->
clear
(
mask
);
}
}
...
...
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