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
fb9a7409
Commit
fb9a7409
authored
Jul 26, 2013
by
Jamie Madill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the API parameter validation out of Fence.cpp to libGLESv2.cpp.
TRAC #23446 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Authored-by: Jamie Madill
parent
09752369
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
27 deletions
+35
-27
Fence.cpp
src/libGLESv2/Fence.cpp
+7
-17
Fence.h
src/libGLESv2/Fence.h
+1
-1
libGLESv2.cpp
src/libGLESv2/libGLESv2.cpp
+25
-1
Fence11.cpp
src/libGLESv2/renderer/Fence11.cpp
+1
-4
Fence9.cpp
src/libGLESv2/renderer/Fence9.cpp
+1
-4
No files found.
src/libGLESv2/Fence.cpp
View file @
fb9a7409
...
@@ -51,10 +51,7 @@ GLboolean Fence::testFence()
...
@@ -51,10 +51,7 @@ GLboolean Fence::testFence()
void
Fence
::
finishFence
()
void
Fence
::
finishFence
()
{
{
if
(
!
mFence
->
isSet
())
ASSERT
(
mFence
->
isSet
());
{
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
while
(
!
mFence
->
test
(
true
))
while
(
!
mFence
->
test
(
true
))
{
{
...
@@ -62,12 +59,9 @@ void Fence::finishFence()
...
@@ -62,12 +59,9 @@ void Fence::finishFence()
}
}
}
}
void
Fence
::
getFenceiv
(
GLenum
pname
,
GLint
*
params
)
GLint
Fence
::
getFencei
(
GLenum
pname
)
{
{
if
(
!
mFence
->
isSet
())
ASSERT
(
mFence
->
isSet
());
{
return
error
(
GL_INVALID_OPERATION
);
}
switch
(
pname
)
switch
(
pname
)
{
{
...
@@ -78,21 +72,17 @@ void Fence::getFenceiv(GLenum pname, GLint *params)
...
@@ -78,21 +72,17 @@ void Fence::getFenceiv(GLenum pname, GLint *params)
// or GetFenceivNV querying the FENCE_STATUS_NV), the status remains TRUE until the next SetFenceNV of the fence.
// or GetFenceivNV querying the FENCE_STATUS_NV), the status remains TRUE until the next SetFenceNV of the fence.
if
(
mStatus
==
GL_TRUE
)
if
(
mStatus
==
GL_TRUE
)
{
{
params
[
0
]
=
GL_TRUE
;
return
GL_TRUE
;
return
;
}
}
mStatus
=
(
mFence
->
test
(
false
)
?
GL_TRUE
:
GL_FALSE
);
mStatus
=
(
mFence
->
test
(
false
)
?
GL_TRUE
:
GL_FALSE
);
params
[
0
]
=
mStatus
;
return
mStatus
;
break
;
}
}
case
GL_FENCE_CONDITION_NV
:
case
GL_FENCE_CONDITION_NV
:
params
[
0
]
=
mCondition
;
return
mCondition
;
break
;
default
:
default
:
UNREACHABLE
();
return
0
;
return
error
(
GL_INVALID_ENUM
);
}
}
}
}
...
...
src/libGLESv2/Fence.h
View file @
fb9a7409
...
@@ -30,7 +30,7 @@ class Fence
...
@@ -30,7 +30,7 @@ class Fence
void
setFence
(
GLenum
condition
);
void
setFence
(
GLenum
condition
);
GLboolean
testFence
();
GLboolean
testFence
();
void
finishFence
();
void
finishFence
();
void
getFenceiv
(
GLenum
pname
,
GLint
*
params
);
GLint
getFencei
(
GLenum
pname
);
GLboolean
getStatus
()
const
{
return
mStatus
;
}
GLboolean
getStatus
()
const
{
return
mStatus
;
}
GLuint
getCondition
()
const
{
return
mCondition
;
}
GLuint
getCondition
()
const
{
return
mCondition
;
}
...
...
src/libGLESv2/libGLESv2.cpp
View file @
fb9a7409
...
@@ -4018,6 +4018,11 @@ void __stdcall glFinishFenceNV(GLuint fence)
...
@@ -4018,6 +4018,11 @@ void __stdcall glFinishFenceNV(GLuint fence)
return
gl
::
error
(
GL_INVALID_OPERATION
);
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
}
if
(
fenceObject
->
isFence
()
!=
GL_TRUE
)
{
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
fenceObject
->
finishFence
();
fenceObject
->
finishFence
();
}
}
}
}
...
@@ -4900,7 +4905,21 @@ void __stdcall glGetFenceivNV(GLuint fence, GLenum pname, GLint *params)
...
@@ -4900,7 +4905,21 @@ void __stdcall glGetFenceivNV(GLuint fence, GLenum pname, GLint *params)
return
gl
::
error
(
GL_INVALID_OPERATION
);
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
}
fenceObject
->
getFenceiv
(
pname
,
params
);
if
(
fenceObject
->
isFence
()
!=
GL_TRUE
)
{
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
switch
(
pname
)
{
case
GL_FENCE_STATUS_NV
:
case
GL_FENCE_CONDITION_NV
:
break
;
default
:
return
gl
::
error
(
GL_INVALID_ENUM
);
}
params
[
0
]
=
fenceObject
->
getFencei
(
pname
);
}
}
}
}
catch
(
std
::
bad_alloc
&
)
catch
(
std
::
bad_alloc
&
)
...
@@ -7056,6 +7075,11 @@ GLboolean __stdcall glTestFenceNV(GLuint fence)
...
@@ -7056,6 +7075,11 @@ GLboolean __stdcall glTestFenceNV(GLuint fence)
return
gl
::
error
(
GL_INVALID_OPERATION
,
GL_TRUE
);
return
gl
::
error
(
GL_INVALID_OPERATION
,
GL_TRUE
);
}
}
if
(
fenceObject
->
isFence
()
!=
GL_TRUE
)
{
return
gl
::
error
(
GL_INVALID_OPERATION
,
GL_TRUE
);
}
return
fenceObject
->
testFence
();
return
fenceObject
->
testFence
();
}
}
}
}
...
...
src/libGLESv2/renderer/Fence11.cpp
View file @
fb9a7409
...
@@ -53,10 +53,7 @@ void Fence11::set()
...
@@ -53,10 +53,7 @@ void Fence11::set()
bool
Fence11
::
test
(
bool
flushCommandBuffer
)
bool
Fence11
::
test
(
bool
flushCommandBuffer
)
{
{
if
(
mQuery
==
NULL
)
ASSERT
(
mQuery
);
{
return
gl
::
error
(
GL_INVALID_OPERATION
,
true
);
}
UINT
getDataFlags
=
(
flushCommandBuffer
?
0
:
D3D11_ASYNC_GETDATA_DONOTFLUSH
);
UINT
getDataFlags
=
(
flushCommandBuffer
?
0
:
D3D11_ASYNC_GETDATA_DONOTFLUSH
);
HRESULT
result
=
mRenderer
->
getDeviceContext
()
->
GetData
(
mQuery
,
NULL
,
0
,
getDataFlags
);
HRESULT
result
=
mRenderer
->
getDeviceContext
()
->
GetData
(
mQuery
,
NULL
,
0
,
getDataFlags
);
...
...
src/libGLESv2/renderer/Fence9.cpp
View file @
fb9a7409
...
@@ -52,10 +52,7 @@ void Fence9::set()
...
@@ -52,10 +52,7 @@ void Fence9::set()
bool
Fence9
::
test
(
bool
flushCommandBuffer
)
bool
Fence9
::
test
(
bool
flushCommandBuffer
)
{
{
if
(
mQuery
==
NULL
)
ASSERT
(
mQuery
);
{
return
gl
::
error
(
GL_INVALID_OPERATION
,
true
);
}
DWORD
getDataFlags
=
(
flushCommandBuffer
?
D3DGETDATA_FLUSH
:
0
);
DWORD
getDataFlags
=
(
flushCommandBuffer
?
D3DGETDATA_FLUSH
:
0
);
HRESULT
result
=
mQuery
->
GetData
(
NULL
,
0
,
getDataFlags
);
HRESULT
result
=
mQuery
->
GetData
(
NULL
,
0
,
getDataFlags
);
...
...
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