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

Update Primitive and GroundPrimitive to use BatchTable #4361

Merged
merged 16 commits into from
Sep 27, 2016

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Sep 22, 2016

Updates Primitive and GroundPrimitive to use BatchTable instead of per-instance attributes.

This needs to be merged before #4309. It will fix the PolylineGeometryUpdater crashes in that branch.

var length = instances.length;

var attributesInAllInstances = [];
var attributes0 = instances[0].attributes;
Copy link
Contributor

Choose a reason for hiding this comment

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

length will always be >= 1?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see this is old code.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 24, 2016

I have 6 failures in master:


2.2.0finished in 62.849s
raise exceptions
7548 specs, 6 failures, 1 pending spec
Spec List | Failures
Core/VideoSynchronizer Syncs time when looping
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
    at http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1803:23
Core/VideoSynchronizer Syncs time when not looping
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
    at http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1803:23
Renderer/VertexArray renders with a one-component constant value
Expected [ 0, 0, 0, 0 ] to equal [ 255, 255, 255, 255 ].
Error: Expected [ 0, 0, 0, 0 ] to equal [ 255, 255, 255, 255 ].
    at stack (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1475:17)
    at buildExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1445:14)
    at Spec.expectationResultFactory (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:584:18)
    at Spec.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:332:34)
    at Expectation.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:528:21)
    at Expectation.toEqual (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1399:12)
    at http://localhost:8080/Specs/Renderer/VertexArraySpec.js:273:38
    at Object.<anonymous> (http://localhost:8080/Specs/spec-main.js:139:30)
    at attemptAsync (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1793:24)
    at QueueRunner.run (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1746:26)
Renderer/VertexArray renders with a three-component constant value
Expected [ 0, 0, 0, 0 ] to equal [ 255, 255, 255, 255 ].
Error: Expected [ 0, 0, 0, 0 ] to equal [ 255, 255, 255, 255 ].
    at stack (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1475:17)
    at buildExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1445:14)
    at Spec.expectationResultFactory (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:584:18)
    at Spec.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:332:34)
    at Expectation.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:528:21)
    at Expectation.toEqual (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1399:12)
    at http://localhost:8080/Specs/Renderer/VertexArraySpec.js:375:38
    at Object.<anonymous> (http://localhost:8080/Specs/spec-main.js:139:30)
    at attemptAsync (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1793:24)
    at QueueRunner.run (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1746:26)
Scene/BillboardCollection renders billboard with sizeInMeters
Expected [ 0, 251, 0, 255 ] to equal [ 0, 255, 0, 255 ].
Error: Expected [ 0, 251, 0, 255 ] to equal [ 0, 255, 0, 255 ].
    at stack (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1475:17)
    at buildExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1445:14)
    at Spec.expectationResultFactory (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:584:18)
    at Spec.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:332:34)
    at Expectation.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:528:21)
    at Expectation.toEqual (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1399:12)
    at http://localhost:8080/Specs/Scene/BillboardCollectionSpec.js:244:40
    at Object.<anonymous> (http://localhost:8080/Specs/spec-main.js:139:30)
    at attemptAsync (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1793:24)
    at QueueRunner.run (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1746:26)
Scene/PolylineCollection renders bounding volume with debugShowBoundingVolume
Expected [ 0, 0, 0, 255 ] not to equal [ 0, 0, 0, 255 ].
Error: Expected [ 0, 0, 0, 255 ] not to equal [ 0, 0, 0, 255 ].
    at stack (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1475:17)
    at buildExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1445:14)
    at Spec.expectationResultFactory (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:584:18)
    at Spec.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:332:34)
    at Expectation.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:528:21)
    at Expectation.toEqual (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1399:12)
    at http://localhost:8080/Specs/Scene/PolylineCollectionSpec.js:803:44
    at Object.<anonymous> (http://localhost:8080/Specs/spec-main.js:139:30)
    at attemptAsync (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1793:24)
    at QueueRunner.run (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1746:26)

And 10 failures in this branch:


2.2.0finished in 60.054s
raise exceptions
7547 specs, 10 failures, 1 pending spec
Spec List | Failures
Renderer/VertexArray renders with a one-component constant value
Expected [ 0, 0, 0, 0 ] to equal [ 255, 255, 255, 255 ].
Error: Expected [ 0, 0, 0, 0 ] to equal [ 255, 255, 255, 255 ].
    at stack (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1475:17)
    at buildExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1445:14)
    at Spec.expectationResultFactory (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:584:18)
    at Spec.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:332:34)
    at Expectation.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:528:21)
    at Expectation.toEqual (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1399:12)
    at http://localhost:8080/Specs/Renderer/VertexArraySpec.js:273:38
    at Object.<anonymous> (http://localhost:8080/Specs/spec-main.js:139:30)
    at attemptAsync (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1793:24)
    at QueueRunner.run (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1746:26)
Renderer/VertexArray renders with a three-component constant value
Expected [ 0, 0, 0, 0 ] to equal [ 255, 255, 255, 255 ].
Error: Expected [ 0, 0, 0, 0 ] to equal [ 255, 255, 255, 255 ].
    at stack (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1475:17)
    at buildExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1445:14)
    at Spec.expectationResultFactory (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:584:18)
    at Spec.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:332:34)
    at Expectation.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:528:21)
    at Expectation.toEqual (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1399:12)
    at http://localhost:8080/Specs/Renderer/VertexArraySpec.js:375:38
    at Object.<anonymous> (http://localhost:8080/Specs/spec-main.js:139:30)
    at attemptAsync (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1793:24)
    at QueueRunner.run (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1746:26)
Scene/BillboardCollection renders billboard with sizeInMeters
Expected [ 0, 251, 0, 255 ] to equal [ 0, 255, 0, 255 ].
Error: Expected [ 0, 251, 0, 255 ] to equal [ 0, 255, 0, 255 ].
    at stack (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1475:17)
    at buildExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1445:14)
    at Spec.expectationResultFactory (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:584:18)
    at Spec.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:332:34)
    at Expectation.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:528:21)
    at Expectation.toEqual (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1399:12)
    at http://localhost:8080/Specs/Scene/BillboardCollectionSpec.js:244:40
    at Object.<anonymous> (http://localhost:8080/Specs/spec-main.js:139:30)
    at attemptAsync (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1793:24)
    at QueueRunner.run (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1746:26)
Scene/DebugCameraPrimitive updates when underlying camera changes
Expected undefined not to be undefined.
Error: Expected undefined not to be undefined.
    at stack (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1475:17)
    at buildExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1445:14)
    at Spec.expectationResultFactory (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:584:18)
    at Spec.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:332:34)
    at Expectation.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:528:21)
    at Expectation.toBe (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1399:12)
    at http://localhost:8080/Specs/Scene/DebugCameraPrimitiveSpec.js:91:34
    at Object.<anonymous> (http://localhost:8080/Specs/spec-main.js:139:30)
    at attemptAsync (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1793:24)
    at QueueRunner.run (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1746:26)
Scene/PointAppearance renders
DeveloperError: Width must be greater than zero.
Error
    at new DeveloperError (http://localhost:8080/Source/Core/DeveloperError.js:44:19)
    at new Texture (http://localhost:8080/Source/Renderer/Texture.js:83:19)
    at createTexture (http://localhost:8080/Source/Scene/BatchTable.js:258:31)
    at BatchTable.update (http://localhost:8080/Source/Scene/BatchTable.js:300:13)
    at Primitive.update (http://localhost:8080/Source/Scene/Primitive.js:1473:26)
    at PrimitiveCollection.update (http://localhost:8080/Source/Scene/PrimitiveCollection.js:366:27)
    at updatePrimitives (http://localhost:8080/Source/Scene/Scene.js:2185:27)
    at executeCommandsInViewport (http://localhost:8080/Source/Scene/Scene.js:2101:9)
    at updateAndExecuteCommands (http://localhost:8080/Source/Scene/Scene.js:1969:17)
    at render (http://localhost:8080/Source/Scene/Scene.js:2393:9)
Scene/PointAppearance renders with translucency
DeveloperError: Width must be greater than zero.
Error
    at new DeveloperError (http://localhost:8080/Source/Core/DeveloperError.js:44:19)
    at new Texture (http://localhost:8080/Source/Renderer/Texture.js:83:19)
    at createTexture (http://localhost:8080/Source/Scene/BatchTable.js:258:31)
    at BatchTable.update (http://localhost:8080/Source/Scene/BatchTable.js:300:13)
    at Primitive.update (http://localhost:8080/Source/Scene/Primitive.js:1473:26)
    at PrimitiveCollection.update (http://localhost:8080/Source/Scene/PrimitiveCollection.js:366:27)
    at updatePrimitives (http://localhost:8080/Source/Scene/Scene.js:2185:27)
    at executeCommandsInViewport (http://localhost:8080/Source/Scene/Scene.js:2101:9)
    at updateAndExecuteCommands (http://localhost:8080/Source/Scene/Scene.js:1969:17)
    at render (http://localhost:8080/Source/Scene/Scene.js:2393:9)
Scene/PointAppearance renders relative to center
DeveloperError: Width must be greater than zero.
Error
    at new DeveloperError (http://localhost:8080/Source/Core/DeveloperError.js:44:19)
    at new Texture (http://localhost:8080/Source/Renderer/Texture.js:83:19)
    at createTexture (http://localhost:8080/Source/Scene/BatchTable.js:258:31)
    at BatchTable.update (http://localhost:8080/Source/Scene/BatchTable.js:300:13)
    at Primitive.update (http://localhost:8080/Source/Scene/Primitive.js:1473:26)
    at PrimitiveCollection.update (http://localhost:8080/Source/Scene/PrimitiveCollection.js:366:27)
    at updatePrimitives (http://localhost:8080/Source/Scene/Scene.js:2185:27)
    at executeCommandsInViewport (http://localhost:8080/Source/Scene/Scene.js:2101:9)
    at updateAndExecuteCommands (http://localhost:8080/Source/Scene/Scene.js:1969:17)
    at render (http://localhost:8080/Source/Scene/Scene.js:2393:9)
Scene/PolylineCollection renders bounding volume with debugShowBoundingVolume
Expected [ 0, 0, 0, 255 ] not to equal [ 0, 0, 0, 255 ].
Error: Expected [ 0, 0, 0, 255 ] not to equal [ 0, 0, 0, 255 ].
    at stack (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1475:17)
    at buildExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1445:14)
    at Spec.expectationResultFactory (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:584:18)
    at Spec.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:332:34)
    at Expectation.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:528:21)
    at Expectation.toEqual (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1399:12)
    at http://localhost:8080/Specs/Scene/PolylineCollectionSpec.js:803:44
    at Object.<anonymous> (http://localhost:8080/Specs/spec-main.js:139:30)
    at attemptAsync (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1793:24)
    at QueueRunner.run (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1746:26)
Scene/ShadowMap enable debugShow for cascaded shadow map
Expected 13 to be 7.
Error: Expected 13 to be 7.
    at stack (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1475:17)
    at buildExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1445:14)
    at Spec.expectationResultFactory (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:584:18)
    at Spec.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:332:34)
    at Expectation.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:528:21)
    at Expectation.toBe (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1399:12)
    at http://localhost:8080/Specs/Scene/ShadowMapSpec.js:868:53
    at Object.<anonymous> (http://localhost:8080/Specs/spec-main.js:139:30)
    at attemptAsync (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1793:24)
    at QueueRunner.run (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1746:26)
Scene/ShadowMap enable debugShow for fixed shadow map
Expected 3 to be 2.
Error: Expected 3 to be 2.
    at stack (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1475:17)
    at buildExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1445:14)
    at Spec.expectationResultFactory (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:584:18)
    at Spec.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:332:34)
    at Expectation.addExpectationResult (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:528:21)
    at Expectation.toBe (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1399:12)
    at http://localhost:8080/Specs/Scene/ShadowMapSpec.js:881:53
    at Object.<anonymous> (http://localhost:8080/Specs/spec-main.js:139:30)
    at attemptAsync (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1793:24)
    at QueueRunner.run (http://localhost:8080/ThirdParty/jasmine-2.2.0/jasmine.js:1746:26)

@bagnell
Copy link
Contributor Author

bagnell commented Sep 26, 2016

@pjcozzi This is ready for another look.

@@ -59,6 +59,9 @@ define([

if (toWorld) {
for (i = 0; i < length; ++i) {
if (!defined(instances[i].geometry)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor, but why use continue here? Why not, just if (defined(... or even put the check in transformToWorldCoordinates since the semantics would still be fine just like remove(undefined) is OK with our collections.

@@ -214,18 +136,14 @@ define([
// Clip to IDL
if (!scene3DOnly) {
for (i = 0; i < length; ++i) {
if (!defined(instances[i].geometry)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment.


var i = 1;
while (i < buffer.length) {
if(buffer[i++] === 1.0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Whitespace

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 26, 2016

Just a few trivial comments.

All tests pass.

Are you sure coverage for the new/moved code is solid?

@bagnell
Copy link
Contributor Author

bagnell commented Sep 26, 2016

@pjcozzi This is ready for another look.

Are you sure coverage for the new/moved code is solid?

Yes. After this change I had to go through most of the tests because they were failing. I also ran through all of the Sandcastle examples.

Now that VTF is required, should we throw a RuntimeError on Context creation?

There shouldn't be any problems with the current built-in per-instance attributes since they are all unsigned bytes, but if a user creates a custom appearance and needs floating point per-instance attribute a RuntimeError will be thrown.

@bagnell bagnell mentioned this pull request Sep 26, 2016
7 tasks
@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 26, 2016

Now that VTF is required, should we throw a RuntimeError on Context creation?

Not in Context, but where this is used if we don't already since you could, for example, still create a globe without VTF, right?

@bagnell
Copy link
Contributor Author

bagnell commented Sep 26, 2016

@pjcozzi I added the exceptions. This is ready for another look.

@pjcozzi pjcozzi merged commit 18ebb49 into master Sep 27, 2016
@pjcozzi pjcozzi deleted the batch-table-primitive branch September 27, 2016 12:18
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.

2 participants