Draw invalid shader fix.

This commit is contained in:
Tanasart 2023-03-30 13:33:53 +07:00
parent 9d47b74b98
commit da2f1eb4c3
3 changed files with 14 additions and 1 deletions

View File

@ -277,12 +277,16 @@ event_inherited();
ds_list_add(_list, "Favourites");
for( var i = 0; i < array_length(global.FAV_NODES); i++ ) {
var _nodeIndex = global.FAV_NODES[i];
if(!ds_map_exists(ALL_NODES, _nodeIndex)) continue;
ds_list_add(_list, ALL_NODES[? _nodeIndex]);
}
ds_list_add(_list, "Recents");
for( var i = 0; i < array_length(global.RECENT_NODES); i++ ) {
var _nodeIndex = global.RECENT_NODES[i];
if(!ds_map_exists(ALL_NODES, _nodeIndex)) continue;
ds_list_add(_list, ALL_NODES[? _nodeIndex]);
}
}

View File

@ -735,7 +735,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
overlay_w = ww;
overlay_h = hh;
if(is_surface(base)) surface_size_to(_outSurf, ww, hh, cDep);
if(is_surface(base))
_outSurf = surface_size_to(_outSurf, ww, hh, cDep);
for(var i = 0; i < 2; i++) {
temp_surface[i] = surface_verify(temp_surface[i], surface_get_width(_outSurf), surface_get_height(_outSurf), cDep);

View File

@ -76,6 +76,12 @@ function shader_set_surface(sampler, surface) {
}
function surface_set_shader(surface, shader = sh_sample, clear = true, blend = BLEND.over) {
if(!is_surface(surface)) {
__surface_set = false;
return;
}
__surface_set = true;
surface_set_target(surface);
if(clear) DRAW_CLEAR;
@ -90,6 +96,8 @@ function shader_set_surface(sampler, surface) {
}
function surface_reset_shader() {
if(!__surface_set) return;
gpu_set_tex_filter(false);
BLEND_NORMAL;
surface_reset_target();