Skip to content

Commit

Permalink
Merge branch 'gh-pages' into rename-framebuffer-bind
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolalysenko authored Oct 11, 2016
2 parents 0367be1 + 48c2719 commit 92bbe5b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ A data source from an image can be one of the following types:
| `data` | Input data (see below) | |
| `mipmap` | See below for a description | `false` |
| `flipY` | Flips textures vertically when uploading | `false` |
| `alignment` | Sets unpack alignment per pixel | `1` |
| `alignment` | Sets unpack alignment per row | `1` |
| `premultiplyAlpha` | Premultiply alpha when unpacking | `false` |
| `colorSpace` | Sets colorspace conversion | `'none'` |
| `data` | Image data for the texture | `null` |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

To define a command you specify a mixture of static and dynamic data for the object. Once this is done, `regl` takes this description and then compiles it into optimized JavaScript code. For example, here is a simple `regl` program to draw a triangle:

```JavaScript
```js
// Calling the regl module with no arguments creates a full screen canvas and
// WebGL context, and then uses this context to initialize a new REGL instance
const regl = require('regl')()
Expand Down
6 changes: 4 additions & 2 deletions lib/util/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,10 @@ function checkTexture2D (info, mipData, limits) {
if (img.compressed) {
// TODO: check size for compressed images
} else if (img.data) {
check(img.data.byteLength === mw * mh *
Math.max(pixelSize(img.type, c), img.unpackAlignment),
// check(img.data.byteLength === mw * mh *
// Math.max(pixelSize(img.type, c), img.unpackAlignment),
var rowSize = Math.ceil(pixelSize(img.type, c) * mw / img.unpackAlignment) * img.unpackAlignment
check(img.data.byteLength === rowSize * mh,
'invalid data for image, buffer size is inconsistent with image format')
} else if (img.element) {
// TODO: check element can be loaded
Expand Down
8 changes: 4 additions & 4 deletions test/texture2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,9 @@ tape('texture 2d', function (t) {
regl.texture({
shape: [2, 2, 1],
flipY: true,
alignment: 2,
alignment: 4,
colorSpace: 'none',
data: new Uint8Array([1, 0, 2, 0, 3, 0, 4, 0])
data: new Uint8Array([1, 2, 0, 0, 3, 4, 0, 0])
}),
{
width: 2,
Expand All @@ -535,7 +535,7 @@ tape('texture 2d', function (t) {
regl.texture({
shape: [4, 4, 1],
flipY: true,
alignment: 2,
alignment: 4,
mipmap: [
{
alignment: 1,
Expand All @@ -549,7 +549,7 @@ tape('texture 2d', function (t) {
{
flipY: false,
colorSpace: 'none',
data: new Uint8Array([1, 0, 2, 0, 3, 0, 4, 0])
data: new Uint8Array([1, 2, 0, 0, 3, 4, 0, 0])
},
{
alignment: 1,
Expand Down

0 comments on commit 92bbe5b

Please sign in to comment.