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

Make sure render pass name is valid for derived classes #6039

Merged
merged 2 commits into from Feb 5, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/platform/graphics/render-pass.js
@@ -1,4 +1,4 @@
import { Debug, DebugHelper } from '../../core/debug.js';
import { Debug } from '../../core/debug.js';
import { Tracing } from '../../core/tracing.js';
import { Color } from '../../core/math/color.js';
import { TRACEID_RENDER_PASS, TRACEID_RENDER_PASS_DETAIL } from '../../core/constants.js';
Expand Down Expand Up @@ -91,7 +91,7 @@ class DepthStencilAttachmentOps {
*/
class RenderPass {
/** @type {string} */
name = '';
_name;

/**
* The graphics device.
Expand Down Expand Up @@ -193,11 +193,20 @@ class RenderPass {
* graphics device.
*/
constructor(graphicsDevice) {
DebugHelper.setName(this, this.constructor.name);
Debug.assert(graphicsDevice);
this.device = graphicsDevice;
}

set name(value) {
this._name = value;
}

get name() {
if (!this._name)
this._name = this.constructor.name;
return this._name;
}

set options(value) {
this._options = value;

Expand Down
3 changes: 2 additions & 1 deletion src/platform/graphics/uniform-buffer.js
Expand Up @@ -6,6 +6,7 @@ import {
UNIFORMTYPE_FLOATARRAY, UNIFORMTYPE_VEC2ARRAY, UNIFORMTYPE_VEC3ARRAY,
UNIFORMTYPE_MAT2, UNIFORMTYPE_MAT3, UNIFORMTYPE_UINT, UNIFORMTYPE_UVEC2, UNIFORMTYPE_UVEC3, UNIFORMTYPE_UVEC4, UNIFORMTYPE_INTARRAY, UNIFORMTYPE_UINTARRAY, UNIFORMTYPE_BOOLARRAY, UNIFORMTYPE_IVEC2ARRAY, UNIFORMTYPE_IVEC3ARRAY, UNIFORMTYPE_UVEC2ARRAY, UNIFORMTYPE_UVEC3ARRAY, UNIFORMTYPE_BVEC2ARRAY, UNIFORMTYPE_BVEC3ARRAY
} from './constants.js';
import { DebugGraphics } from './debug-graphics.js';
import { DynamicBufferAllocation } from './dynamic-buffers.js';

// Uniform buffer set functions - only implemented for types for which the default
Expand Down Expand Up @@ -319,7 +320,7 @@ class UniformBuffer {
}
} else {
Debug.warnOnce(`Value was not set when assigning to uniform [${uniformFormat.name}]` +
`, expected type ${uniformTypeToName[uniformFormat.type]}`);
`, expected type ${uniformTypeToName[uniformFormat.type]} while rendering ${DebugGraphics.toString()}`);
}
}

Expand Down