mbebenita / Broadway

A JavaScript H.264 decoder.
Other
2.73k stars 424 forks source link

WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not big enough for request #238

Open projsdev97 opened 2 years ago

projsdev97 commented 2 years ago

Hi @soliton4 How are you? Hope you are doing well. I've checked your activities that you had replied to so many questions up to now. Thanks for your all effort.

I've recently got this issue when rendering 2k video "WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not big enough for request" image

I will appreciate it if you can help me in a short time. Thanks.

keithrausch commented 2 years ago

What is the horizontal resolution of your video? My understanding is that OpenGL typically expects a horizontal width that's divisible by 4. See this: https://www.khronos.org/opengl/wiki/Common_Mistakes#Texture_upload_and_pixel_reads

When I work with strangely sized images in my code I have to write:

if (width % 4 != 0)  
  gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);