From dccda1fe434e3e3af47c44720cfedc9c1c4ccf52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 16 Apr 2018 19:26:54 +0200 Subject: DRW/GWN: Add callId builtin uniform. This uniforms can be used to have a unique id for each drawcall of a shgrp. This only works for standard shgroups and is an exception for the outline drawing. --- intern/gawain/gawain/gwn_shader_interface.h | 1 + intern/gawain/src/gwn_shader_interface.c | 1 + 2 files changed, 2 insertions(+) (limited to 'intern/gawain') diff --git a/intern/gawain/gawain/gwn_shader_interface.h b/intern/gawain/gawain/gwn_shader_interface.h index 3be2831e539..150b3b4fcc0 100644 --- a/intern/gawain/gawain/gwn_shader_interface.h +++ b/intern/gawain/gawain/gwn_shader_interface.h @@ -36,6 +36,7 @@ typedef enum { GWN_UNIFORM_COLOR, // vec4 color GWN_UNIFORM_EYE, // vec3 eye + GWN_UNIFORM_CALLID, // int callId GWN_UNIFORM_CUSTOM, // custom uniform, not one of the above built-ins diff --git a/intern/gawain/src/gwn_shader_interface.c b/intern/gawain/src/gwn_shader_interface.c index e92cabec12f..95c18cf1d39 100644 --- a/intern/gawain/src/gwn_shader_interface.c +++ b/intern/gawain/src/gwn_shader_interface.c @@ -48,6 +48,7 @@ static const char* BuiltinUniform_name(Gwn_UniformBuiltin u) [GWN_UNIFORM_COLOR] = "color", [GWN_UNIFORM_EYE] = "eye", + [GWN_UNIFORM_CALLID] = "callId", [GWN_UNIFORM_CUSTOM] = NULL, [GWN_NUM_UNIFORMS] = NULL, -- cgit v1.2.3