Expose native constants to JavaScript - #416
Merged
syntheticmagus merged 11 commits intoSep 25, 2020
Merged
Conversation
…k like if exposed to JavaScript.
This was referenced Sep 23, 2020
bghgary
approved these changes
Sep 23, 2020
Comment on lines
+598
to
+608
| InstanceValue("SAMPLER_NEAREST", Napi::Number::From(env, BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIN_POINT)), // nearest is mag = nearest and min = nearest and mip = linear | ||
| InstanceValue("SAMPLER_BILINEAR", Napi::Number::From(env, BGFX_SAMPLER_MIP_POINT)), // Bilinear is mag = linear and min = linear and mip = nearest | ||
| InstanceValue("SAMPLER_TRILINEAR", Napi::Number::From(env, 0)), // Trilinear is mag = linear and min = linear and mip = linear | ||
| InstanceValue("SAMPLER_ANISOTROPIC", Napi::Number::From(env, BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIP_POINT)), // mag = nearest and min = nearest and mip = nearest | ||
| InstanceValue("SAMPLER_POINT_COMPARE", Napi::Number::From(env, BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIP_POINT)), // mag = nearest and min = linear and mip = nearest | ||
| InstanceValue("SAMPLER_TRILINEAR_COMPARE", Napi::Number::From(env, BGFX_SAMPLER_MAG_POINT)), // mag = nearest and min = linear and mip = linear | ||
| InstanceValue("SAMPLER_MINBILINEAR_MAGPOINT", Napi::Number::From(env, BGFX_SAMPLER_MAG_POINT)), // mag = nearest and min = linear and mip = none | ||
| InstanceValue("SAMPLER_MINPOINT_MAGPOINT_MIPLINEAR", Napi::Number::From(env, BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIN_POINT)), // mag = nearest and min = nearest and mip = none | ||
| InstanceValue("SAMPLER_MINPOINT_MAGLINEAR_MIPPOINT", Napi::Number::From(env, BGFX_SAMPLER_MIP_POINT | BGFX_SAMPLER_MIP_POINT)), // mag = linear and min = nearest and mip = nearest | ||
| InstanceValue("SAMPLER_MINPOINT_MAGLINEAR_MIPLINEAR", Napi::Number::From(env, BGFX_SAMPLER_MIN_POINT)), // mag = linear and min = nearest and mip = linear | ||
| InstanceValue("SAMPLER_MINLINEAR_MAGPOINT_MIPPOINT", Napi::Number::From(env, 0)), // mag = linear and min = linear and mip = none |
Contributor
There was a problem hiding this comment.
maybe separate this the same as AlphaMode? The comments can go with it.
syntheticmagus
marked this pull request as ready for review
September 25, 2020 00:01
syntheticmagus
commented
Sep 25, 2020
Minor consistency change, primarily poking the CI because it timed out.
CedricGuillemet
added a commit
to CedricGuillemet/BabylonNative
that referenced
this pull request
Sep 2, 2026
080f466590 Added bx::hasUniqueObjectRepresentation type trait. (BabylonJS#420) 671a001d3e tinystl: reset() keeps the bucket table; clear() still shrinks to 9. (BabylonJS#419) 9f874936e2 Added ability to move file into trash. (BabylonJS#418) 9e3fadf6f1 Fixed floatFlip, SIMD variable-shift masks and %g precision, and added tests. (BabylonJS#417) 26ff6d907d MinGW: Fix sal. (BabylonJS#416) 0a09590ac8 Added positional arguments to CommandLine. (BabylonJS#415) 822be40688 Scanner: Class::Identifier must not start with a digit. (BabylonJS#414) 43bfe29402 Fixed DLL search order hijacking in dlopen. (BabylonJS#413) 0b001f5f36 MSVC: Added ARM64 target. (BabylonJS#412) 056ea3486c Scanner: Cleanup. (BabylonJS#411) 9916e720fc Added scanner. (BabylonJS#410) cd6720ce9a platform.h: detect MSVC ARM64 as 64-bit and raise 32-bit Windows minimum (BabylonJS#409) 5a2b876258 fromString: Parse hex float literals. (BabylonJS#408) a7257985fa Added bx::isEqual for bx::StringView. (BabylonJS#407) c98e98cde1 Fixed amalgamated build. (BabylonJS#406) ed183eb246 Allow files with 10k+ lines to align nicely. (BabylonJS#405) git-subtree-dir: Dependencies/bx git-subtree-split: 080f466590c161664f2a3c5d21e05bd31cc9c8c8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes the way constant values are communicated between Babylon.js and Babylon Native. Rather than having separate enums/arrays on both sides, Native now pushes its constants up to JavaScript by name, after which JavaScript is able to hand down the actual values native should use.
This PR depends on the Babylon.js changes in BabylonJS/Babylon.js#9023, so it will remain a draft until that PR is complete.