Note that there are some explanatory texts on larger screens.

plurals
  1. PONVidia driver 320.86 texture buffer bug leads to crash
    text
    copied!<p>The following code crashes really quickly ( way before the max buffer size of 2^27 texels )</p> <p>I stripped every useless line of code, to make it easier to read.</p> <pre><code>const int MAX_LAYER_DEPTH = 5; #include "vapp.h" #include "vmath.h" #include &lt;stdio.h&gt; BEGIN_APP_DECLARATION(OITDemo) // Override functions from base class virtual void Initialize(const char * title); virtual void Display(bool auto_redraw); virtual void Finalize(void); virtual void Reshape(int width, int height); GLuint linked_list_buffer; GLuint linked_list_texture; GLint current_width; GLint current_height; END_APP_DECLARATION() DEFINE_APP(OITDemo, "Order Independent Transparency") void OITDemo::Initialize(const char * title) { base::Initialize(title); glGenBuffers(1, &amp;linked_list_buffer); glGenTextures(1, &amp;linked_list_texture); Reshape(100,100); return; } void OITDemo::Display(bool auto_redraw) { glClearColor(1.0f, 1.0f, 1.0f, 0.0f); glBindImageTexture(1, linked_list_texture, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_RGBA32UI); glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT); base::Display(); return; } void OITDemo::Reshape(int width, int height) { current_width = width; current_height = height; glBindImageTexture(1, 0, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_RGBA32UI); static GLuint texBufferSize = 2047; ++texBufferSize; printf("%d : texBufferSize\n",texBufferSize); glBindBuffer(GL_TEXTURE_BUFFER, linked_list_buffer); glBufferData(GL_TEXTURE_BUFFER, texBufferSize * texBufferSize * MAX_LAYER_DEPTH * sizeof(vmath::vec4), NULL, GL_DYNAMIC_DRAW); glBindBuffer(GL_TEXTURE_BUFFER, 0); // Bind it to a texture (for use as a TBO) glBindTexture(GL_TEXTURE_BUFFER, linked_list_texture); glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA32UI, linked_list_buffer); glBindTexture(GL_TEXTURE_BUFFER, 0); glViewport(0, 0, current_width, current_height); return; } void OITDemo::Finalize(void) { glDeleteTextures(1, &amp;linked_list_texture); glDeleteBuffers(1, &amp;linked_list_buffer); } </code></pre> <p>The driver most probably can't handle fragmentation It crashes between reallocation of 21694445 ( 2083 x 2083 x 5 ) and 23587920 elements. The maximum buffer size ( number of texels ) returned by the graphic card is 2^27 ( 134 millions texels )</p> <p>It seems to work better if we allocate one big buffer at the start of the application and never change it. But fails miserably if we try to reallocate it during the life of the application.</p> <p>Originally the code binds the image texture then trace using a shader that uses that image texture with imageStore but I discovered that I don't need any shader to make the driver crash.</p> <p>Any clue to predict/prevent the driver crash?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload