Comments (15)
Ok, I'll send a mail at this address.
For the record, I ported hundreds of stuffs for the OpenPandora, that's why I developped gl4es and then box86 in the first place :D
Portmaster is a nice project indeed.
from gl4es.
Through debug print statements in HardwareOpenGL.cpp
I have determined that the FBO is initialized and the game blits to scale properly (1920x1152 display).
// if we're rendering to an FBO, scale to the window framebuffer!
mprintf(0, "Value of GOpenGLFBO: %d\n", GOpenGLFBO);
if (GOpenGLFBO != 0) {
dglBlitFramebufferEXT(0, 0, GOpenGLFBOWidth, GOpenGLFBOHeight,
centeredX, centeredY, centeredX + scaledWidth, centeredY + scaledHeight,
GL_COLOR_BUFFER_BIT, GL_LINEAR);
mprintf(0, "Blit framebuffer at: (%d, %d) to (%d, %d)\n", centeredX, centeredY, centeredX + scaledWidth, centeredY + scaledHeight);
CFILE: Using "intro.mve" instead of "intro.mve"
FindArg: Did not find [-sdlSndSizeMovie] on command line.
FindArg: Did not find [-sdlSndSize] on command line.
OPENGL: Setting zbuffer state to 0.
OPENGL: Setting zbuffer state to 1.
Value of GOpenGLFBO: 1
Blit framebuffer at: (192, 0) to (1728, 1152)
OPENGL: Setting zbuffer state to 0.
OPENGL: Setting zbuffer state to 1.
Edit: Confirming the SDL window is also created:
if (!GSDLWindow) {
mprintf(0, "Creating SDL window with size %dx%d and flags %d\n", winw, winh, flags);
GSDLWindow = SDL_CreateWindow("Descent 3", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, winw, winh, flags);
if (!GSDLWindow) {
mprintf(0, "OpenGL: SDL window creation failed: %s", SDL_GetError());
return 0;
}
} else {
int currentW, currentH;
SDL_GetWindowSize(GSDLWindow, ¤tW, ¤tH);
mprintf(0, "Current SDL Window size is %dx%d\n", currentW, currentH);
mprintf(0, "Setting SDL Window to %dx%d\n", winw, winh);
SDL_SetWindowSize(GSDLWindow, winw, winh);
mprintf(0, "Setting SDL Window to fullscreen with flags %d\n", flags);
SDL_SetWindowFullscreen(GSDLWindow, flags);
// Retrieve and print the actual window size
int actualW, actualH;
SDL_GetWindowSize(GSDLWindow, &actualW, &actualH);
mprintf(0, "Actual SDL Window size is %dx%d\n", actualW, actualH);
}
if (!GSDLGLContext) {
mprintf(0, "Creating OpenGL context for the SDL window\n");
GSDLGLContext = SDL_GL_CreateContext(GSDLWindow);
if (!GSDLGLContext) {
mprintf(0, "OpenGL: OpenGL context creation failed: %s", SDL_GetError());
SDL_DestroyWindow(GSDLWindow);
GSDLWindow = NULL;
return 0;
} else {
mprintf(0, "OpenGL: OpenGL context created successfully\n");
}
}
Creating SDL window with size 640x480 and flags 2
Creating OpenGL context for the SDL window
OpenGL: OpenGL context created successfully
from gl4es.
Here is a newer, more detailed logfile.
from gl4es.
Oh, you are using FB=4, so gbm rendering?! That will be tricky to debug, I don't have hardware like that myself
from gl4es.
I don't see the gl4es initialisation string on that log, that's strange.
from gl4es.
It's a partial log, the full one is rather large. Here it is. This log begins at game initialization, goes up to the main menu, then quits.
Note that this log is generated by the game itself, so gl4es initialization string may not be present. Here is the full launch script:
#!/bin/bash
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
if [ -d "/opt/system/Tools/PortMaster/" ]; then
controlfolder="/opt/system/Tools/PortMaster"
elif [ -d "/opt/tools/PortMaster/" ]; then
controlfolder="/opt/tools/PortMaster"
elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
controlfolder="$XDG_DATA_HOME/PortMaster"
else
controlfolder="/roms/ports/PortMaster"
fi
source $controlfolder/control.txt
source $controlfolder/device_info.txt
[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
get_controls
GAMEDIR="/$directory/ports/descent3"
DEVICE_ARCH="${DEVICE_ARCH:-aarch64}"
GAME="Descent3"
cd $GAMEDIR
if [ -f "${controlfolder}/libgl_${CFW_NAME}.txt" ]; then
source "${controlfolder}/libgl_${CFW_NAME}.txt"
else
source "${controlfolder}/libgl_default.txt"
fi
# Create config dir
rm -rf "$XDG_DATA_HOME/Outrage Entertainment/Descent 3"
ln -s $GAMEDIR "$XDG_DATA_HOME/Outrage Entertainment/Descent 3"
# Setup gl4es environment
export LIBGL_ES=2
export LIBGL_GL=21
export LIBGL_FB=4
export LIBGL_VBO=1
export LIBGL_STACKTRACE=1
export SDL_VIDEO_GL_DRIVER="$GAMEDIR/libs.$DEVICE_ARCH/libGL.so.1"
export LIBGL_DRIVERS_PATH="$GAMEDIR/libs.$DEVICE_ARCH/libGL.so.1"
export LD_LIBRARY_PATH="$GAMEDIR/libs.$DEVICE_ARCH:/usr/lib:$LD_LIBRARY_PATH"
# Setup controls
$ESUDO chmod 666 /dev/tty1
$ESUDO chmod 666 /dev/uinput
$GPTOKEYB "$GAME" -c "joy.gptk" &
SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
./$GAME -setdir "$GAMEDIR/gamedata" -f -logfile -g $LIBGL_DRIVERS_PATH -gllogging
$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
printf "\033c" >> /dev/tty1
I've also walked through the render steps to the best of my ability, here's a brief summary of the order of operations:
SDL Window Creation and OpenGL Context Initialization:
SDL window creation with appropriate attributes (SDL_GL_SetAttribute calls).
Creation and management of the OpenGL context (SDL_GL_CreateContext).
Setting the OpenGL context as current (SDL_GL_MakeCurrent).
FBO Management:
Proper teardown of existing FBO and renderbuffers (dglDeleteFramebuffersEXT, dglDeleteRenderbuffersEXT).
Creation of new FBO and associated renderbuffers (dglGenFramebuffersEXT, dglGenRenderbuffersEXT, dglFramebufferRenderbufferEXT).
Viewport and Scissor Management:
Setting viewport and scissor to match the dimensions of the SDL window or the FBO, ensuring correct rendering area.
Blitting from FBO to SDL Window:
Proper use of dglBlitFramebufferEXT to blit the FBO content onto the SDL window when necessary.
Buffer Swapping:
Correct usage of SwapBuffers (on Windows) and SDL_GL_SwapWindow (on Linux) to swap the front and back buffers, presenting the rendered content to the screen.
from gl4es.
Another log, run via ssh, this one shows gl4es init strings.
from gl4es.
A partner added a screenshot function to determine if the framebuffer renders correctly before blitting, and there was an oddity in the Descent 3 code. To quote him, "there is only one texture and it's 128x128 with some garbage". When building the FB, gl4es appears to be creating a texture with id 1 and attaches it to GL_COLOR_ATTACHMENT0_EXT
, but later the game tries to overwrite that texture with another texture.
Setting cur_texture_object_num = 2;
at https://github.com/JeodC/Descent3/blob/develop/renderer/HardwareOpenGL.cpp#L119 and https://github.com/JeodC/Descent3/blob/develop/renderer/HardwareOpenGL.cpp#L311 makes the first texture id the game uses equal 2, and then the FB renders correctly.
Unfortunately, the SDL window (FB0) still displays a blank screen. The problem seems to be in blitting, maybe: https://github.com/JeodC/Descent3/blob/develop/renderer/HardwareOpenGL.cpp#L2052C1-L2056
from gl4es.
Another opinion:
"What if GL4ES doesn't have any direct support for renderbuffers and it's creating a texture under the hood? Well, if it is, we now have a problem. Old OpenGL let you use texture names freely, so Descent 3 is like "okay my first texture is texture #1. My second is texture #2" and so on. The modern way of doing it is that you have to ask OpenGL for those numbers with glGenTextures
."
I'm not sure if this is a lead, but it seemed like a valid question.
from gl4es.
I don't have hardware like that myself
PortMaster has hundreds of ports that rely on gl4es and gbm. We can surely arrange something for you if you would like hardware for testing. It would be our way of thanking you. 🙂
from gl4es.
I don't have hardware like that myself
PortMaster has hundreds of ports that rely on gl4es and gbm. We can surely arrange something for you if you would like hardware for testing. It would be our way of thanking you. 🙂
What kind of hardware use gl4es+gbm? ambernic console, this kind of things? (I have none anyway).
from gl4es.
I don't have hardware like that myself
PortMaster has hundreds of ports that rely on gl4es and gbm. We can surely arrange something for you if you would like hardware for testing. It would be our way of thanking you. 🙂
What kind of hardware use gl4es+gbm? ambernic console, this kind of things? (I have none anyway).
Anbernic and Powkiddy devices officially. With some effort we've gotten ports to run on more niche handhelds like the Gameforce Chi and TrimUI Smart Pro. Like I said we're more than happy to send you hardware--I can't think of a better way to witness the fruits of your labor.
If you're interested, fire an email to [email protected] and our administrator will take care of the rest. 🙂
Ports background information: https://portmaster.games/porting.html
from gl4es.
Right. I know this game ran on box86 with gl4es. The only differences now are no x11 requirement, sdl2, and fbo. I'm assuming the libGL that's been compiled by another is using the correct compiler definitions (nox11=true etc). With a cursory glance, does anything specific to check come to mind given we know the fbo is receiving the draws but the screen is blank?
from gl4es.
There might be an issue with the context creation, especialy if the game / sdl2 tries multiple context creation to find the best one. the GLX part is still a bit fragile in gl4es, especialy with gbm backend that receive very little testing.
from gl4es.
I reverted the framebuffer object commit entirely and just went with what currently existed. It works with gl4es, but you may wish to continue looking into this particular issue. If so, feel free to reopen for tracking. Thanks!
from gl4es.
Related Issues (20)
- EGL_BAD_DISPLAY error on Mali G52 driver blob (GKD Mini Plus) HOT 9
- Raylib clashes HOT 9
- When will gles3.0 be supported? HOT 1
- [Question]: About the LOAD_GL* macros HOT 20
- [Question]: NEON Intrisics HOT 6
- `LIBGL_ES=1` breaks rendering of MC 1.7.10 HOT 2
- [Question] how to use gl4es using box64 and wine?
- Amigaos4 slowdown possibly with displaylists HOT 4
- Commit c8cf6cb31aa12700e7cf30261159436653de8103 causes DSI error on AmigaOS4 HOT 8
- add support for TEGRA HOT 4
- CS2
- Add support for glCopyColorTable HOT 1
- New release HOT 2
- [request] update OpenGl4Es
- GL_PIXEL_UNPACK_BUFFER bindBuffer type HOT 1
- help to package to Debian HOT 4
- Install Prefix suggestion
- Opaque Depth used in code but Depth allowed in gl4es
- Shader linking in gl4es issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gl4es.