1 #ifndef DALI_INTERNAL_UPDATE_RENDERING_SHADER_CACHE_H
2 #define DALI_INTERNAL_UPDATE_RENDERING_SHADER_CACHE_H
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 #include <dali/integration-api/graphics/graphics.h>
21 #include <dali/graphics-api/graphics-api-accessor.h>
22 #include <dali/graphics-api/graphics-api-shader.h>
23 #include <dali/graphics-api/graphics-api-shader-details.h>
33 * Caches graphics shaders as they are created by SceneGraph::Shader.
41 Dali::Graphics::API::Accessor<Dali::Graphics::API::Shader> shader{ nullptr };
42 Dali::Graphics::API::ShaderDetails::ShaderSource vertexSource{""};
43 Dali::Graphics::API::ShaderDetails::ShaderSource fragmentSource{""};
49 * @param[in] controller The graphics controller
51 explicit ShaderCache( Dali::Graphics::API::Controller& controller );
54 * Get a shader from it's source code
56 Dali::Graphics::API::Accessor<Dali::Graphics::API::Shader> GetShader(
57 const Dali::Graphics::API::ShaderDetails::ShaderSource& vsh,
58 const Dali::Graphics::API::ShaderDetails::ShaderSource& fsh );
61 std::vector<Item> mItems;
62 Dali::Graphics::API::Controller& mController;
65 } // namespace SceneGraph
66 } // namespace Internal
69 #endif //DALI_INTERNAL_UPDATE_RENDERING_SHADER_CACHE_H