Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: puppeteer #1296

Merged
merged 7 commits into from
Nov 25, 2023
Merged
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
28 changes: 14 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ on: [push]

jobs:
build:

runs-on: ubuntu-22.04
runs-on: self-hosted

steps:
- uses: actions/checkout@v2
- run: git submodule update -i
- uses: richard-chim/[email protected]
with:
cmd: install
- run: npm run build
- uses: actions/upload-artifact@v2
with:
name: Rhodonite-distribution-files
path: dist
- run: npm run build-samples
- run: npm run test
- uses: actions/checkout@v2
- run: git submodule update -i
# - uses: richard-chim/[email protected]
# with:
# cmd: install
- run: yarn install
- run: npm run build
# - uses: actions/upload-artifact@v2
# with:
# name: Rhodonite-distribution-files
# path: dist
- run: npm run build-samples
- run: npm run test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,5 @@ samples/**/types.js*
*.tsbuildinfo
.dccache
.envrc
actions-runner

3 changes: 1 addition & 2 deletions config/test/jest-puppeteer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
launchTimeout: 10000, // Wait 5 secs max before timing out
},
launch: {
headless: true,
headless: 'new',
devtools: false,
// dumpio: true,
// executablePath: "/Applications/Chromium.app/Contents/MacOS/Chromium", // Try this if you got error in Mac
Expand All @@ -18,7 +18,6 @@ module.exports = {
args: [
'--start-maximized',
'--no-sandbox',
'--disable-gpu',
'--disable-audio-output',
],
},
Expand Down
4 changes: 3 additions & 1 deletion dist/cjs/foundation/components/Light/LightComponent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { IEntity } from '../../core/Entity';
* The Component that represents a light.
*
* @remarks
* the light looks towards the local -Z axis,
* the light looks towards the local -Z axis in right hand coordinate system.
*/
export declare class LightComponent extends Component {
type: import("../..").EnumIO;
Expand All @@ -28,6 +28,7 @@ export declare class LightComponent extends Component {
private static __lightDirections;
private static __lightIntensities;
private static __lightProperties;
private static __lightNumber;
private __lightGizmo?;
constructor(entityUid: EntityUID, componentSid: ComponentSID, entityRepository: EntityRepository, isReUse: boolean);
static get componentTID(): ComponentTID;
Expand All @@ -41,6 +42,7 @@ export declare class LightComponent extends Component {
$create(): void;
$load(): void;
private __updateGizmo;
static common_$logic(): void;
$logic(): void;
_destroy(): void;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export declare class MeshRendererComponent extends Component {
static isViewFrustumCullingEnabled: boolean;
static isDepthMaskTrueForTransparencies: boolean;
static __shaderProgramHandleOfPrimitiveObjectUids: Map<ObjectUID, CGAPIResourceHandle>;
_updateCount: number;
constructor(entityUid: EntityUID, componentSid: ComponentSID, entityRepository: EntityRepository, isReUse: boolean);
static get componentTID(): ComponentTID;
get componentTID(): ComponentTID;
Expand Down
1 change: 1 addition & 0 deletions dist/cjs/foundation/core/Config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export declare const Config: {
maxEntityNumber: number;
maxLightNumberInShader: number;
maxVertexMorphNumberInShader: number;
maxVertexPrimitiveNumberInShader: number;
maxMaterialInstanceForEachType: number;
boneDataType: import("../misc").EnumIO;
maxSkeletonNumber: number;
Expand Down
4 changes: 4 additions & 0 deletions dist/cjs/foundation/definitions/ComponentType.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { EnumIO } from '../misc/EnumIO';
import { TypedArray, TypedArrayConstructor } from '../../types/CommonTypes';
import { Gltf2AccessorComponentTypeNumber } from '../../types/glTF2';
export interface ComponentTypeEnum extends EnumIO {
wgsl: string;
webgpu: string;
getSizeInBytes(): number;
isFloatingPoint(): boolean;
isInteger(): boolean;
Expand All @@ -17,6 +19,7 @@ declare function from(index: number): ComponentTypeEnum;
declare function fromString(str: string): ComponentTypeEnum;
declare function fromTypedArray(typedArray: TypedArray): ComponentTypeEnum;
declare function toTypedArray(componentType: ComponentTypeEnum): TypedArrayConstructor | undefined;
declare function fromWgslString(str_: string): ComponentTypeEnum;
declare function fromGlslString(str_: string): ComponentTypeEnum;
export declare type Gltf2AccessorComponentType = typeof Byte | typeof UnsignedByte | typeof Short | typeof UnsignedShort | typeof Int | typeof UnsignedInt | typeof Float;
declare function toGltf2AccessorComponentType(componentTypeForGltf2: Gltf2AccessorComponentType): Gltf2AccessorComponentTypeNumber;
Expand All @@ -38,5 +41,6 @@ export declare const ComponentType: Readonly<{
toGltf2AccessorComponentType: typeof toGltf2AccessorComponentType;
fromString: typeof fromString;
fromGlslString: typeof fromGlslString;
fromWgslString: typeof fromWgslString;
}>;
export {};
5 changes: 5 additions & 0 deletions dist/cjs/foundation/definitions/CompositionType.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import { Count, IndexOf16Bytes, SquareMatrixComponentN, VectorAndSquareMatrixCom
import type { ComponentTypeEnum } from './ComponentType';
import { Gltf2AccessorCompositionTypeString } from '../../types/glTF2';
export interface CompositionTypeEnum extends EnumIO {
webgpu: string;
wgsl: string;
getNumberOfComponents(): Count;
getGlslStr(componentType: ComponentTypeEnum): string;
getGlslInitialValue(componentType: ComponentTypeEnum): string;
toWGSLType(componentType: ComponentTypeEnum): string;
getVec4SizeOfProperty(): IndexOf16Bytes;
}
declare const Scalar: CompositionTypeEnum;
Expand All @@ -20,6 +23,7 @@ declare function from(index: number): CompositionTypeEnum;
declare function fromString(str: string): CompositionTypeEnum;
declare function vectorFrom(componentN: number): CompositionTypeEnum;
declare function fromGlslString(str_: string): CompositionTypeEnum;
declare function fromWgslString(str_: string): CompositionTypeEnum;
declare function toGltf2AccessorCompositionTypeString(componentN: VectorAndSquareMatrixComponentN): Gltf2AccessorCompositionTypeString;
declare function toGltf2AnimationAccessorCompositionTypeString(componentN: VectorComponentN): Gltf2AccessorCompositionTypeString;
declare function toGltf2SquareMatrixAccessorCompositionTypeString(componentN: SquareMatrixComponentN): Gltf2AccessorCompositionTypeString;
Expand Down Expand Up @@ -53,6 +57,7 @@ export declare const CompositionType: Readonly<{
fromString: typeof fromString;
vectorFrom: typeof vectorFrom;
fromGlslString: typeof fromGlslString;
fromWgslString: typeof fromWgslString;
isArray: typeof isArray;
isTexture: typeof isTexture;
toGltf2AnimationAccessorCompositionType: typeof toGltf2AnimationAccessorCompositionType;
Expand Down
20 changes: 11 additions & 9 deletions dist/cjs/foundation/definitions/PrimitiveMode.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { EnumIO } from '../misc/EnumIO';
export declare type PrimitiveModeEnum = EnumIO;
export interface PrimitiveModeEnum extends EnumIO {
getWebGPUTypeStr(): string;
}
declare function from(index: number): PrimitiveModeEnum | undefined;
export declare const PrimitiveMode: Readonly<{
Unknown: EnumIO;
Points: EnumIO;
Lines: EnumIO;
LineLoop: EnumIO;
LineStrip: EnumIO;
Triangles: EnumIO;
TriangleStrip: EnumIO;
TriangleFan: EnumIO;
Unknown: PrimitiveModeEnum;
Points: PrimitiveModeEnum;
Lines: PrimitiveModeEnum;
LineLoop: PrimitiveModeEnum;
LineStrip: PrimitiveModeEnum;
Triangles: PrimitiveModeEnum;
TriangleStrip: PrimitiveModeEnum;
TriangleFan: PrimitiveModeEnum;
from: typeof from;
}>;
export {};
68 changes: 35 additions & 33 deletions dist/cjs/foundation/definitions/TextureParameter.d.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
import { EnumIO } from '../misc/EnumIO';
export declare type TextureParameterEnum = EnumIO;
export interface TextureParameterEnum extends EnumIO {
webgpu: string;
}
declare function from(index: number): TextureParameterEnum;
declare function migrateToWebGL1InternalFormat(tp: TextureParameterEnum): TextureParameterEnum;
export declare const TextureParameter: Readonly<{
Nearest: EnumIO;
Linear: EnumIO;
NearestMipmapNearest: EnumIO;
LinearMipmapNearest: EnumIO;
NearestMipmapLinear: EnumIO;
LinearMipmapLinear: EnumIO;
TextureMagFilter: EnumIO;
TextureMinFilter: EnumIO;
TextureWrapS: EnumIO;
TextureWrapT: EnumIO;
Texture2D: EnumIO;
Texture: EnumIO;
Texture0: EnumIO;
Texture1: EnumIO;
ActiveTexture: EnumIO;
Repeat: EnumIO;
ClampToEdge: EnumIO;
MirroredRepeat: EnumIO;
RGB8: EnumIO;
RGBA8: EnumIO;
RGB10_A2: EnumIO;
RG16F: EnumIO;
RG32F: EnumIO;
RGB16F: EnumIO;
RGB32F: EnumIO;
RGBA16F: EnumIO;
RGBA32F: EnumIO;
Depth16: EnumIO;
Depth24: EnumIO;
Depth32F: EnumIO;
Depth24Stencil8: EnumIO;
Depth32FStencil8: EnumIO;
Nearest: TextureParameterEnum;
Linear: TextureParameterEnum;
NearestMipmapNearest: TextureParameterEnum;
LinearMipmapNearest: TextureParameterEnum;
NearestMipmapLinear: TextureParameterEnum;
LinearMipmapLinear: TextureParameterEnum;
TextureMagFilter: TextureParameterEnum;
TextureMinFilter: TextureParameterEnum;
TextureWrapS: TextureParameterEnum;
TextureWrapT: TextureParameterEnum;
Texture2D: TextureParameterEnum;
Texture: TextureParameterEnum;
Texture0: TextureParameterEnum;
Texture1: TextureParameterEnum;
ActiveTexture: TextureParameterEnum;
Repeat: TextureParameterEnum;
ClampToEdge: TextureParameterEnum;
MirroredRepeat: TextureParameterEnum;
RGB8: TextureParameterEnum;
RGBA8: TextureParameterEnum;
RGB10_A2: TextureParameterEnum;
RG16F: TextureParameterEnum;
RG32F: TextureParameterEnum;
RGB16F: TextureParameterEnum;
RGB32F: TextureParameterEnum;
RGBA16F: TextureParameterEnum;
RGBA32F: TextureParameterEnum;
Depth16: TextureParameterEnum;
Depth24: TextureParameterEnum;
Depth32F: TextureParameterEnum;
Depth24Stencil8: TextureParameterEnum;
Depth32FStencil8: TextureParameterEnum;
from: typeof from;
migrateToWebGL1InternalFormat: typeof migrateToWebGL1InternalFormat;
}>;
Expand Down
3 changes: 1 addition & 2 deletions dist/cjs/foundation/geometry/ComplexVertexAttribute.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { VertexAttributeEnum } from '../definitions/VertexAttribute';
import { PrimitiveModeEnum } from '../definitions/PrimitiveMode';
import { Attributes } from './Primitive';
import { IndicesAccessOption } from '../memory/Accessor';
import { Index } from '../../types/CommonTypes';
Expand All @@ -10,7 +9,7 @@ export declare class ComplexVertexAttribute implements ISemanticVertexAttribute
private __components;
private __offsets;
constructor(semanticAttribute: VertexAttributeEnum, attributes: Attributes);
get semantic(): PrimitiveModeEnum;
get semantic(): VertexAttributeEnum;
getScalarAsArray(i: Index, option: IndicesAccessOption): Array1<number>;
getVec2AsArray(i: Index, option: IndicesAccessOption): Array2<number>;
getVec3AsArray(i: Index, option: IndicesAccessOption): Array3<number>;
Expand Down
4 changes: 2 additions & 2 deletions dist/cjs/foundation/geometry/ISemanticVertexAttribute.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PrimitiveModeEnum } from '../../foundation/definitions/PrimitiveMode';
import { Array1, Array2, Array3, Array4, Index } from '../../types/CommonTypes';
import { VertexAttributeEnum } from '../definitions';
import { IndicesAccessOption } from '../memory/Accessor';
export interface ISemanticVertexAttribute {
semantic: PrimitiveModeEnum;
semantic: VertexAttributeEnum;
getScalarAsArray: (i: Index, option: IndicesAccessOption) => Array1<number>;
getVec2AsArray: (i: Index, option: IndicesAccessOption) => Array2<number>;
getVec3AsArray: (i: Index, option: IndicesAccessOption) => Array3<number>;
Expand Down
11 changes: 8 additions & 3 deletions dist/cjs/foundation/geometry/Primitive.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CompositionTypeEnum } from '../definitions/CompositionType';
import { AABB } from '../math/AABB';
import { Material } from '../materials/core/Material';
import { VertexHandles } from '../../webgl/WebGLResourceRepository';
import { PrimitiveUID, TypedArray, Count } from '../../types/CommonTypes';
import { PrimitiveUID, TypedArray, Count, Index } from '../../types/CommonTypes';
import { IVector3 } from '../math/IVector';
import { IMesh, PrimitiveSortKey, PrimitiveSortKeyOffset, RaycastResultEx1 } from './types/GeometryTypes';
export declare type Attributes = Map<VertexAttributeSemanticsJoinedString, Accessor>;
Expand All @@ -31,7 +31,6 @@ export declare class Primitive extends RnObject {
private __oIndices;
private static __primitiveCount;
private __primitiveUid;
private static __headerAccessor?;
private __aabb;
private __targets;
private __vertexHandles?;
Expand All @@ -41,8 +40,15 @@ export declare class Primitive extends RnObject {
_sortkey: PrimitiveSortKey;
_viewDepth: number;
private __cachePositionAccessor?;
private static __primitiveUidIdxHasMorph;
private static __idxPrimitiveUidHasMorph;
private static __primitiveCountHasMorph;
private static __tmpVec3_0;
constructor();
static getPrimitiveIdxHasMorph(primitiveUid: PrimitiveUID): number | undefined;
static getPrimitiveHasMorph(primitiveIdx: Index): Primitive | undefined;
getIndexBitSize(): 'uint16' | 'uint32';
get _vertexHandles(): VertexHandles | undefined;
setMaterialVariant(variantName: string, material: Material): void;
applyMaterialVariant(variantName: string): void;
getVariantNames(): string[];
Expand All @@ -61,7 +67,6 @@ export declare class Primitive extends RnObject {
static getPrimitive(primitiveUid: PrimitiveUID): Primitive;
setData(attributes: Attributes, mode: PrimitiveModeEnum, material?: Material, indicesAccessor?: Accessor): void;
static get maxPrimitiveCount(): number;
static get headerAccessor(): Accessor | undefined;
copyVertexData({ attributes, attributeSemantics, primitiveMode, indices, material, }: PrimitiveDescriptor): void;
static createPrimitive(desc: PrimitiveDescriptor): Primitive;
get indicesAccessor(): Accessor | undefined;
Expand Down
3 changes: 1 addition & 2 deletions dist/cjs/foundation/geometry/SimpleVertexAttribute.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { VertexAttributeEnum } from '../definitions/VertexAttribute';
import { PrimitiveModeEnum } from '../definitions/PrimitiveMode';
import { Accessor } from '../memory/Accessor';
import { Array1, Array2, Array3, Array4, Index } from '../../types/CommonTypes';
import { IndicesAccessOption } from '../memory/Accessor';
Expand All @@ -8,7 +7,7 @@ export declare class SimpleVertexAttribute implements ISemanticVertexAttribute {
private __semantic;
private __accessor;
constructor(semanticAttribute: VertexAttributeEnum, accessor: Accessor);
get semantic(): PrimitiveModeEnum;
get semantic(): VertexAttributeEnum;
getScalarAsArray(i: Index, option: IndicesAccessOption): Array1<number>;
getVec2AsArray(i: Index, option: IndicesAccessOption): Array2<number>;
getVec3AsArray(i: Index, option: IndicesAccessOption): Array3<number>;
Expand Down
4 changes: 2 additions & 2 deletions dist/cjs/foundation/helpers/RenderableHelper.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FrameBuffer } from '../renderer/FrameBuffer';
declare function createTexturesForRenderTarget(width: number, height: number, textureNum: number, { level, internalFormat, format, type, createDepthBuffer, isMSAA, sampleCountMSAA, }: {
level?: number | undefined;
internalFormat?: import("..").EnumIO | undefined;
internalFormat?: import("../definitions/TextureParameter").TextureParameterEnum | undefined;
format?: import("..").EnumIO | undefined;
type?: import("../definitions/ComponentType").ComponentTypeEnum | undefined;
createDepthBuffer?: boolean | undefined;
Expand All @@ -10,7 +10,7 @@ declare function createTexturesForRenderTarget(width: number, height: number, te
}): FrameBuffer;
declare function createDepthBuffer(width: number, height: number, { level, internalFormat, format, type, }: {
level?: number | undefined;
internalFormat?: import("..").EnumIO | undefined;
internalFormat?: import("../definitions/TextureParameter").TextureParameterEnum | undefined;
format?: import("..").EnumIO | undefined;
type?: import("../definitions/ComponentType").ComponentTypeEnum | undefined;
}): FrameBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { RenderingArg } from '../../../webgl/types/CommonTypes';
export declare class ColorGradingUsingLUTsMaterialContent extends AbstractMaterialContent {
static lookupTableTexture: ShaderSemanticsClass;
constructor(targetRenderPass: RenderPass, colorAttachmentsNumber: Count, uri?: string, texture?: AbstractTexture);
_setCustomSettingParametersToGpu({ material, shaderProgram, firstTime, args, }: {
_setCustomSettingParametersToGpuWebGL({ material, shaderProgram, firstTime, args, }: {
material: Material;
shaderProgram: WebGLProgram;
firstTime: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { RenderingArg } from '../../../webgl/types/CommonTypes';
import { ShaderSemanticsInfo } from '../../definitions/ShaderSemanticsInfo';
export declare class CustomMaterialContent extends AbstractMaterialContent {
private static __globalDataRepository;
constructor({ name, isMorphing, isSkinning, isLighting, isClearCoat, isTransmission, isVolume, isSheen, isSpecular, isIridescence, isAnisotropy, isShadow, useTangentAttribute, useNormalTexture, vertexShader, pixelShader, noUseCameraTransform, additionalShaderSemanticInfo, }: {
constructor({ name, isMorphing, isSkinning, isLighting, isClearCoat, isTransmission, isVolume, isSheen, isSpecular, isIridescence, isAnisotropy, isShadow, useTangentAttribute, useNormalTexture, vertexShader, pixelShader, noUseCameraTransform, additionalShaderSemanticInfo, vertexShaderWebGpu, pixelShaderWebGpu, }: {
name: string;
isMorphing: boolean;
isSkinning: boolean;
Expand All @@ -24,8 +24,10 @@ export declare class CustomMaterialContent extends AbstractMaterialContent {
pixelShader: ShaderityObject;
noUseCameraTransform: boolean;
additionalShaderSemanticInfo: ShaderSemanticsInfo[];
vertexShaderWebGpu?: ShaderityObject;
pixelShaderWebGpu?: ShaderityObject;
});
_setCustomSettingParametersToGpu({ material, shaderProgram, firstTime, args, }: {
_setCustomSettingParametersToGpuWebGL({ material, shaderProgram, firstTime, args, }: {
material: Material;
shaderProgram: WebGLProgram;
firstTime: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export declare class DepthEncodeMaterialContent extends AbstractMaterialContent
constructor(depthPow: number, { isSkinning }: {
isSkinning: boolean;
});
_setCustomSettingParametersToGpu({ material, shaderProgram, firstTime, args, }: {
_setCustomSettingParametersToGpuWebGL({ material, shaderProgram, firstTime, args, }: {
material: Material;
shaderProgram: WebGLProgram;
firstTime: boolean;
Expand Down
Loading
Loading