Shader fixes
This commit is contained in:
@@ -316,15 +316,17 @@ function uniforms_set_context_const(location: i32, c: shader_const_t): bool {
|
||||
v.y = (-zfar * znear) / (zfar - znear);
|
||||
}
|
||||
else if (starts_with(c.link, "_size(")) {
|
||||
let tex: string = substring(c.link, 6, c.link.length - 1);
|
||||
for (let i: i32 = 0; i < math_floor(_render_path_bind_params.length / 2); ++i) {
|
||||
let pos: i32 = i * 2; // bind params = [texture, sampler_id]
|
||||
let sampler_id: string = _render_path_bind_params[pos + 1];
|
||||
if (sampler_id == tex) {
|
||||
let rt_id: string = _render_path_bind_params[pos];
|
||||
let rt: render_target_t = map_get(render_path_render_targets, rt_id);
|
||||
v.x = rt.width;
|
||||
v.y = rt.height;
|
||||
if (_render_path_bind_params != null) {
|
||||
let tex: string = substring(c.link, 6, c.link.length - 1);
|
||||
for (let i: i32 = 0; i < math_floor(_render_path_bind_params.length / 2); ++i) {
|
||||
let pos: i32 = i * 2; // bind params = [texture, sampler_id]
|
||||
let sampler_id: string = _render_path_bind_params[pos + 1];
|
||||
if (sampler_id == tex) {
|
||||
let rt_id: string = _render_path_bind_params[pos];
|
||||
let rt: render_target_t = map_get(render_path_render_targets, rt_id);
|
||||
v.x = rt.width;
|
||||
v.y = rt.height;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user