Developing Games on Intel Graphics
If you are gaming on graphics integrated in your Intel Processor, this is the place for you! Find answers to your questions or post your issues with PC games
525 Discussions

Segfault in igxelpicd64.dll if no SwapBuffers was called (Windows, OpenGL)

gr3yknigh1
Beginner
2,706 Views

 

Hello there! I'm not sure if this is the right board for this, so I apologize in advance if it is not.

I'm working on an OpenGL Windows application and my program is crashing in the igxelpicd64.dll  driver thread when I don't call the SwapBuffers function after calling the glClear and glClearColor functions in the main loop. The crash occurs after a certain amount of time has passed, not immediately, which is why I believe there might be some kind of race condition at play.

Here is some pseudocode. If you would like, I can you with provide more debug information and the full source code or pre-compiled executable files of my application. You will need MSVC and CMake to build the project.

 

#include "my_opengl_loader_which_definitly_not_related_to_segfault.h"
#include "my_window_library_which_sure_not_related_to_issue.h"

int
main(void)
{
  // Window creation
  // Render context initialization
  // Loading functions from opengl32.dll

  while (1) {
    glClear(...);
    glClearColor(0, 0, 0, 1);

#if !defined(WANT_SEGFAULT_IN_IGXELPICDDLL)
    SwapBuffers(GlobalDeviceContext);
#endif
  }
}

 

Here is my software and hardware information:

 

Operating System: Microsoft Windows 11 Home 10.0.22631
IGCC Version: 1.100.5635.0
Language: en-US
Physical Memory: 15.73 GB
Current Resolution: 2880x1800


Processor: 12th Gen Intel(R) Core(TM) i5-12500H
Processor Speed: 2500 MHz
GFX Driver Name: Intel® Iris® Xe Graphics
Shader Version: 6.6
OpenCL* Version: 3.0
* Microsoft DirectX* *
Runtime Version: 12
Hardware-Supported Version: 12
Vendor ID: 8086
Device ID: 46A6
Device Revision: 0C
GFX Driver Version: 31.0.101.4502
Dedicated RAM: 128 MB
Shared RAM: 8 GB
Max Supported Displays: 4
GFX Vulcan: 1.3.250
GFX GOP: 21.0.1046


* Digital Display 1 *

Display Name: Built-In Display
Display Type: Digital
Serial Number: -
DDC2 Protocol: Supported
Gamma: 2.2
Connector Type: DisplayPort


Maximum Image Size
Horizontal - 11.81 inches
Vertical - 7.48 inches


Supported Modes
2880 x 1800 (60p Hz)
2880 x 1800 (90p Hz)

 

 

0 Kudos
16 Replies
VonM_Intel
Moderator
2,630 Views

Hi, gr3yknigh1.


Thank you for posting in our Community.

It looks like you're dealing with an interesting issue, and I think you're on the right track with your analysis. Based on your description, it's possible that the crash is related to how OpenGL handles the buffer swap in relation to your render context, especially if "SwapBuffers" is not being called. It might indeed be a timing issue, which could be a sign of a race condition or an issue with synchronization between the CPU and GPU.


In the meantime, I'll need to conduct some additional research on this issue and will post an update in this thread as soon as I have more information. Regarding the full source code, feel free to share it along with any debug information or even a pre-compiled version. I'd be happy to take a closer look and assist with troubleshooting further.


Have a nice day!


Best regards,

Von M.

Intel Customer Support Technician


0 Kudos
gr3yknigh1
Beginner
2,605 Views

Hello! Thank you for your response and your time.

 

Here are the full source code and two pre-compiled binaries: one that calls Swapbuffers and one that does not. I have also added some notes in the README.txt file.

 


Have a great day!

0 Kudos
VonM_Intel
Moderator
2,491 Views

Hi, gr3yknigh1.


Thank you for your response and for providing the source code and the pre-compiled binaries. To assist you further and investigate this issue more effectively, could you please provide the following information:

  1. What is the name of the OpenGL Windows application and the program where the crash occurred?
  2. Are you the developer of this program, or is this a third-party application?
  3. Please update the graphics driver to version 32.0.101.6297, as the version 31.0.101.4502 you mentioned is not the latest release. You can download the updated driver here: Intel® Arc™ & Iris® Xe Graphics - Windows
  4. Was the application working fine before? If so, when did the issue first start occurring?
  5. If the problem persists after updating the driver to version 32.0.101.6297, could you kindly provide the latest SSU logs for further analysis?


