-
Notifications
You must be signed in to change notification settings - Fork 248
Shared textures OpenGL #548
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
base: kharitonov/shared_texture_refactor_metal
Are you sure you want to change the base?
Shared textures OpenGL #548
Conversation
f9181fe to
d218421
Compare
c29910a to
9be77e8
Compare
| (JNIEnv *env, jclass clazz, jlong texture) { | ||
| if (gTextureType == OPENGL_TEXTURE_TYPE) { | ||
| GLuint texId = (GLuint)texture; | ||
| glDeleteTextures(1, &texId);\ |
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.
Backslash?
src/java.desktop/linux/classes/com/jetbrains/desktop/SharedTexturesService.java
Outdated
Show resolved
Hide resolved
src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfigExt.m
Outdated
Show resolved
Hide resolved
src/java.desktop/share/classes/com/jetbrains/desktop/image/TextureWrapperImage.java
Outdated
Show resolved
Hide resolved
| final static TexturePixelLayout RGBA = new TexturePixelLayout(0, 1, 2, 3); | ||
| final static TexturePixelLayout BGRA = new TexturePixelLayout(2, 1, 0, 3); | ||
| static TexturePixelLayout get(int textureType) { | ||
| return switch (textureType) { | ||
| case SharedTextures.OPENGL_TEXTURE_TYPE -> TexturePixelLayout.RGBA; | ||
| case SharedTextures.METAL_TEXTURE_TYPE -> TexturePixelLayout.BGRA; |
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.
We seem to expect different pixel layouts for Metal and OGL, however for *TextureWrapperSurfaceData classes we always use ColorModel.getRGBdefault(), which seems inconsistent - could you check that?
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 made it consistent with how it's done for VolatileImage. The color model is taken now from the GraphicsConfig.
However, look like those color model from TextureWrapperSurfaceData is the color model on the public image API side. It doesn't have to be the same as the in the accelerated surface.
de0bfbd to
60ce7f2
Compare
60ce7f2 to
98362d9
Compare
YaaZ
left a comment
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.
LGTM overall. Although I see a lot of instanceofs, I guess you're intentionally trying to keep your code separate from the JDK's, right?
| -framework Cocoa -framework SystemConfiguration | ||
| BUILD_JDK_JTREG_LIBRARIES_LIBS_libSharedTexturesTest := \ | ||
| -framework Cocoa -framework Metal | ||
| -framework Cocoa -framework Metal -framework OpenGL |
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 forgot whether I already asked this, but do we really need an OGL implementation on macOS, given that it's deprecated there?
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.
Yes, we talked about it and concluded that it won't heart. :)
We still have this pipeline, the OS still supports it so far.
| private final Image image; | ||
|
|
||
| public WGLTextureWrapperSurfaceData(WGLGraphicsConfig gc, Image image, long textureId) { | ||
| super(null, gc, ColorModel.getRGBdefault(), RT_TEXTURE); |
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.
In other places you take color model from the GC, this one looks inconsistent with the others
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.
Oops. Thanks.
Yes, sort of. |
The corresponding JBR API review:
JetBrains/JetBrainsRuntimeApi#20