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

Defold Crashing when changing material on a sprite #8950

Closed
schlista opened this issue May 18, 2024 · 1 comment
Closed

Defold Crashing when changing material on a sprite #8950

schlista opened this issue May 18, 2024 · 1 comment
Assignees
Labels
bug Something is not working as expected engine Issues related to the Defold engine sprite Issues related to sprites

Comments

@schlista
Copy link

schlista commented May 18, 2024

Is it a private platform, and a platform specific issue? (i.e. would it break your NDA?)

Then please report your issue in the corresponding extension repository!

Describe the bug (REQUIRED)

ERROR:SCRIPT: main/change_shader.script:11: go.set failed with error code -10
stack traceback:
  [C]:-1: in function set
  main/change_shader.script:11: in function <main/change_shader.script:8>

Assertion failed: i < Size(), file D:\a\defold\defold\tmp\dynamo_home\sdk\include\dmsdk/dlib/array.h, line 494
INFO:CRASH: Successfully wrote Crashdump to file: C:\Users\Mike\AppData\Roaming\Defold/_crash
ERROR:CRASH: CALL STACK:

ERROR:CRASH:  0 0x7FF7018E4030 dmCrash::GenerateCallstack D:\a\defold\defold\engine\crash\src\backtrace_win32.cpp:144
ERROR:CRASH:  1 0x7FF7019DBC4C raise minkernel\crts\ucrt\src\appcrt\misc\signal.cpp:547
ERROR:CRASH:  2 0x7FF7019BFBCC abort minkernel\crts\ucrt\src\appcrt\startup\abort.cpp:71
ERROR:CRASH:  3 0x7FF70196F5B8 common_assert_to_stderr<wchar_t> minkernel\crts\ucrt\src\appcrt\startup\assert.cpp:186
ERROR:CRASH:  4 0x7FF70196FC70 _wassert minkernel\crts\ucrt\src\appcrt\startup\assert.cpp:443
ERROR:CRASH:  5 0x7FF701611AF0 dmGameSystem::RenderBatch D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_sprite.cpp:1319
ERROR:CRASH:  6 0x7FF7016121A0 dmGameSystem::RenderListDispatch D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_sprite.cpp:1733
ERROR:CRASH:  7 0x7FF7016EA5C0 dmRender::DrawRenderList D:\a\defold\defold\engine\render\src\render\render.cpp:894
ERROR:CRASH:  8 0x7FF701708CB0 dmRender::ParseCommands D:\a\defold\defold\engine\render\src\render\render_command.cpp:183
ERROR:CRASH:  9 0x7FF7016F7090 dmRender::UpdateRenderScriptInstance D:\a\defold\defold\engine\render\src\render\render_script.cpp:3607
ERROR:CRASH: 10 0x7FF70152FB30 dmEngine::StepFrame D:\a\defold\defold\engine\engine\src\engine.cpp:1687
ERROR:CRASH: 11 0x7FF701530890 dmEngineUpdate D:\a\defold\defold\engine\engine\src\engine.cpp:2189
ERROR:CRASH: 12 0x7FF701530AC0 dmEngine::RunLoop D:\a\defold\defold\engine\engine\src\engine_loop.cpp:83
ERROR:CRASH: 13 0x7FF701528CA0 engine_main D:\a\defold\defold\engine\engine\src\engine_main.cpp:152
ERROR:CRASH: 14 0x7FF701951BA4 __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
ERROR:CRASH: 15 0x7FF80B422560 BaseThreadInitThunk <unknown>:0
ERROR:CRASH: 16 0x7FF80C2EAA20 RtlUserThreadStart <unknown>:0
ERROR:CRASH:

This is the code I’m using. And yes I know I’m created the same material twice. I’m just doing this as a test. 2nd material will be entered once I get this working.

function init(self)
	-- Store references to the materials
	self.material1 = hash("/assets/rainbow/rainbow.materialc")
	self.material2 = hash("/assets/rainbow/rainbow.materialc")
	--self.material2 = resource.load("/assets/materials/holographic/holographic.materialc")
end

function on_message(self, message_id, message, sender)
	if message_id == hash("change_shader") then
		if message.shader == 1 then
			go.set("#sprite", "material", self.material1)
		elseif message.shader == 2 then
			go.set("#sprite", "material", self.material2)
		end
		-- ... handle more shaders as needed
	end
end

Expected behavior (REQUIRED)
It should give an error instead of crashing.

Defold version (REQUIRED):
v 1.8.0

Platforms (REQUIRED):
WIndows 11

Minimal repro case project (OPTIONAL):
repro.zip

Logs (OPTIONAL):
_crash.dmp

Workaround (OPTIONAL):
If there is a workaround, please describe it here.

Screenshots (OPTIONAL):
If applicable, add screenshots to help explain your problem.

Additional context (OPTIONAL):
Add any other context about the problem here.

@schlista schlista added the bug Something is not working as expected label May 18, 2024
@britzl britzl added sprite Issues related to sprites engine Issues related to the Defold engine labels May 20, 2024
@Jhonnyg
Copy link
Contributor

Jhonnyg commented May 23, 2024

Unable to reproduce this in latest alpha!

@Jhonnyg Jhonnyg closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected engine Issues related to the Defold engine sprite Issues related to sprites
Projects
Status: Done
Development

No branches or pull requests

4 participants