Looking forward to your response.


Best regards,

Von M.

Intel Customer Support Technician


0 Kudos
VonM_Intel
Moderator
2,440 Views

Hi, gr3yknigh1.


I'm following up to check whether you have had the chance to review our prior correspondence. If you have, kindly acknowledge receipt and let me know if you need time to share the details I asked for. Please let me know about this information so we can identify the next steps that need to be taken to resolve this issue.


I will wait for your reply.


Best regards,

Von M.

Intel Customer Support Technician


0 Kudos
gr3yknigh1
Beginner
2,419 Views

I apologize for the delay in responding. This week has been busy, and I also had difficulty logging into this forum using my credentials. There was some strange error at the login page.

Regarding your previous question:

1. A crash occurred in a separate thread of the igxelpicd64.dll Windows driver while my application was running.

2. As I explained in my initial question, I am developing a game engine based on OpenGL rendering.

3. I tried updating my drivers before with some Intel apps (probably called "Intel Driver & Support Assistant"), and also tried updating with an app from my laptop vendor (Lenovo). However, the issue still persisted (and I have reported it here after all the updates). I will try again this week and let you know the results.

4. In the past, Intel drivers have crashed in other cases, but it was due to my fault with the render context initialization. I didn't have enough knowledge to properly report the problems there. This time, I was able to reproduce and isolate the problem to a single line of code, so I decided to report it.

5. Of course! When I update all my graphics drivers, I will try to reproduce the issue.

 

Thank you for your time! Again, I apologize for the delay in my response. Have a great day!

Best regards, Ilya A.

0 Kudos
VonM_Intel
Moderator
2,325 Views

Hi, gr3yknigh1.

I appreciate that. I completely understand how busy things can get.

It’s great that you were able to isolate the problem to a specific line of code. That’s a huge step forward in troubleshooting. Regarding the crash in the igxelpicd64.dll driver, it sounds like you’ve already made good progress with driver updates, and I think revisiting them after your next round of updates is a good plan.  

 

Once you've had the opportunity to reproduce the issue, please feel free to update us along with your latest SSU logs for further analysis.

 

Thank you again for keeping us in the loop.

 

Best regards,

Von M.

Intel Customer Support Technician

0 Kudos
VonM_Intel
Moderator
2,200 Views

Hi, gr3yknigh1.


Thank you for your patience. I have reviewed the thread carefully and understand that you are developing a game engine based on OpenGL rendering. Please note that we have a dedicated forum for these specific issues, so I will be moving this thread to the "Developing Games on Intel Graphics" section to ensure it gets addressed more promptly and effectively.


Best regards,

Von M.

Intel Customer Support Technician


0 Kudos
karen_intel
Moderator
2,141 Views

Hey @gr3yknigh1 Welcome to the Intel Game Dev Support Forum!
I will be assisting you in this case. Please have a look at our readme post

For debug purposes and to confirm the issue, can you share the executable or the small code to reproduce on our end?

The smaller, the better

Also, is your game engine in early development stage? If not, how many average users does it have?

Thanks, looking forward to hear from you

 

Karen

 

0 Kudos
gr3yknigh1
Beginner
2,127 Views

Hello! I have already shared the executables in this post. Please check the `README.txt` file, where I have explained where the code is located. It's quite small, but if is't still too large, I can try to extract a smaller example later. However, the smallest code snippet is in the initial post. All sources are located in the `codebase` folder, and you can build all using `build_without_conan.bat`. The minimal dependencies are MSVC and CMake.

 

This project is a private game engine that currently has only one user (me). But it's not only about game engine development. It's confusing, why this thread was moved to gamedev, because issue seems to be related to the graphics driver crashing due to a race condition.

 

Ilya. A

0 Kudos
karen_intel
Moderator
2,125 Views

Thanks @gr3yknigh1 . Allow me to do some debug with the package you shared.

The reason why it was moved is because anything that has to do with Development on Intel Graphics has to be handled in this forum, we're the specialists on development, which cannot be found in the regular Graphics Support Forums

I'll be back with my results, thanks for the fast response.

Karen

0 Kudos
Diner
Beginner
1,847 Views

Found 2 use cases:

 

Faced the same problem, but for me it was not a timing issue, just an initialization issue.

This happened because I'm porting an app from Legacy to Core OpenGL.

When you look at the "problem" code below and would set a breakpoint on the markers, here are the values of "PosAttrLoc": 

At marker #1: PosAttrLoc was 0

At marker #2: PosAttrLoc was -1 (bug here)

 

