Ok.
I’m trying to narrow down the render script just to understand the flow of it.
For some reason I have this weird crash if I try to draw any predicate with a meshes before drawing the tile-predicate.
Why is that happening?
For simplicity sake I’ve removed most other stuff in the script so the render is ugly, doesn’t use any depth-buffer for the model etc but:
THIS WORKS (shows both sprites and non depth checked models)
function update(self)
render.set_depth_mask(true)
render.clear({[render.BUFFER_COLOR_BIT] = self.clear_color, [render.BUFFER_DEPTH_BIT] = 1, [render.BUFFER_STENCIL_BIT] = 0})
render.set_viewport(0, 0, render.get_window_width(), render.get_window_height())
render.set_view(self.view)
render.set_projection(vmath.matrix4_orthographic(
-p.render_w * p.cam.scale + p.cam.pos.x,
p.render_w * p.cam.scale + p.cam.pos.x,
-p.render_h * p.cam.scale + p.cam.pos.y,
p.render_h * p.cam.scale + p.cam.pos.y,
-10000, 10000))
render.draw(self.tile_pred)
render.draw(self.model_pred)
end
THIS FOR SOME REASON CRASHES THE ENGINE: ( draw model_pred before tile_pred )
function update(self)
render.set_depth_mask(true)
render.clear({[render.BUFFER_COLOR_BIT] = self.clear_color, [render.BUFFER_DEPTH_BIT] = 1, [render.BUFFER_STENCIL_BIT] = 0})
render.set_viewport(0, 0, render.get_window_width(), render.get_window_height())
render.set_view(self.view)
render.set_projection(vmath.matrix4_orthographic(
-p.render_w * p.cam.scale + p.cam.pos.x,
p.render_w * p.cam.scale + p.cam.pos.x,
-p.render_h * p.cam.scale + p.cam.pos.y,
p.render_h * p.cam.scale + p.cam.pos.y,
-10000, 10000))
render.draw(self.model_pred)
render.draw(self.tile_pred)
end
EDIT: Crash log:
Process: dmengine [53951]
Path: /Users/USER/Library/Application Support/Defold/*/dmengine
Identifier: dmengine
Version: ???
Code Type: X86-64 (Native)
Parent Process: java [53053]
Responsible: dmengine [53951]
User ID: 501
Date/Time: 2017-06-21 18:40:09.133 +0200
OS Version: Mac OS X 10.11.6 (15G1217)
Report Version: 11
Anonymous UUID: 493EDFAA-3219-B705-4E83-B52B22267877
Sleep/Wake UUID: B4ED0A2A-6431-4BEA-9071-B79489952F43
Time Awake Since Boot: 280000 seconds
Time Since Wake: 5000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
Assertion failed: (i < Size()), function operator[], file /Users/builder/ci/builds/engine-darwin-64-dev/build/tmp/dynamo_home/sdk/include/dmsdk/dlib/array.h, line 417.
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff8b0faf06 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff8ffc84ec pthread_kill + 90
2 libsystem_c.dylib 0x00007fff99cc76df abort + 129
3 libsystem_c.dylib 0x00007fff99c8edd8 __assert_rtn + 321
4 dmengine 0x0000000106fc01a5 dmRig::GenerateVertexData(dmRig::RigContext*, dmRig::RigInstance*, Vectormath::Aos::Matrix4 const&, Vectormath::Aos::Matrix4 const&, Vectormath::Aos::Vector4, bool, dmRig::RigVertexFormat, void*) + 11509
5 dmengine 0x0000000106eb3f73 dmGameSystem::RenderListDispatch(dmRender::RenderListDispatchParams const&) + 2227
6 dmengine 0x0000000106f6782a dmRender::DrawRenderList(dmRender::RenderContext*, dmRender::Predicate*, dmRender::NamedConstantBuffer*) + 1546
7 dmengine 0x0000000106f68f49 dmRender::ParseCommands(dmRender::RenderContext*, dmRender::Command*, unsigned int) + 649
8 dmengine 0x0000000106f6d844 dmRender::UpdateRenderScriptInstance(dmRender::RenderScriptInstance*) + 196
9 dmengine 0x0000000106e77b66 dmEngine::Step(dmEngine::Engine*) + 1318
10 dmengine 0x0000000106ed1606 dmGraphics::RunApplicationLoop(void*, void ()(void), int ()(void)) + 38
11 dmengine 0x0000000106e786e3 dmEngine::InitRun(dmEngineService::EngineService*, int, char**, void ()(dmEngine::Engine, void*), void ()(dmEngine::Engine, void*), void*) + 179
12 dmengine 0x0000000106e78567 dmEngine::Launch(int, char**, void ()(dmEngine::Engine, void*), void ()(dmEngine::Engine, void*), void*) + 119
13 dmengine 0x0000000106e78816 engine_main(int, char**) + 118
14 dmengine 0x0000000106e74ea4 start + 52
Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff8b0fbefa kevent_qos + 10
1 libdispatch.dylib 0x00007fff939c0165 _dispatch_mgr_invoke + 216
2 libdispatch.dylib 0x00007fff939bfdcd _dispatch_mgr_thread + 52
Thread 2:
0 libsystem_kernel.dylib 0x00007fff8b0fb5e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ffc5578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff8ffc3341 start_wqthread + 13
Thread 3:
0 libsystem_kernel.dylib 0x00007fff8b0fb5e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ffc5578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff8ffc3341 start_wqthread + 13
Thread 4:
0 libsystem_kernel.dylib 0x00007fff8b0fb5e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ffc5578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff8ffc3341 start_wqthread + 13
Thread 5:: log
0 libsystem_kernel.dylib 0x00007fff8b0fb10a __semwait_signal + 10
1 libsystem_c.dylib 0x00007fff99ce8d0f nanosleep + 199
2 libsystem_c.dylib 0x00007fff99ce8c02 usleep + 54
3 dmengine 0x0000000106ff39fa dmLogThread(void*) + 298
4 dmengine 0x00000001070047bc dmThread::ThreadStartProxy(void*) + 28
5 libsystem_pthread.dylib 0x00007fff8ffc599d _pthread_body + 131
6 libsystem_pthread.dylib 0x00007fff8ffc591a _pthread_start + 168
7 libsystem_pthread.dylib 0x00007fff8ffc3351 thread_start + 13
Thread 6:
0 libsystem_kernel.dylib 0x00007fff8b0fb5e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ffc5578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff8ffc3341 start_wqthread + 13
Thread 7:
0 libsystem_kernel.dylib 0x00007fff8b0fb5e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ffc5578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff8ffc3341 start_wqthread + 13
Thread 8:
0 libsystem_kernel.dylib 0x00007fff8b0fb5e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ffc5578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff8ffc3341 start_wqthread + 13
Thread 9:
0 libsystem_kernel.dylib 0x00007fff8b0fb5e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ffc5578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff8ffc3341 start_wqthread + 13
Thread 10:
0 libsystem_kernel.dylib 0x00007fff8b0fb5e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff8ffc5578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff8ffc3341 start_wqthread + 13
Thread 11:: CVDisplayLink
0 libsystem_kernel.dylib 0x00007fff8b0fadb6 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff8ffc675e _pthread_cond_wait + 821
2 com.apple.CoreVideo 0x00007fff8eb410d8 CVDisplayLink::waitUntil(unsigned long long) + 232
3 com.apple.CoreVideo 0x00007fff8eb40ed1 CVDisplayLink::runIOThread() + 511
4 com.apple.CoreVideo 0x00007fff8eb409a9 startIOThread(void*) + 147
5 libsystem_pthread.dylib 0x00007fff8ffc599d _pthread_body + 131
6 libsystem_pthread.dylib 0x00007fff8ffc591a _pthread_start + 168
7 libsystem_pthread.dylib 0x00007fff8ffc3351 thread_start + 13
Thread 12:: http
0 libsystem_kernel.dylib 0x00007fff8b0fadb6 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff8ffc6728 _pthread_cond_wait + 767
2 dmengine 0x0000000106fcfe69 dmConditionVariable::Wait(_opaque_pthread_cond_t*, _opaque_pthread_mutex_t*) + 9
3 dmengine 0x0000000106ff5bea dmMessage::InternalDispatch(unsigned long long, void ()(dmMessage::Message, void*), void*, bool) + 330
4 dmengine 0x0000000106f6efaf dmHttpService::Loop(void*) + 63
5 dmengine 0x00000001070047bc dmThread::ThreadStartProxy(void*) + 28
6 libsystem_pthread.dylib 0x00007fff8ffc599d _pthread_body + 131
7 libsystem_pthread.dylib 0x00007fff8ffc591a _pthread_start + 168
8 libsystem_pthread.dylib 0x00007fff8ffc3351 thread_start + 13
Thread 13:: http
0 libsystem_kernel.dylib 0x00007fff8b0fadb6 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff8ffc6728 _pthread_cond_wait + 767
2 dmengine 0x0000000106fcfe69 dmConditionVariable::Wait(_opaque_pthread_cond_t*, _opaque_pthread_mutex_t*) + 9
3 dmengine 0x0000000106ff5bea dmMessage::InternalDispatch(unsigned long long, void ()(dmMessage::Message, void*), void*, bool) + 330
4 dmengine 0x0000000106f6efaf dmHttpService::Loop(void*) + 63
5 dmengine 0x00000001070047bc dmThread::ThreadStartProxy(void*) + 28
6 libsystem_pthread.dylib 0x00007fff8ffc599d _pthread_body + 131
7 libsystem_pthread.dylib 0x00007fff8ffc591a _pthread_start + 168
8 libsystem_pthread.dylib 0x00007fff8ffc3351 thread_start + 13
Thread 14:: http
0 libsystem_kernel.dylib 0x00007fff8b0fadb6 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff8ffc6728 _pthread_cond_wait + 767
2 dmengine 0x0000000106fcfe69 dmConditionVariable::Wait(_opaque_pthread_cond_t*, _opaque_pthread_mutex_t*) + 9
3 dmengine 0x0000000106ff5bea dmMessage::InternalDispatch(unsigned long long, void ()(dmMessage::Message, void*), void*, bool) + 330
4 dmengine 0x0000000106f6efaf dmHttpService::Loop(void*) + 63
5 dmengine 0x00000001070047bc dmThread::ThreadStartProxy(void*) + 28
6 libsystem_pthread.dylib 0x00007fff8ffc599d _pthread_body + 131
7 libsystem_pthread.dylib 0x00007fff8ffc591a _pthread_start + 168
8 libsystem_pthread.dylib 0x00007fff8ffc3351 thread_start + 13
…