-
-
Notifications
You must be signed in to change notification settings - Fork 55.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OpenGL] Add OpenGL Program helper classes and functions for OpenGL >= 3.2 #26090
base: 4.x
Are you sure you want to change the base?
Conversation
@mqcmd196 Could you adapt existing opengl.cpp sample to GTK3 or we need more changes? |
Implementation should be guarded as follows:
Otherwise it leads to complication issues. |
Fixed in a702432 |
The existing |
|
||
const Ptr<cv::ogl::VertexArray::Impl> cv::ogl::VertexArray::Impl::empty() | ||
{ | ||
static Ptr<Impl> p(new Impl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make_ptr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you provide more info?
|
|
||
void setAutoRelease(bool flag); | ||
|
||
void vertexAttribPointer(InputArray arr, unsigned int index, int size, int stride, int offset) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stride should be in bytes. It's implemented for the case if structure is heterogeneous or larger than just shader input data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like void vertexAttribPointer(InputArray arr, unsigned int index, int size, unsigned char stride, int offset) const;
??
/////////////////// Export to Graphic device /////////////////// | ||
|
||
CV_EXPORTS void uniformMatrix4fv(int location, int count, float* value); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to make it a method of Program
class. Also it makes sense to add methods with integer as location and a string as location name.
|
||
/** @brief Wrapper for OpenGL 3.2 Program object | ||
*/ | ||
class CV_EXPORTS Program{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to refactor it to Pimpl and hide program_
from public interface.
bdf8169
to
1c25ef8
Compare
|
This PR adds an OpenGL Program wrapper for supporting fragment and vertex shader required from OpenGL >= 3.2. I also edited the sample code and confirmed it worked in my environment.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.