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

Stringify stencilFuncSeparate #212

Merged
merged 1 commit into from
Oct 28, 2021

Conversation

JannikGM
Copy link
Contributor

Barely tested; but binary display should help when working with stencil planes.
Before this PR, spector.js would even try to figure out WebGL names for the last 2 arguments, which would always be some meaningless enum constant.

protected stringifyArgs(args: IArguments): string[] {
const stringified = [];
stringified.push(WebGlConstants.stringifyWebGlConstant(args[0], "stencilFuncSeparate"));
stringified.push(WebGlConstants.stringifyWebGlConstant(args[1], "stencilFuncSeparate"));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I don't like how the command name is typed out here; it would probably be smarter to use the static commandName variable? However, explicitly writing it out is how it's done everywhere.

@@ -139,6 +140,7 @@ export class CommandSpy {
[GetShaderPrecisionFormat.commandName]: (options: IContextInformation) => new GetShaderPrecisionFormat(options),
[GetTransformFeedbackVarying.commandName]: (options: IContextInformation) => new GetTransformFeedbackVarying(options),
[Scissor.commandName]: (options: IContextInformation) => new Scissor(options),
[StencilFuncSeparate.commandName]: (options: IContextInformation) => new StencilFuncSeparate(options),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably make sense to also addstencilFunc support, but I only ran into this issue with stencilFuncSeparate and needed a fix asap.

Ideally some code could be factored out, or it could be part of the same file?

@sebavan
Copy link
Member

sebavan commented Oct 28, 2021

Thanks a lot @JannikGM !!!

@sebavan sebavan merged commit f4baa23 into BabylonJS:master Oct 28, 2021
@JannikGM JannikGM deleted the stencilFuncSeparate branch October 29, 2021 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants