Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ npm-debug.log

# Misc
deploy_key
deploy_key.pub
deploy_key.pub
.vscode/settings.json
13 changes: 6 additions & 7 deletions lib/aglsl/AGALTokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ export class AGALTokenizer {
}

public decribeAGALPart(array: ByteArray | Part): Description {
if (array instanceof ByteArray) {
if (array instanceof Part) {
const desc = this.decribeAGALByteArray(array.data);
desc.native = array.native;
return desc;
} else
return this.decribeAGALByteArray(array);
}

const desc = this.decribeAGALByteArray(array.data);
desc.native = array.native;

return desc;
}

public decribeAGALByteArray(bytes: ByteArray): Description {
bytes.position = 0;
const header: Header = new Header();

if (bytes.readUnsignedByte() != 0xa0) {
Expand Down
6 changes: 5 additions & 1 deletion lib/base/ContextGLProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ export enum ContextGLProfile
{
BASELINE,
BASELINE_CONSTRAINED,
BASELINE_EXTENDED
BASELINE_EXTENDED,
STANDARD,
STANDARD_CONSTRAINED,
STANDARD_EXTENDED,
ENHANCED
}
2 changes: 1 addition & 1 deletion lib/filters/tasks/TaskBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ContextGLProgramType } from '../../base/ContextGLProgramType';
import { _Stage_ImageBase, Image2D } from '../../image';

export class TaskBase {
protected _vertexConstantData = new Float32Array([
protected _vertexConstantData:Float32Array = new Float32Array([
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0
]);
Expand Down
1 change: 1 addition & 0 deletions lib/webgl/ContextWebGL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { Settings } from '../Settings';
import { FenceContextWebGL } from './FenceContextWebGL';
import * as GL_MAP from './ConstantsWebGL';
import { StatsWebGL } from './StatsWebGL';
import { IVertexBuffer } from '../base/IVertexBuffer';

let _DEBUG_renderMode: '' | 'line' = '';

Expand Down
10 changes: 5 additions & 5 deletions lib/webgl/ProgramWebGL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ export class ProgramWebGL implements IProgram {
: <string>indexOrName;

const info = this._program.uniforms[name];

if (!info)
return null;

return info.location;
}

Expand Down Expand Up @@ -300,7 +300,7 @@ export class ProgramWebGL implements IProgram {

const arr: ArrayLike<number> = <any> data;

if (arr.length !== info.size * size) {
if (arr.length !== info.size * size && arr.length !== info.size * size * 2) {

throw (
`[ProgramWebGL] Invalid data length for ${name}, expected ${info.size * size}, actual ${arr.length}`
Expand Down Expand Up @@ -373,6 +373,6 @@ export class ProgramWebGL implements IProgram {
}

public get glProgram(): WebGLProgram {
return this._program;
return this._program.program;
}
}
}
3 changes: 2 additions & 1 deletion lib/webgl/TextureContextWebGL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export class TextureContextWebGL {
public setTextureAt(sampler: number, texture: TextureWebGL): number {
const gl = this._context._gl;
const samplerState = this._samplerStates[sampler];
const textureType = GL_MAP.TEXTURE[texture.textureType];

if ((texture || samplerState.type)) {
gl.activeTexture(gl.TEXTURE0 + sampler);
Expand All @@ -132,6 +131,8 @@ export class TextureContextWebGL {
return -1;
}

const textureType = GL_MAP.TEXTURE[texture.textureType];

texture._state.id = sampler;

this.bindTexture(texture, false, textureType);
Expand Down