Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
9dfa9a81
Commit
9dfa9a81
authored
Jun 30, 2015
by
Alexey Ershov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eliminated unused function __OpenCLinitializeGL(), simplified query device logic
parent
8ed45609
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
41 deletions
+11
-41
opengl.cpp
modules/core/src/opengl.cpp
+11
-41
No files found.
modules/core/src/opengl.cpp
View file @
9dfa9a81
...
@@ -1666,37 +1666,20 @@ Context& initializeContextFromGL()
...
@@ -1666,37 +1666,20 @@ Context& initializeContextFromGL()
// query device
// query device
device
=
NULL
;
device
=
NULL
;
size_t
numDevices
=
0
;
status
=
clGetGLContextInfoKHR
(
properties
,
CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR
,
sizeof
(
cl_device_id
),
(
void
*
)
&
device
,
NULL
);
{
if
(
status
!=
CL_SUCCESS
)
size_t
sizeDevices
=
0
;
continue
;
status
=
clGetGLContextInfoKHR
(
properties
,
CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR
,
0
,
NULL
,
&
sizeDevices
);
if
(
status
==
CL_SUCCESS
)
{
numDevices
=
sizeDevices
/
sizeof
(
cl_device_id
);
if
(
numDevices
>
0
)
{
numDevices
=
1
;
sizeDevices
=
numDevices
*
sizeof
(
cl_device_id
);
status
=
clGetGLContextInfoKHR
(
properties
,
CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR
,
sizeDevices
,
(
void
*
)
&
device
,
NULL
);
}
}
if
(
status
!=
CL_SUCCESS
)
continue
;
}
// create context
// create context
if
(
numDevices
>
0
)
context
=
clCreateContext
(
properties
,
1
,
&
device
,
NULL
,
NULL
,
&
status
);
if
(
status
!=
CL_SUCCESS
)
{
{
context
=
clCreateContext
(
properties
,
1
,
&
device
,
NULL
,
NULL
,
&
status
);
clReleaseDevice
(
device
);
if
(
status
!=
CL_SUCCESS
)
}
{
else
clReleaseDevice
(
device
);
{
}
found
=
i
;
else
break
;
{
found
=
i
;
break
;
}
}
}
}
}
...
@@ -1711,13 +1694,6 @@ Context& initializeContextFromGL()
...
@@ -1711,13 +1694,6 @@ Context& initializeContextFromGL()
}
// namespace cv::ogl::ocl
}
// namespace cv::ogl::ocl
#if defined(HAVE_OPENGL) && defined(HAVE_OPENCL)
static
void
__OpenCLinitializeGL
()
{
// temp stub
}
#endif // defined(HAVE_OPENGL) && defined(HAVE_OPENCL)
void
convertToGLTexture2D
(
InputArray
src
,
Texture2D
&
texture
)
void
convertToGLTexture2D
(
InputArray
src
,
Texture2D
&
texture
)
{
{
(
void
)
src
;
(
void
)
texture
;
(
void
)
src
;
(
void
)
texture
;
...
@@ -1726,9 +1702,6 @@ void convertToGLTexture2D(InputArray src, Texture2D& texture)
...
@@ -1726,9 +1702,6 @@ void convertToGLTexture2D(InputArray src, Texture2D& texture)
#elif !defined(HAVE_OPENCL)
#elif !defined(HAVE_OPENCL)
NO_OPENCL_SUPPORT_ERROR
;
NO_OPENCL_SUPPORT_ERROR
;
#else
#else
// ... // check "interop available" flag first (i.e. sharegroup existence)
__OpenCLinitializeGL
();
Size
srcSize
=
src
.
size
();
Size
srcSize
=
src
.
size
();
CV_Assert
(
srcSize
.
width
==
(
int
)
texture
.
cols
()
&&
srcSize
.
height
==
(
int
)
texture
.
rows
());
CV_Assert
(
srcSize
.
width
==
(
int
)
texture
.
cols
()
&&
srcSize
.
height
==
(
int
)
texture
.
rows
());
...
@@ -1781,9 +1754,6 @@ void convertFromGLTexture2D(const Texture2D& texture, OutputArray dst)
...
@@ -1781,9 +1754,6 @@ void convertFromGLTexture2D(const Texture2D& texture, OutputArray dst)
#elif !defined(HAVE_OPENCL)
#elif !defined(HAVE_OPENCL)
NO_OPENCL_SUPPORT_ERROR
;
NO_OPENCL_SUPPORT_ERROR
;
#else
#else
// ... // check "interop available" flag first (i.e. sharegroup existence)
__OpenCLinitializeGL
();
// check texture format
// check texture format
const
int
dtype
=
CV_8UC4
;
const
int
dtype
=
CV_8UC4
;
CV_Assert
(
texture
.
format
()
==
Texture2D
::
RGBA
);
CV_Assert
(
texture
.
format
()
==
Texture2D
::
RGBA
);
...
...
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