# sample code for threaded texture.

**URL:** <https://forums.imgtec.com/t/sample-code-for-threaded-texture/2103>\
**Category:** PowerVR Insider\
**Created:** [June 17, 2014, 12:34am UTC](https://forums.imgtec.com/t/sample-code-for-threaded-texture/2103 "2014-06-17T00:34:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohanavelu-gnanavelu](https://avatars.discourse-cdn.com/v4/letter/m/9d8465/32.png) [@mohanavelu-gnanavelu](https://forums.imgtec.com/u/mohanavelu-gnanavelu)\
**Post date:** [June 17, 2014, 12:34am UTC](https://forums.imgtec.com/t/sample-code-for-threaded-texture/2103/1 "2014-06-17T00:34:49Z")

</div>

I would have to do the following :  
  
T#1: Create a background GL thread (1x1 pbuffer or use EGL\_KHR\_surfaceless\_context if it’s available)  
  
T#2: Create an FBO  
  
T#2: Bind a texture to it  
  
T#2: Call glClear() (the allocation will be done at this point, as the driver postpones allocation until the first operation is issued)  
  
T#2: Once the glClear() returns, send a signal to your main thread that the texture is available for use  
  
T#1: Bind the texture (whose backing store has now been allocated) to an FBO  
  
T#1: Reuse the texture attachment without any overhead  
  
  
  
do we have working sample for the same via emulator.

---

<div class="post-metadata">

**Author:** ![pauls](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@pauls](https://forums.imgtec.com/u/pauls)\
**Post date:** [June 18, 2014, 2:17pm UTC](https://forums.imgtec.com/t/sample-code-for-threaded-texture/2103/2 "2014-06-18T14:17:47Z")

</div>

Hello Mohanavelu,  
  
  
  
Yes, we have an example which is included in the 3.3 SDK release. It is called “MultiThreading” and is located in the SDK\_3.3/Examples/Intermediate/MultiThreading directory.  
  
  
  
Thanks,  
  
Paul
