From d81ff6fba6771fedf87daed4be076b5d3fe6cd4d Mon Sep 17 00:00:00 2001 From: jerrywwl Date: Mon, 11 Feb 2019 14:18:43 +0800 Subject: [PATCH] commit files --- cocos/gfx/webgl/webgl-binding-layout.ts | 16 +++++++++------- cocos/gfx/webgl/webgl-buffer.ts | 17 +++++++++++------ cocos/gfx/webgl/webgl-device.ts | 4 ++-- cocos/gfx/webgl/webgl-framebuffer.ts | 4 ++-- cocos/gfx/webgl/webgl-input-assembler.ts | 2 +- cocos/gfx/webgl/webgl-pipeline-state.ts | 2 +- cocos/gfx/webgl/webgl-sampler.ts | 2 +- cocos/gfx/webgl/webgl-shader.ts | 2 +- cocos/gfx/webgl/webgl-texture.ts | 4 ++-- 9 files changed, 30 insertions(+), 23 deletions(-) diff --git a/cocos/gfx/webgl/webgl-binding-layout.ts b/cocos/gfx/webgl/webgl-binding-layout.ts index c11e83cc05..4064b9fdc0 100644 --- a/cocos/gfx/webgl/webgl-binding-layout.ts +++ b/cocos/gfx/webgl/webgl-binding-layout.ts @@ -1,10 +1,10 @@ import { GFXBindingLayout, GFXBindingUnit, IGFXBindingLayoutInfo } from '../binding-layout'; -import { GFXStatus, GFXBindingType } from '../define'; +import { GFXBindingType, GFXStatus } from '../define'; import { GFXDevice } from '../device'; -import { WebGLGPUBindingLayout, WebGLGPUBinding } from './webgl-gpu-objects'; import { WebGLGFXBuffer } from './webgl-buffer'; -import { WebGLGFXTextureView } from './webgl-texture-view'; +import { WebGLGPUBinding, WebGLGPUBindingLayout } from './webgl-gpu-objects'; import { WebGLGFXSampler } from './webgl-sampler'; +import { WebGLGFXTextureView } from './webgl-texture-view'; export class WebGLGFXBindingLayout extends GFXBindingLayout { @@ -66,17 +66,19 @@ export class WebGLGFXBindingLayout extends GFXBindingLayout { switch (bindingUnit.type) { case GFXBindingType.UNIFORM_BUFFER: { if (bindingUnit.buffer) { - this._gpuBindingLayout.gpuBindings[i].gpuBuffer = (bindingUnit.buffer as WebGLGFXBuffer).gpuBuffer; + this._gpuBindingLayout.gpuBindings[i].gpuBuffer = + (bindingUnit.buffer as WebGLGFXBuffer).gpuBuffer; } break; } case GFXBindingType.SAMPLER: { if (bindingUnit.texView) { - this._gpuBindingLayout.gpuBindings[i].gpuTexView = (bindingUnit.texView as WebGLGFXTextureView).gpuTextureView; + this._gpuBindingLayout.gpuBindings[i].gpuTexView = + (bindingUnit.texView as WebGLGFXTextureView).gpuTextureView; } - if (bindingUnit.sampler) { - this._gpuBindingLayout.gpuBindings[i].gpuSampler = (bindingUnit.sampler as WebGLGFXSampler).gpuSampler; + this._gpuBindingLayout.gpuBindings[i].gpuSampler = + (bindingUnit.sampler as WebGLGFXSampler).gpuSampler; } break; } diff --git a/cocos/gfx/webgl/webgl-buffer.ts b/cocos/gfx/webgl/webgl-buffer.ts index adb932b919..3f60598413 100644 --- a/cocos/gfx/webgl/webgl-buffer.ts +++ b/cocos/gfx/webgl/webgl-buffer.ts @@ -1,9 +1,14 @@ import { GFXBuffer, GFXBufferSource, IGFXBufferInfo, IGFXIndirectBuffer } from '../buffer'; import { GFXBufferUsageBit, GFXMemoryUsageBit, GFXStatus } from '../define'; import { GFXDevice } from '../device'; +import { + WebGLCmdFuncCreateBuffer, + WebGLCmdFuncDestroyBuffer, + WebGLCmdFuncResizeBuffer, + WebGLCmdFuncUpdateBuffer, +} from './webgl-commands'; import { WebGLGFXDevice } from './webgl-device'; import { WebGLGPUBuffer } from './webgl-gpu-objects'; -import { WebGLCmdFuncCreateBuffer, WebGLCmdFuncDestroyBuffer, WebGLCmdFuncResizeBuffer, WebGLCmdFuncUpdateBuffer } from './webgl-commands'; export class WebGLGFXBuffer extends GFXBuffer { @@ -88,7 +93,7 @@ export class WebGLGFXBuffer extends GFXBuffer { this._gpuBuffer.size = this._gpuBuffer.buffer.byteLength; } } - + WebGLCmdFuncResizeBuffer(this._device as WebGLGFXDevice, this._gpuBuffer); } } @@ -105,10 +110,10 @@ export class WebGLGFXBuffer extends GFXBuffer { } WebGLCmdFuncUpdateBuffer( - this._device as WebGLGFXDevice, - this._gpuBuffer!, - buffer, - offset || 0, + this._device as WebGLGFXDevice, + this._gpuBuffer!, + buffer, + offset || 0, buffSize); } } diff --git a/cocos/gfx/webgl/webgl-device.ts b/cocos/gfx/webgl/webgl-device.ts index a11beb7b8a..0319de5c7d 100644 --- a/cocos/gfx/webgl/webgl-device.ts +++ b/cocos/gfx/webgl/webgl-device.ts @@ -178,8 +178,8 @@ export class WebGLGFXDevice extends GFXDevice { public initialize (info: IGFXDeviceInfo): boolean { this._canvas = info.canvasElm as HTMLCanvasElement; - this._isAntialias = info.isAntialias !== undefined? info.isAntialias : true; - this._isPremultipliedAlpha = info.isPremultipliedAlpha !== undefined? info.isPremultipliedAlpha : true; + this._isAntialias = info.isAntialias !== undefined ? info.isAntialias : true; + this._isPremultipliedAlpha = info.isPremultipliedAlpha !== undefined ? info.isPremultipliedAlpha : true; try { const webGLCtxAttribs: WebGLContextAttributes = { diff --git a/cocos/gfx/webgl/webgl-framebuffer.ts b/cocos/gfx/webgl/webgl-framebuffer.ts index 6d9d3a9029..3817b36c90 100644 --- a/cocos/gfx/webgl/webgl-framebuffer.ts +++ b/cocos/gfx/webgl/webgl-framebuffer.ts @@ -1,11 +1,11 @@ import { GFXStatus } from '../define'; import { GFXDevice } from '../device'; import { GFXFramebuffer, IGFXFramebufferInfo } from '../framebuffer'; +import { WebGLCmdFuncCreateFramebuffer, WebGLCmdFuncDestroyFramebuffer } from './webgl-commands'; import { WebGLGFXDevice } from './webgl-device'; import { WebGLGPUFramebuffer, WebGLGPUTextureView } from './webgl-gpu-objects'; import { WebGLGFXRenderPass } from './webgl-render-pass'; import { WebGLGFXTextureView } from './webgl-texture-view'; -import { WebGLCmdFuncCreateFramebuffer, WebGLCmdFuncDestroyFramebuffer } from './webgl-commands'; export class WebGLGFXFramebuffer extends GFXFramebuffer { @@ -24,7 +24,7 @@ export class WebGLGFXFramebuffer extends GFXFramebuffer { this._renderPass = info.renderPass; this._colorViews = info.colorViews || []; this._depthStencilView = info.depthStencilView || null; - this._isOffscreen = info.isOffscreen !== undefined? info.isOffscreen : false; + this._isOffscreen = info.isOffscreen !== undefined ? info.isOffscreen : false; if (this._isOffscreen) { diff --git a/cocos/gfx/webgl/webgl-input-assembler.ts b/cocos/gfx/webgl/webgl-input-assembler.ts index b0339f5ab5..c95a30c459 100644 --- a/cocos/gfx/webgl/webgl-input-assembler.ts +++ b/cocos/gfx/webgl/webgl-input-assembler.ts @@ -4,7 +4,7 @@ import { GFXInputAssembler, IGFXInputAssemblerInfo } from '../input-assembler'; import { WebGLGFXBuffer } from './webgl-buffer'; import { WebGLCmdDraw, WebGLCmdFuncCreateInputAssember } from './webgl-commands'; import { WebGLGFXDevice } from './webgl-device'; -import { WebGLGPUInputAssembler, WebGLGPUBuffer } from './webgl-gpu-objects'; +import { WebGLGPUBuffer, WebGLGPUInputAssembler } from './webgl-gpu-objects'; export class WebGLGFXInputAssembler extends GFXInputAssembler { diff --git a/cocos/gfx/webgl/webgl-pipeline-state.ts b/cocos/gfx/webgl/webgl-pipeline-state.ts index 7050740657..b1431a16cb 100644 --- a/cocos/gfx/webgl/webgl-pipeline-state.ts +++ b/cocos/gfx/webgl/webgl-pipeline-state.ts @@ -2,9 +2,9 @@ import { GFXStatus } from '../define'; import { GFXDevice } from '../device'; import { GFXPipelineState, IGFXPipelineStateInfo } from '../pipeline-state'; import { WebGLGPUPipelineState } from './webgl-gpu-objects'; +import { WebGLGFXPipelineLayout } from './webgl-pipeline-layout'; import { WebGLGFXRenderPass } from './webgl-render-pass'; import { WebGLGFXShader } from './webgl-shader'; -import { WebGLGFXPipelineLayout } from './webgl-pipeline-layout'; const WebGLPrimitives: GLenum[] = [ WebGLRenderingContext.POINTS, diff --git a/cocos/gfx/webgl/webgl-sampler.ts b/cocos/gfx/webgl/webgl-sampler.ts index 3d7b0a95c3..6a2e3a0293 100644 --- a/cocos/gfx/webgl/webgl-sampler.ts +++ b/cocos/gfx/webgl/webgl-sampler.ts @@ -1,4 +1,4 @@ -import { GFXStatus, GFXFilter } from '../define'; +import { GFXFilter, GFXStatus } from '../define'; import { GFXDevice } from '../device'; import { GFXSampler, GFXSamplerState, IGFXSamplerInfo } from '../sampler'; import { WebGLGFXDevice } from './webgl-device'; diff --git a/cocos/gfx/webgl/webgl-shader.ts b/cocos/gfx/webgl/webgl-shader.ts index e5c06a61c3..89c9bca716 100644 --- a/cocos/gfx/webgl/webgl-shader.ts +++ b/cocos/gfx/webgl/webgl-shader.ts @@ -1,9 +1,9 @@ import { GFXStatus } from '../define'; import { GFXDevice } from '../device'; import { GFXShader, IGFXShaderInfo } from '../shader'; +import { WebGLCmdFuncCreateShader, WebGLCmdFuncDestroyShader } from './webgl-commands'; import { WebGLGFXDevice } from './webgl-device'; import { WebGLGPUShader, WebGLGPUShaderStage } from './webgl-gpu-objects'; -import { WebGLCmdFuncCreateShader, WebGLCmdFuncDestroyShader } from './webgl-commands'; export class WebGLGFXShader extends GFXShader { diff --git a/cocos/gfx/webgl/webgl-texture.ts b/cocos/gfx/webgl/webgl-texture.ts index 11e8d749be..b84c27a546 100644 --- a/cocos/gfx/webgl/webgl-texture.ts +++ b/cocos/gfx/webgl/webgl-texture.ts @@ -1,9 +1,9 @@ -import { GFXFormatSurfaceSize, GFXStatus, GFXTextureFlagBit, GFXTextureViewType, GFXTextureType } from '../define'; +import { GFXFormatSurfaceSize, GFXStatus, GFXTextureFlagBit, GFXTextureType, GFXTextureViewType } from '../define'; import { GFXDevice } from '../device'; import { GFXTexture, IGFXTextureInfo } from '../texture'; +import { WebGLCmdFuncCreateTexture, WebGLCmdFuncDestroyTexture } from './webgl-commands'; import { WebGLGFXDevice } from './webgl-device'; import { WebGLGPUTexture } from './webgl-gpu-objects'; -import { WebGLCmdFuncCreateTexture, WebGLCmdFuncDestroyTexture } from './webgl-commands'; export class WebGLGFXTexture extends GFXTexture {