Skip to content

Commit 8c2fd1e

Browse files
authored
Allow passing raw data to Texture constructor
This facilitates being able to pass in data for use in GPGPU applications
1 parent fdf723f commit 8c2fd1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/texture.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function Texture(width, height, options) {
5454
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);
5555
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, options.wrap || options.wrapS || gl.CLAMP_TO_EDGE);
5656
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, options.wrap || options.wrapT || gl.CLAMP_TO_EDGE);
57-
gl.texImage2D(gl.TEXTURE_2D, 0, this.format, width, height, 0, this.format, this.type, null);
57+
gl.texImage2D(gl.TEXTURE_2D, 0, this.format, width, height, 0, this.format, this.type, options.data || null);
5858
}
5959

6060
var framebuffer;

0 commit comments

Comments
 (0)