mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
commit files
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user