This was my "problem" code:

GLint PosAttrLoc = -1;

 

void SetupModel()

{
glGenVertexArrays(1, &MyMesh->VAO);
glBindVertexArray(MyMesh->VAO);

// ..

glVertexAttribPointer(PosAttrLoc, 3, GL_FLOAT, GL_FALSE, stride, Offset(PositionNormalUV0, Position[0])); // <-- marker #2: READ
glEnableVertexAttribArray(PosAttrLoc);

// ..

}

 

void CreateProgram()

{

// ..

MyProgram = glCreateProgram();

// ..
PosAttrLoc = glGetAttribLocation(MyProgram "aPosition"); // <-- marker #1: SET

// ..

}

 

void Render()

{
glUseProgram(ProgramSkinned);

// .. setup uniform and stuff

glVertexAttribPointer(PosAttrLoc, 3, GL_FLOAT, GL_FALSE, stride, Offset(PositionNormalUV0, Position[0]));
glEnableVertexAttribArray(PosAttrLoc);

 

 glDrawElements(GL_TRIANGLES, TriangleCount * 3, GL_UNSIGNED_INT, TriangleData);
}

 

int main()

{

// ..

SetupModel();

CreateProgram();

// ..

while (..)

{

  Render();

  // Swap buffers and poll events
  glfwSwapBuffers(window);
  glfwPollEvents();
}

}

 

Solution:

In hindsight it was a kind of a "got-ya"-issue..

At marker #1 and marker #2 I expected "PosAttrLoc" to be 0, so my model was setting up the Vertex Attributes with all -1 locations.

For me the crash of igxelpicd64.dll happened due to bad initialization (kind of weird that it the whole driver crashes because of this, maybe a driver fix would be nice that just throws some GL_ERROR instead, if possible).

@gr3yknigh1 Maybe you have something similar? (I haven't checked your code)

My first step would be to check all attribute locations and uniform locations after that check all the buffers and buffer sizes for your VAOs.

So the crash was caused by attribute location == -1.  

 

Fixed code:

int main()

{

// ..

// Swapped 2 initialization methods:

CreateProgram(); // Sets 'PosAttrLoc' (will set to '0')

SetupModel();      // Reads 'PosAttrLoc'

// ..

}

 

DLL Version: 31.0.101.4255

 

Happy New Year and kind regards,

 

Diner

 

Edit: Found a 2nd use case:

There are some serious issues with the driver..

 

 

// Initialization code:

static void CreateContainerColored(unsigned int& VBO, unsigned int& VAO, unsigned int& EBO)
{
// set up vertex data (and buffer(s)) and configure vertex attributes
// ------------------------------------------------------------------
float vertices[] = {
// positions // colors
0.25f, 0.25f, 0.0f, 1.0f, 0.0f, 0.0f,
0.25f, -0.25f, 0.0f, 0.0f, 1.0f, 0.0f,
-0.25f, -0.25f, 0.0f, 0.0f, 0.0f, 1.0f,
-0.25f, 0.25f, 0.0f, 1.0f, 1.0f, 0.0f,
};
unsigned int indices[] = {
0, 1, 3, // first triangle
1, 2, 3 // second triangle
};

glGenVertexArrays(1, &VAO);
glGenBuffers(1, &VBO);
glGenBuffers(1, &EBO);

glBindVertexArray(VAO);

glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);

glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW);

// position attribute
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)0);
glEnableVertexAttribArray(0);
// color attribute
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)(3 * sizeof(float)));
glEnableVertexAttribArray(1);

// marker #B: please note that we did NOT set 'aTexCoord', which is probably not the problem perse..

// but the stride is incorrect compared to the shader: 

// shader wants: vec3 + vec3 + vec2 == 8
// code supplies: 6 * sizeof(float)
}

// My Vertex Shader:

#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aColor;
layout (location = 2) in vec2 aTexCoord; // <-- marker #A
 
out vec3 ourColor;
 
void main()
{
gl_Position = vec4(aPos, 1.0);
ourColor = aColor;
}

 

Solution:

marker #A: This one is NOT set in our 'glVertexAttribPointer'. This causes a crash of igxelpicd64.dll.

marker #B: Here I've should have set the correct stride and 'aTexCoord'.

When I comment 'aTexCoord' out (so my stride is correct again) it no longer crashes (since stride is correct again).

So the crash was caused by shader stride != code stride.

 

 

 

 

0 Kudos
gr3yknigh1
Beginner
1,797 Views

