January 18, 2014 Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benjamin Thaut | Le 13/01/2014 22:47, Benjamin Thaut a écrit :
> Am 13.01.2014 21:52, schrieb Xavier Bigand:
>> glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,9)
>> glBindBuffer(GL_ARRAY_BUFFER,10)
>> glEnableVertexAttribArray(0)
>> glVertexAttribPointer(0,3,GL_FLOAT,false,12,00000000)
>> glBindBuffer(GL_ARRAY_BUFFER,11)
>> glEnableVertexAttribArray(1)
>> glVertexAttribPointer(1,4,GL_FLOAT,false,16,00000000)
>> glDrawElements(GL_LINE_LOOP,4,GL_UNSIGNED_INT,00000000) GLSL=4
>> ----->glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT)
>> ----->----->glUseProgram(4)
>> ----->----->glUniformMatrix4fv(0,1,false,[0.002497,0.000000,0.000000,0.000000,0.000000,-0.003333,0.000000,0.000000,0.000000,0.000000,-0.010000,0.000000,-1.000000,1.000000,0.000000,1.000000])
>>
>>
>> ----->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,9)
>> ----->----->glBindBuffer(GL_ARRAY_BUFFER,10)
>> ----->----->glEnableVertexAttribArray(0)
>> ----->----->glVertexAttribPointer(0,3,GL_FLOAT,false,12,00000000)
>> ----->----->glBindBuffer(GL_ARRAY_BUFFER,11)
>> ----->----->glEnableVertexAttribArray(1)
>> ----->----->glVertexAttribPointer(1,4,GL_FLOAT,false,16,00000000)
>> ----->----->glDrawElements(GL_LINE_LOOP,4,GL_UNSIGNED_INT,00000000)
>> GLSL=4
>>
>> This extract seems to correspond of latest gl command called just before
>> the crash after the window resize. It doesn't seems to have any error
>> here.
>>
>
> Yes this indeed looks correct.
> Maybe its even a bug in the driver. Because it happens right after the
> window resize graphic resource might got invalid and the driver would
> need to re-create them. The problem ist most likely that you use two
> array buffers, one for each attribute, instead of using one array buffer
> and interleaving the attribute (this is the usual way). I could bet,
> that if you switch over to the interleaved variant, the problem goes away.
>
> You could also try to make the three buffers slightly larger and
> specifiy different pointers to see which one actually causes the invalid
> read. So that the calls become:
>
> > ----->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,9)
> > ----->----->glBindBuffer(GL_ARRAY_BUFFER,10)
> > ----->----->glEnableVertexAttribArray(0)
> > ----->----->glVertexAttribPointer(0,3,GL_FLOAT,false,12,00000000)
> > ----->----->glBindBuffer(GL_ARRAY_BUFFER,11)
> > ----->----->glEnableVertexAttribArray(1)
> > ----->----->glVertexAttribPointer(1,4,GL_FLOAT,false,16,00000016)
> > ----->----->glDrawElements(GL_LINE_LOOP,4,GL_UNSIGNED_INT,00000004)
> GLSL=4
>
> You could then see from the access violation which of the three buffers
> the read attempt fails.
>
> You could also try to move the glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,9)
> right before the glDrawElements call.
>
> Kind Regards
> Benjamin Thaut
I am not sure the issue come really from my code, cause it just works fine on ATI cards, I do something Nvidia drivers dislike.
I tried to replace GL_LINE_LOOP by triangles, increase buffer size, put the GL_ELEMENT_ARRAY_BUFFER buffer type bind right before glDrawElements without success.
Crash only append when I fill text mesh before those ones. So I need dig more.
|
January 22, 2014 Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Xavier Bigand | On Saturday, 18 January 2014 at 19:40:38 UTC, Xavier Bigand wrote:
> I am not sure the issue come really from my code, cause it just works fine on ATI cards, I do something Nvidia drivers dislike.
>
> I tried to replace GL_LINE_LOOP by triangles, increase buffer size, put the GL_ELEMENT_ARRAY_BUFFER buffer type bind right before glDrawElements without success.
>
> Crash only append when I fill text mesh before those ones. So I need dig more.
From what i saw in your code you are not using Vertex Array Objects. I have had similar problems that code ran fine on ATI but crashed on nvidia. The problem went away for me when i just created and bound a global VAO just after context creation.
Also i would recommend calling glGetError after every call, it helps finding errors. Here is a simple trick to do this automatically.
static gl
{
static ref auto opDispatch(string name, Args...)(Args args)
{
enum glName = "gl" ~ name[0].toUpper.to!string ~ name[1 .. $];
debug scope(exit) checkGLError(); //Do glGetError and log it or something.
mixin("return " ~ glName ~ "(args);");
}
}
After this simply change all glFunctionName(args) to gl.functionName or gl.functionName.
|
January 22, 2014 Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000 | ||||
---|---|---|---|---|
| ||||
Posted in reply to TheFlyingFiddle | On Wednesday, 22 January 2014 at 02:11:02 UTC, TheFlyingFiddle wrote:
> On Saturday, 18 January 2014 at 19:40:38 UTC, Xavier Bigand wrote:
>> I am not sure the issue come really from my code, cause it just works fine on ATI cards, I do something Nvidia drivers dislike.
>>
>> I tried to replace GL_LINE_LOOP by triangles, increase buffer size, put the GL_ELEMENT_ARRAY_BUFFER buffer type bind right before glDrawElements without success.
>>
>> Crash only append when I fill text mesh before those ones. So I need dig more.
>
> From what i saw in your code you are not using Vertex Array Objects. I have had similar problems that code ran fine on ATI but crashed on nvidia. The problem went away for me when i just created and bound a global VAO just after context creation.
>
> Also i would recommend calling glGetError after every call, it helps finding errors. Here is a simple trick to do this automatically.
>
> static gl
> {
>
> static ref auto opDispatch(string name, Args...)(Args args)
> {
> enum glName = "gl" ~ name[0].toUpper.to!string ~ name[1 .. $];
>
> debug scope(exit) checkGLError(); //Do glGetError and log it or something.
> mixin("return " ~ glName ~ "(args);");
> }
> }
>
>
> After this simply change all glFunctionName(args) to gl.functionName or gl.functionName.
I will try the global VAO.
I already check glError with "checkgl!" function.
|
January 30, 2014 Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Flamaros | Le 22/01/2014 14:13, Flamaros a écrit :
> On Wednesday, 22 January 2014 at 02:11:02 UTC, TheFlyingFiddle wrote:
>> On Saturday, 18 January 2014 at 19:40:38 UTC, Xavier Bigand wrote:
>>> I am not sure the issue come really from my code, cause it just works
>>> fine on ATI cards, I do something Nvidia drivers dislike.
>>>
>>> I tried to replace GL_LINE_LOOP by triangles, increase buffer size,
>>> put the GL_ELEMENT_ARRAY_BUFFER buffer type bind right before
>>> glDrawElements without success.
>>>
>>> Crash only append when I fill text mesh before those ones. So I need
>>> dig more.
>>
>> From what i saw in your code you are not using Vertex Array Objects. I
>> have had similar problems that code ran fine on ATI but crashed on
>> nvidia. The problem went away for me when i just created and bound a
>> global VAO just after context creation.
>>
>> Also i would recommend calling glGetError after every call, it helps
>> finding errors. Here is a simple trick to do this automatically.
>>
>> static gl
>> {
>>
>> static ref auto opDispatch(string name, Args...)(Args args)
>> {
>> enum glName = "gl" ~ name[0].toUpper.to!string ~ name[1 .. $];
>>
>> debug scope(exit) checkGLError(); //Do glGetError and log it or
>> something.
>> mixin("return " ~ glName ~ "(args);");
>> }
>> }
>>
>>
>> After this simply change all glFunctionName(args) to gl.functionName
>> or gl.functionName.
>
> I will try the global VAO.
>
> I already check glError with "checkgl!" function.
I finally found the issue, glDisableVertexAttribArray calls were missing. I just doesn't understand why it works majority of times and any openGL debugging tool was able to warm me about that.
Maybe I need try DirectX and see if debugging tools are better.
|
Copyright © 1999-2021 by the D Language Foundation