<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: WebGL context is lost when clearing stencil buffer in Developing Games on Intel Graphics</title>
    <link>https://community.intel.com/t5/Developing-Games-on-Intel/WebGL-context-is-lost-when-clearing-stencil-buffer/m-p/1313517#M1815</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/159997"&gt;@focego&lt;/a&gt;&amp;nbsp;, that's impressive !&lt;/P&gt;</description>
    <pubDate>Fri, 10 Sep 2021 02:43:06 GMT</pubDate>
    <dc:creator>R5dwMg</dc:creator>
    <dc:date>2021-09-10T02:43:06Z</dc:date>
    <item>
      <title>WebGL context is lost when clearing stencil buffer</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/WebGL-context-is-lost-when-clearing-stencil-buffer/m-p/1276144#M1787</link>
      <description>&lt;P&gt;I originally posted the issue here - &lt;A href="https://community.intel.com/t5/Graphics/WebGL-context-is-lost-when-clearing-stencil-buffer/m-p/1275921" target="_blank" rel="noopener"&gt;https://community.intel.com/t5/Graphics/WebGL-context-is-lost-when-clearing-stencil-buffer/m-p/1275921&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Our webgl games crashes "randomly" on machines with intel graphics. My theory is that there is a leak in the driver when clearing the stencil with a non 0xff bitmask.&lt;BR /&gt;Here is what I found so far:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Description:&lt;/STRONG&gt;&lt;BR /&gt;The WebGL context is lost and not recovered again, when performing certain stencil buffer clears.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Hardware:&lt;/STRONG&gt;&lt;BR /&gt;The issue has been reported on a number of devices including desktops, NUCs and laptops. With the common factor being Intel graphics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Software:&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;Intel Drivers:&lt;/EM&gt;&lt;BR /&gt;27.20.100.8280 - This version works&lt;BR /&gt;27.20.100.8336 - This and all versions after fail&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Browser:&lt;/EM&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Firefox - works&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="font-family: inherit;"&gt;Chrome, Edge(chromium) - fails&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Note 1: the issue only happens when using the default D3D11 rendering and not when using D3D9 (set using the flags)&lt;BR /&gt;Note 2: the chrome behavior is the same with both the latest version and a 2 year old version (i.e. 2 year old version works with 8280 and fails with 8336)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;How to repro:&lt;/STRONG&gt;&lt;BR /&gt;1. Clear the stencil at least once per frame, with a non zero, non 0xff mask.&lt;BR /&gt;2. Let it run for 1-5 minutes&lt;BR /&gt;3. See that the context is lost and not recovered again&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Source Code:&lt;/STRONG&gt;&lt;BR /&gt;&lt;A href="https://codepen.io/fredrikolsson/pen/zYNRaLB" target="_blank" rel="noopener"&gt;https://codepen.io/fredrikolsson/pen/zYNRaLB&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="html"&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html&amp;gt;
	&amp;lt;body&amp;gt;
		&amp;lt;canvas id="glcanvas" width="1024" height="1024"/&amp;gt;
	&amp;lt;/body&amp;gt;
	&amp;lt;script&amp;gt;
		const canvas = document.querySelector('#glcanvas');
		const gl = canvas.getContext('webgl', {'stencil': true});
		gl.enable(gl.STENCIL_TEST);
		let frame = 0;
		(function loop() {
			gl.clearColor((++frame * 0.01) % 1.0, 0.0, 0.0, 1.0);
			gl.clear(gl.COLOR_BUFFER_BIT);
			for (let i=0; i&amp;lt;8; i++) {
				gl.stencilMask(1 &amp;lt;&amp;lt; i);
				gl.clear(gl.STENCIL_BUFFER_BIT);
			}
			requestAnimationFrame(loop);
		})();
	&amp;lt;/script&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 10:52:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/WebGL-context-is-lost-when-clearing-stencil-buffer/m-p/1276144#M1787</guid>
      <dc:creator>focego</dc:creator>
      <dc:date>2021-04-23T10:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: WebGL context is lost when clearing stencil buffer</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/WebGL-context-is-lost-when-clearing-stencil-buffer/m-p/1313267#M1813</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A id="link_10" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.intel.com/t5/user/viewprofilepage/user-id/159997" target="_self" aria-label="View Profile of focego"&gt;&lt;SPAN class=""&gt;focego&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I met the same issue that running Chrome on D3D11, Intel UHD Graphics.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My game could crash because of web gl context ,even just place it idle.&lt;/P&gt;
&lt;P&gt;After removing stencil masks, the problem gone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Observations&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Firefox,&amp;nbsp;Intel UHD Graphics:&amp;nbsp; &lt;FONT color="#008000"&gt;good&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Chrome, D3D11,&amp;nbsp; Intel UHD Graphics 630: &lt;FONT color="#993300"&gt;issue&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Chrome, D3D11, Intel HD Graphics 530 | &lt;SPAN&gt;Iris(TM) Pro Graphics 6200&lt;/SPAN&gt;, GeForce GT430:&amp;nbsp; &lt;FONT color="#008000"&gt;good&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Chrome, &lt;STRONG&gt;D3D9&lt;/STRONG&gt;,&amp;nbsp; Intel UHD Graphics 630: &lt;FONT color="#008000"&gt;good&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seems now up to Chrome version 93 the issue is still not yet fixed.&amp;nbsp; Did you resolve the issue or did you find any workaround ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 04:07:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/WebGL-context-is-lost-when-clearing-stencil-buffer/m-p/1313267#M1813</guid>
      <dc:creator>R5dwMg</dc:creator>
      <dc:date>2021-09-10T04:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: WebGL context is lost when clearing stencil buffer</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/WebGL-context-is-lost-when-clearing-stencil-buffer/m-p/1313274#M1814</link>
      <description>&lt;P&gt;I ended up making a software implementation of the stencil buffer using an extra rgb buffer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The games run a bit slower, but we swap implementation based on&amp;nbsp;&lt;EM&gt;&lt;SPAN style="font-family: inherit;"&gt;WEBGL_debug_renderer_info&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN style="font-family: inherit;"&gt; so it only affects&amp;nbsp;&lt;/SPAN&gt;customers with Intel GPUs.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 11:18:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/WebGL-context-is-lost-when-clearing-stencil-buffer/m-p/1313274#M1814</guid>
      <dc:creator>focego</dc:creator>
      <dc:date>2021-09-09T11:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: WebGL context is lost when clearing stencil buffer</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/WebGL-context-is-lost-when-clearing-stencil-buffer/m-p/1313517#M1815</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/159997"&gt;@focego&lt;/a&gt;&amp;nbsp;, that's impressive !&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 02:43:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/WebGL-context-is-lost-when-clearing-stencil-buffer/m-p/1313517#M1815</guid>
      <dc:creator>R5dwMg</dc:creator>
      <dc:date>2021-09-10T02:43:06Z</dc:date>
    </item>
  </channel>
</rss>

