Using draw_texture() with load() causes an error
Operating system or device - Godot version: 2.1.3
Issue description: Doing this:
func _draw():
draw_texture(load("res://texture.png"), Vector2(0,0))
will cause an error to flood the debugger and the texture is shown completely white. However, doing this is fine:
var tex = load("res://texture.png")
func _draw():
draw_texture(tex, Vector2(0,0))
Is this a limitation or a bug?
This is the error displayed:
C Error: Condition ' !elem ' is true. returned: 0
C Source: c:\projects\godot-builds\godot\core\rid.h:143
C Function: RID_Owner<struct RasterizerGLES2:Texture,0>::get
Tagging as bug/rendering as it seems that the renderer fails to get a reference to the texture, which causes it to be freed.
I can't reproduce on Ubuntu, is this a Windows only problem or was solved already?
I had this issue on Windows (not sure about Mac). I don't think it has been solved yet, can't see any related patch notes in the 2.1.4 beta.
This issue is still present in Godot 3.0 Beta 2. Tested on a Windows 10 laptop with an Intel HD 4000.
Isn't this the same as #15023? That is, once the function is over, the texture will be freed since it's out of scope, thus the visual server won't find the texture.
Oh, that makes sense. Thanks for clarifying.