From 12db9ee164007dedac55cef9dd5bb495f05094f7 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sun, 3 Jul 2016 22:53:16 +0100 Subject: [PATCH] gsk: Add getter for program id in ShaderBuilder Since we store it into the ShaderBuilder instance we should also allow getting the program id. --- gsk/gskshaderbuilder.c | 8 ++++++++ gsk/gskshaderbuilderprivate.h | 1 + 2 files changed, 9 insertions(+) diff --git a/gsk/gskshaderbuilder.c b/gsk/gskshaderbuilder.c index 5142e43ae1..b17c41abee 100644 --- a/gsk/gskshaderbuilder.c +++ b/gsk/gskshaderbuilder.c @@ -395,3 +395,11 @@ gsk_shader_builder_get_attribute_location (GskShaderBuilder *builder, return -1; } + +int +gsk_shader_builder_get_program (GskShaderBuilder *builder) +{ + g_return_val_if_fail (GSK_IS_SHADER_BUILDER (builder), -1); + + return builder->program_id; +} diff --git a/gsk/gskshaderbuilderprivate.h b/gsk/gskshaderbuilderprivate.h index f5f7ff89df..ce069eddeb 100644 --- a/gsk/gskshaderbuilderprivate.h +++ b/gsk/gskshaderbuilderprivate.h @@ -35,6 +35,7 @@ int gsk_shader_builder_create_program (GskShad int fragment_id, GError **error); +int gsk_shader_builder_get_program (GskShaderBuilder *builder); int gsk_shader_builder_get_uniform_location (GskShaderBuilder *builder, GQuark uniform_quark); int gsk_shader_builder_get_attribute_location (GskShaderBuilder *builder,