<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Segfault when calling glTexSubImage2D on storage texture to bound FBO"
href="https://bugs.freedesktop.org/show_bug.cgi?id=91673#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Segfault when calling glTexSubImage2D on storage texture to bound FBO"
href="https://bugs.freedesktop.org/show_bug.cgi?id=91673">bug 91673</a>
from <span class="vcard"><a class="email" href="mailto:dongseong.hwang@intel.com" title="Dongseong Hwang <dongseong.hwang@intel.com>"> <span class="fn">Dongseong Hwang</span></a>
</span></b>
<pre>(In reply to Tapani Pälli from <a href="show_bug.cgi?id=91673#c2">comment #2</a>)
<span class="quote">> With a bit of testing it seems things work fine if glTexStorage2D call is
> moved to happen right after first glBindTexture call (this is also how is
> being done in some Piglit tests). Maybe this will help you get forward while
> the bug is being fixed.</span >
That's good hint for chromium.
Mesa crashes on updating immutable texture bound to FBO.
So following code doesn't crash
GLuint tex_;
GLuint fbo_;
glGenTextures(1, &tex_);
glBindTexture(GL_TEXTURE_2D, tex_);
glGenFramebuffers(1, &fbo_);
glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
glFramebufferTexture2D(GL_FRAMEBUFFER,
GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D,
tex_,
0);
glBindTexture(GL_TEXTURE_2D, tex_);
glTexStorage2D(GL_TEXTURE_2D, 2, GL_RGBA8, 2, 2);
// hack to prevent crash
glFramebufferTexture2D(GL_FRAMEBUFFER,
GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D,
0,
0);
// not SEGFAULT lol
glTexSubImage2D(GL_TEXTURE_2D,
0,
0, 0,
2, 2,
GL_RGBA, GL_UNSIGNED_BYTE,
source_pixels);
glFramebufferTexture2D(GL_FRAMEBUFFER,
GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D,
tex_,
0);</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>