Hello!

 

@Diner No. Please, read my initial post.

In my repro code, there are is no draw calls, no vertex prep code, and no shaders. Only glClearColor and glClear. There are no error codes was from OpenGL or Windows.

I have provided a minimal pseudo-example, and full source code (which is not that big).

 

Best regards,

Ilya

0 Kudos
Diner
Beginner
1,643 Views

Hi Ilya,

 

Tried to reproduce your issue with various combinations. But did not receive the error after a time (only immediately with some combinations). I used this code:

 

#define WANT_SEGFAULT_IN_IGXELPICDDLL
//#define ENABLE1
//#define ENABLE2
//#define ENABLE3
//#define ENABLE4
//#define ENABLE5
// Tried with everything enabled, toggled combinations and your 'WANT_SEGFAULT_IN_IGXELPICDDLL'
// Test duration: 2+ minutes in Visual Studio 2022 - 17.10.0
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>

const unsigned int width = 800;
const unsigned int height = 600;

// VS Project Settings:
// winmm.lib;opengl32.lib;glfw3.lib;%(AdditionalDependencies)
// Architecture 64-bit
// Unicode character set
// Use Debug Libraries: Yes
// Runtime: MDd
// Windows SDK: 10 (latest)
// Platform toolset: 143

// Tried these options here:
// nVidia control panel settings - preferred graphics processor:
// - Auto-select
// - Integrated graphics

int main(void)
{
// Initialize GLFW
glfwInit();
// Tell GLFW what version of OpenGL we are using
// In this case we are using OpenGL 3.3
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);

// Tell GLFW we are using the CORE profile
// So that means we only have the modern functions
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

GLFWwindow* window = glfwCreateWindow(width, height, "Test Window", NULL, NULL);
// Error check if the window fails to create
if (window == NULL)
{
std::cout << "Failed to create GLFW window" << std::endl;
glfwTerminate();
return -1;
}

// Introduce the window into the current context
glfwMakeContextCurrent(window);

//Load GLAD so it configures OpenGL
gladLoadGL();

#if defined(ENABLE1)
// Specify the viewport of OpenGL in the Window
// In this case the viewport goes from x = 0, y = 0, to x = 800, y = 800
glViewport(0, 0, width, height);
#endif

#if defined(ENABLE2)
while (!glfwWindowShouldClose(window))
#else
while (true)
#endif
{
#if defined(ENABLE3)
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window, true);
#endif

#if defined(ENABLE5)
glClear(GL_COLOR_BUFFER_BIT);
#endif
glClearColor(0, 0, 0, 1);

#if !defined(WANT_SEGFAULT_IN_IGXELPICDDLL)
glfwSwapBuffers(window);
#endif

#if !defined(ENABLE4)
glfwPollEvents();
#endif
}
}

 

If you enable in my minimal code: WANT_SEGFAULT_IN_IGXELPICDDLL + ENABLE5 I get do the exception immediately, not sure if that's helpful since your problem happens after some time has passed.

I've tried to disable as much as possible in the sample above.
Although I use glfw for my window setup and window event handling.
Please also note that I use OpenGL 3.3 Core for this test.

Tested for 2 min each test. And for me it either runs for 2 min or crashes immediately.
Maybe you can reproduce it with my code? If it works, you could try using glad and glfw in your own code and check if it works.

If I try the same with "preferred graphics card = nvidia" in nvidia control panel then no exception will be shown (at least with my nvidia geforce 4070 RTX Laptop GPU).

F.Y.I. my thread window to verify it has loaded the DLL:
Not Flagged 19684 0 Worker Thread igxelpicd64.dll thread igxelpicd64.dll!00007ffecc409b9c
Not Flagged 95608 0 Worker Thread igxelpicd64.dll thread dwmapi.dll!00007ff869075058
Not Flagged 73396 0 Worker Thread igxelpicd64.dll thread igxelpicd64.dll!00007ffecc9b61b5
Not Flagged 113288 0 Worker Thread igxelpicd64.dll thread igxelpicd64.dll!00007ffecc4c3651
Not Flagged 127828 0 Worker Thread combase.dll thread win32u.dll!00007ff86c061534
Not Flagged 115060 0 Worker Thread ntdll.dll thread ntdll.dll!00007ff86edb3ff4
Not Flagged 110084 0 Worker Thread ntdll.dll thread ntdll.dll!00007ff86edb3ff4
Not Flagged 106192 0 Worker Thread combase.dll thread combase.dll!00007ff86e4e07ad
Not Flagged 92164 0 Worker Thread InputHost.dll thread CoreMessaging.dll!00007ff864835b67
Not Flagged 112592 0 Worker Thread ntdll.dll thread ntdll.dll!00007ff86edb3ff4
Not Flagged 125548 0 Worker Thread ntdll.dll thread ntdll.dll!00007ff86edb3ff4
Not Flagged 124804 0 Worker Thread ntdll.dll thread ntdll.dll!00007ff86edb3ff4
Not Flagged 113280 0 Worker Thread ntdll.dll thread ntdll.dll!00007ff86edb3ff4
Not Flagged 109984 0 Worker Thread ntdll.dll thread ntdll.dll!00007ff86edb3ff4
Not Flagged > 27352 0 Main Thread Main Thread gr3y.exe!main


 

0 Kudos
gr3yknigh1
Beginner
1,619 Views

Hello! Thank you for your repro attempt. I have received the traceback. In terms of my code, it is similar to the implementation of glfw and glad. For the initialization of the render context, I used the documentation from Windows and Khronos. You can find my source code and a README.txt file that explains the notable parts. GLFW simply calls SwapBuffers and doesn't do anything else (similar to my implementation).

 

// glfw/src/wgl_context.c
static void swapBuffersWGL(_GLFWwindow* window)
{
    if (!window->monitor)
    {
        // HACK: Use DwmFlush when desktop composition is enabled on Windows Vista and 7
        if (!IsWindows8OrGreater() && IsWindowsVistaOrGreater())
        {
            BOOL enabled = FALSE;

            if (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled)
            {
                int count = abs(window->context.wgl.interval);
                while (count--)
                    DwmFlush();
            }
        }
    }

    SwapBuffers(window->context.wgl.dc);
}

 

By the way, at that time, my thread was stopped while calling `NtSetEvent`.

My thread:

00007FFE8CF9F8C8 nop dword ptr [rax+rax*1], eax
00007FFE8CF9F8D0 mov r10, rcx
00007FFE8CF9F8D3 mov eax, 0xe                             // NOTE: 0x000e = NtSetEvent: https://j00ru.vexillium.org/syscalls/nt/64/
00007FFE8CF9F8D8 test byte ptr [0x7ffe0308], 0x1
00007FFE8CF9F8E0 jnz 0x7ffe8cf9f8e5
00007FFE8CF9F8E2 syscall
00007FFE8CF9F8E4 ret

Here is a stacktrace:

gr3yknigh1_0-1736247276645.png

 

And it keeps crashing at the same point and at the same time. I tried four out of five times, and the counter reached 98230 before the crash happened. On the third attempt, it was 76733 (perhaps the fact that I was not focused on the window had something to do with the result).

 

Here is code with counter:

int x = 0;

while (!glfwWindowShouldClose(window))
{
    if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
        glfwSetWindowShouldClose(window, true);

    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0, 0, 0, 1);

    x += 1;
    printf("x = (%d) win32_error=(%d) gl_error=(%d)\n", x, GetLastError(), glGetError());

    // glfwSwapBuffers(window);

    glfwPollEvents();
}

 

And here is where driver's thread segfaults:

 

00007FFDEB182A1E add rax, 0x8
00007FFDEB182A22 jmp 0x7ffdeb182a0a
00007FFDEB182A24 mov eax, dword ptr [rcx+0x18]
00007FFDEB182A27 mov r9, rcx
00007FFDEB182A2A mov rcx, qword ptr [rcx+0x8]
00007FFDEB182A2E test rcx, rcx
00007FFDEB182A31 jz 0x7ffdeb182a4f
00007FFDEB182A33 lea r10, ptr [rcx+rax*1]
00007FFDEB182A37 cmp r10, 0x1000
00007FFDEB182A3E jbe 0x7ffdeb182a4a
00007FFDEB182A40 test rdx, rdx
00007FFDEB182A43 jz 0x7ffdeb182a4a
00007FFDEB182A45 mov ecx, dword ptr [rdx]
00007FFDEB182A47 mov dword ptr [r10], ecx                  // NOTE: Here is segfault
00007FFDEB182A4A add dword ptr [r9+0x18], 0x4
00007FFDEB182A4F ret

 

Registers:

gr3yknigh1_1-1736247509901.png

 

Stacktrace:

gr3yknigh1_2-1736247527602.png

 

I still believe that this issue is not only a problem with the game engine, and it should be addressed by the driver development team. Perhaps my code is causing this issue, but it's still strange that it's happening without any error codes.

 

