Open chris-montero opened 1 month ago
@chris-montero Do you mind testing the RGFW c examples? This will let me know if it's a problem with the Odin binding (which is not up-to-date) or if it's a problem with RGFW itself.
@ColleagueRiley I did so, and some of them work fine with the C examples.
These examples fail, along with their error messages:
examples/buffer/
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 48
Current serial number in output stream: 48
examples/events/
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 47
Current serial number in output stream: 47
examples/gl33/
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 12 (X_ConfigureWindow)
Value in failed request: 0x0
Serial number of failed request: 41
Current serial number in output stream: 44
examples/vk10/
zsh: segmentation fault ./vk10
I'm transferring the issue here because I believe the source of the issue is the original code.
Could you tell me more about your GPU? I mostly would like to know what the latest version of OpenGL it supports and if it supports Vulkan.
Also the log is time stamped at Fri Sep 13 10:02:06. So it may not be relevant to this issue.
I have an nvidia gtx 950.
glxinfo | grep "OpenGL version"
outputs this:
OpenGL version string: 4.6.0 NVIDIA 550.120
Vulkan is supported. Just yesterday I was trying to set up the vulkan sdk for development, and I ran the provided vkcube
executable, which ran without issues.
You're right, the log is old. I'll get a more recent version if you need it.
@chris-montero I'll look into this issue as soon as I can. At the moment I am a bit busy. I believe the first error is caused by
this line on line 2543
XMatchVisualInfo((Display*) win->src.display, DefaultScreen((Display*) win->src.display), 32, TrueColor, vi); /*!< for RGBA backgrounds*/
@ColleagueRiley I did so, and some of them work fine with the C examples.
These examples fail, along with their error messages:
* examples/buffer/
X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 152 (GLX) Minor opcode of failed request: 5 (X_GLXMakeCurrent) Serial number of failed request: 48 Current serial number in output stream: 48
* examples/events/
X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 152 (GLX) Minor opcode of failed request: 5 (X_GLXMakeCurrent) Serial number of failed request: 47 Current serial number in output stream: 47
* examples/gl33/
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 12 (X_ConfigureWindow) Value in failed request: 0x0 Serial number of failed request: 41 Current serial number in output stream: 44
* examples/vk10/ `zsh: segmentation fault ./vk10`
@chris-montero These first two bugs might be fixed. I'd need to know more about the last two errors to attempt to fix them.
you are correct, the first two work now. The last two don't. I don't know what kind of information you want from gl33, or how I could provide you with that info.
But about examples/vk10
, I think you can look here to see how to set up validation layers and a custom debug messenger and then maybe I can run that and give you some information that way.
Btw I tried running vk10 in gdb, and this is the backtrace:
#0 0x00007ffff65e12e0 in ?? () from /usr/lib/libnvidia-glcore.so.550.120
#1 0x00007ffff65ecb17 in ?? () from /usr/lib/libnvidia-glcore.so.550.120
#2 0x00007ffff651d4c5 in ?? () from /usr/lib/libnvidia-glcore.so.550.120
#3 0x00007ffff7a0cda0 in ?? () from /usr/lib/libGLX_nvidia.so.0
#4 0x00007ffff7d2dd78 in terminator_CreateDevice (physicalDevice=physicalDevice@entry=0x5555556db030, pCreateInfo=pCreateInfo@entry=0x7fffffffd970, pAllocator=pAllocator@entry=0x0,
pDevice=pDevice@entry=0x7fffffffd928) at /home/chris/software/VulkanSDK/1.3.296.0/source/Vulkan-Loader/loader/loader.c:5975
#5 0x00007ffff7d37e65 in loader_create_device_chain (pd=pd@entry=0x5555556db030, pCreateInfo=pCreateInfo@entry=0x7fffffffdb80, pAllocator=pAllocator@entry=0x0, inst=inst@entry=0x555555592410,
dev=dev@entry=0x555555704390, callingLayer=callingLayer@entry=0x0, layerNextGDPA=0x0) at /home/chris/software/VulkanSDK/1.3.296.0/source/Vulkan-Loader/loader/loader.c:5070
#6 0x00007ffff7d38aee in loader_layer_create_device (instance=instance@entry=0x0, physicalDevice=physicalDevice@entry=0x5555556daa10, pCreateInfo=pCreateInfo@entry=0x7fffffffdb80,
pAllocator=pAllocator@entry=0x0, pDevice=pDevice@entry=0x555555566b50 <RGFW_vulkan_info+16>, layerGIPA=layerGIPA@entry=0x0, nextGDPA=0x0)
at /home/chris/software/VulkanSDK/1.3.296.0/source/Vulkan-Loader/loader/loader.c:4445
#7 0x00007ffff7d3f9c6 in vkCreateDevice (physicalDevice=0x5555556daa10, pCreateInfo=0x7fffffffdb80, pAllocator=0x0, pDevice=0x555555566b50 <RGFW_vulkan_info+16>)
at /home/chris/software/VulkanSDK/1.3.296.0/source/Vulkan-Loader/loader/trampoline.c:1017
#8 0x000055555555e9f5 in RGFW_deviceInitialization ()
#9 0x000055555555e44f in RGFW_initVulkan ()
#10 0x000055555555f8a1 in main ()
@chris-montero I'll look into the vulkan example later. It's a low priority because it's an issue with an example and not with RGFW. Also for full disclosure, the vulkan example is based on contributed code rather than code I wrote myself.
I'm not sure how to start fixing gl33 issue. But it will require your assistance since the error doesn't occur with my hardware/drivers.
@ColleagueRiley for the gl33 example, if you can give me a patched version of the code that would produce more relevant information for you, I can run it and give you the output.
@chris-montero I'm not entirely sure why that issue is happening. The error is a bit vague. It could mean, for example, that the window is just too large. Would you mind debugging the example and finding where the issue occurs?
@ColleagueRiley I tried to debug it with both gdb and lldb, but I guess that won't do much since it seems to be an x11 error, not a segfault or anything like that. I don't know what else to try. Do you have any suggestions?
https://github.com/ColleagueRiley/RGFW/commit/f93c2fd78f8241844e5788d94892f25390733ea8
Should fix your gl33 issue
This fixes the problem. You can keep this issue to keep investigating and find a more robust fix for gl33. or do whatever you want with it i dont really care
import "core:fmt" import "core:log" //import glfw "vendor:glfw" import rgfw "external/RGFW-Odin/RGFW" import mem "core:mem"
drawRect :: proc(win : ^rgfw.window, r : rgfw.rect, color: ^[3]u8) { for x := r.x; x < (r.x + r.w); x += 1 { for y := r.y; y < (r.y + r.h); y += 1 { //index := y (4 screenSize.w) + x 4; index := y (4 800) + x 4; // TODO: DONT HARDCODE THE WIDTH
}
icon := []u8{0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF};
Program :: struct { window : ^rgfw.window, is_running : bool, }
init_program :: proc(program : ^Program) { program.window = rgfw.createWindow("Colo teroritta", { 400, 400, 800, 800 }, .CENTER) rgfw.window_makeCurrent(program.window)
}
teardown_program :: proc(program : ^Program) { program.is_running = false rgfw.window_close(program.window) }
main :: proc() { program := Program{} init_program(&program) defer teardown_program(&program)
}
do_drawing :: proc(program : ^Program) {
}