It would be great if you could try to reproduce using my sources. I am still suspect race-condition of synchronization. After what I saw was called in glGetError implementation of `igxelpicd64.dll`.

 

---

 

Best regard,

Ilya

 

---

 

P.S. Sorry for the off-topic, but in terms of the reply's user interface, the previous forum board was much better. I was unable to format the code snippets properly. Come on, Intel is a multi-billion corporation. Why is the web UI such a mess? At this point, I am ready to throw the markdown files with the replies.

 

0 Kudos
Diner
Beginner
1,594 Views

Hi Ilya,


I think the problem you face is in your code, basically a configuration error (in this case calling obsolete API), I will explain at Recommendations-section (see the bold-text there).

As a response to your post:
The stack trace image: I cannot read the whole value of error_code, maybe it will tell you more (but I think recommendations might already solves your issue anyway).
You can run in also on an AMD Radeon or NVidia Geforce card to see what happens then (probably no exception, but just an empty window).

All the time I encounter the crash it's basically configuration error or bad opengl function calls.
You can also try to use: https://www.renderdoc.org it's a very powerful debugging tool and can also point out some configuration errors (like for example if you forget to call stuff in your code or pass wrong parameters and also VBO is still 0 [uninitialized]), maybe this will give you more answers.


One pointer I mentioned in my post about behavior:
If I have a configuration error in my opengl code the drivers act differently:
Intel driver (igxelpicd64.dll): exception
nvidia driver: nothing (no crash, no warning, you could say they decided just not to throw any exception at all)

 

Recommendations for your engine development (hope you don't mind giving you a code review and I'm not sure what stuff you already know):

- Use libraries like glut, glad, glfw for you engine (supports multi platform, so also linux and probably also macOS) and do not the Windows API. This also saves you from writing stuff like: Ignite_Win32_WindowProc and
- You use ARB functions, ARB is obsolete: ie. Ignite_WGL_CreateContextAttribARB and this could be your problem (so fixing this might solve your whole issue), this would make sense that the igxelpicd64.dll can throw an exception (so it's a code / configuration error you're facing, comparable with what I posted in one of my previous posts). So remove ARB-support completely and don't call those functions. Also ARB cannot be mixed with it's non-ARB variant.
- Using glad and glfw will also make checks like these: "if (Ignite_WGL_CreateContext == 0) {" unnecessary.
- ignite_gl.c would not be needed with glfw and glad (you probably don't want to write stuff like bindings to opengl, you want to do the fun part, so let a library worry about that).
- Windows API: never use CreateWindowExA, use CreateWindowEx, it automatically uses the correct one (A and W suffix are for unicode and multi byte). This goes for all your WinAPI functions in your code. (if you do want to use winapi, you probably want to use LPTSTR and TCHAR, but again please don't use any winapi if you don't have to)
- Maybe switch to C++ instead of C then you can create objects like Camera, Monster, Shader, Player with classes and methods (might be easier to use when as you develop your engine and you have inheritance, like Unit -> Monster or NPC).
- If you want: https://learnopengl.com/ is a good starting point, source is also on github (they also have a tiny engine, maybe you want to use it as a base for your engine?).
- AssImp can be used for model loading (also an example in leanopengl)
- UI library (controls like buttons and inputs for opengl): you can try ImGui or NanoGUI
- For best performance go for G-buffers and deferred rendering (also an example in leanopengl), to better understand: use renderdoc to see how it works (try with deferred rendering and the default forward rendering, so you get the idea).
- For a Math library, you might want to use glm (unless you want to write the math-helpers for calculations yourself).
- I see you use a different IDE, personally I like visual studio community it also has an addon for a highlighter for glsl.
- Here you can generate a glad.h manutally: https://glad.dav1d.de/ I used API - GL version 3.3 in my case and profile core (you can see below how I configure it) and if needed you can also add extensions when generating it. learnopengl also has one uploaded to github for their examples. And only use API-gl and core-profile.
- Can't find which opengl version you are using, I set it up like:

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); // version 3.3
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // profile Core
- If you develop (later on) heavy shaders, use a dedicated graphics card instead (nvidia or radeon) to get better performance

If you still have issues, feel free to let me know.

 

- Diner

 

 

 

0 Kudos
karen_intel
Moderator
1,650 Views

Thanks a lot @gr3yknigh1 

Let me do a couple testing and get back to you as soon as possible 

Karen

0 Kudos
Reply