godot/servers/rendering/renderer_rd/storage_rd/material_storage.cpp

/**************************************************************************/
/*  material_storage.cpp                                                  */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* Permission is hereby granted, free of charge, to any person obtaining  */
/* a copy of this software and associated documentation files (the        */
/* "Software"), to deal in the Software without restriction, including    */
/* without limitation the rights to use, copy, modify, merge, publish,    */
/* distribute, sublicense, and/or sell copies of the Software, and to     */
/* permit persons to whom the Software is furnished to do so, subject to  */
/* the following conditions:                                              */
/*                                                                        */
/* The above copyright notice and this permission notice shall be         */
/* included in all copies or substantial portions of the Software.        */
/*                                                                        */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */
/**************************************************************************/

#include "material_storage.h"
#include "core/config/engine.h"
#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
#include "servers/rendering/storage/variant_converters.h"
#include "texture_storage.h"

usingnamespaceRendererRD;

///////////////////////////////////////////////////////////////////////////
// UBI helper functions

static void _fill_std140_variant_ubo_value(ShaderLanguage::DataType type, int p_array_size, const Variant &value, uint8_t *data, bool p_linear_color) {}

_FORCE_INLINE_ static void _fill_std140_ubo_value(ShaderLanguage::DataType type, const Vector<ShaderLanguage::Scalar> &value, uint8_t *data) {}

_FORCE_INLINE_ static void _fill_std140_ubo_empty(ShaderLanguage::DataType type, int p_array_size, uint8_t *data) {}

///////////////////////////////////////////////////////////////////////////
// MaterialStorage::ShaderData

void MaterialStorage::ShaderData::set_path_hint(const String &p_hint) {}

void MaterialStorage::ShaderData::set_default_texture_parameter(const StringName &p_name, RID p_texture, int p_index) {}

Variant MaterialStorage::ShaderData::get_default_parameter(const StringName &p_parameter) const {}

void MaterialStorage::ShaderData::get_shader_uniform_list(List<PropertyInfo> *p_param_list) const {}

void MaterialStorage::ShaderData::get_instance_param_list(List<RendererMaterialStorage::InstanceShaderParam> *p_param_list) const {}

bool MaterialStorage::ShaderData::is_parameter_texture(const StringName &p_param) const {}

RD::PipelineColorBlendState::Attachment MaterialStorage::ShaderData::blend_mode_to_blend_attachment(BlendMode p_mode) {}

bool MaterialStorage::ShaderData::blend_mode_uses_blend_alpha(BlendMode p_mode) {}

///////////////////////////////////////////////////////////////////////////
// MaterialStorage::MaterialData

void MaterialStorage::MaterialData::update_uniform_buffer(const HashMap<StringName, ShaderLanguage::ShaderNode::Uniform> &p_uniforms, const uint32_t *p_uniform_offsets, const HashMap<StringName, Variant> &p_parameters, uint8_t *p_buffer, uint32_t p_buffer_size, bool p_use_linear_color) {}

MaterialStorage::MaterialData::~MaterialData() {}

void MaterialStorage::MaterialData::update_textures(const HashMap<StringName, Variant> &p_parameters, const HashMap<StringName, HashMap<int, RID>> &p_default_textures, const Vector<ShaderCompiler::GeneratedCode::Texture> &p_texture_uniforms, RID *p_textures, bool p_use_linear_color, bool p_3d_material) {}

void MaterialStorage::MaterialData::free_parameters_uniform_set(RID p_uniform_set) {}

bool MaterialStorage::MaterialData::update_parameters_uniform_set(const HashMap<StringName, Variant> &p_parameters, bool p_uniform_dirty, bool p_textures_dirty, const HashMap<StringName, ShaderLanguage::ShaderNode::Uniform> &p_uniforms, const uint32_t *p_uniform_offsets, const Vector<ShaderCompiler::GeneratedCode::Texture> &p_texture_uniforms, const HashMap<StringName, HashMap<int, RID>> &p_default_texture_params, uint32_t p_ubo_size, RID &uniform_set, RID p_shader, uint32_t p_shader_uniform_set, bool p_use_linear_color, bool p_3d_material) {}

void MaterialStorage::MaterialData::set_as_used() {}

///////////////////////////////////////////////////////////////////////////
// MaterialStorage::Samplers

Vector<RD::Uniform> MaterialStorage::Samplers::get_uniforms(int p_first_index) const {}

bool MaterialStorage::Samplers::is_valid() const {}

bool MaterialStorage::Samplers::is_null() const {}

///////////////////////////////////////////////////////////////////////////
// MaterialStorage

MaterialStorage *MaterialStorage::singleton =;

MaterialStorage *MaterialStorage::get_singleton() {}

MaterialStorage::MaterialStorage() {}

MaterialStorage::~MaterialStorage() {}

bool MaterialStorage::free(RID p_rid) {}

/* GLOBAL SHADER UNIFORM API */

int32_t MaterialStorage::_global_shader_uniform_allocate(uint32_t p_elements) {}

void MaterialStorage::_global_shader_uniform_store_in_buffer(int32_t p_index, RS::GlobalShaderParameterType p_type, const Variant &p_value) {}

void MaterialStorage::_global_shader_uniform_mark_buffer_dirty(int32_t p_index, int32_t p_elements) {}

void MaterialStorage::global_shader_parameter_add(const StringName &p_name, RS::GlobalShaderParameterType p_type, const Variant &p_value) {}

void MaterialStorage::global_shader_parameter_remove(const StringName &p_name) {}

Vector<StringName> MaterialStorage::global_shader_parameter_get_list() const {}

void MaterialStorage::global_shader_parameter_set(const StringName &p_name, const Variant &p_value) {}

void MaterialStorage::global_shader_parameter_set_override(const StringName &p_name, const Variant &p_value) {}

Variant MaterialStorage::global_shader_parameter_get(const StringName &p_name) const {}

RS::GlobalShaderParameterType MaterialStorage::global_shader_parameter_get_type_internal(const StringName &p_name) const {}

RS::GlobalShaderParameterType MaterialStorage::global_shader_parameter_get_type(const StringName &p_name) const {}

void MaterialStorage::global_shader_parameters_load_settings(bool p_load_textures) {}

void MaterialStorage::global_shader_parameters_clear() {}

RID MaterialStorage::global_shader_uniforms_get_storage_buffer() const {}

int32_t MaterialStorage::global_shader_parameters_instance_allocate(RID p_instance) {}

void MaterialStorage::global_shader_parameters_instance_free(RID p_instance) {}

void MaterialStorage::global_shader_parameters_instance_update(RID p_instance, int p_index, const Variant &p_value, int p_flags_count) {}

void MaterialStorage::_update_global_shader_uniforms() {}

/* SHADER API */

RID MaterialStorage::shader_allocate() {}

void MaterialStorage::shader_initialize(RID p_rid) {}

void MaterialStorage::shader_free(RID p_rid) {}

void MaterialStorage::shader_set_code(RID p_shader, const String &p_code) {}

void MaterialStorage::shader_set_path_hint(RID p_shader, const String &p_path) {}

String MaterialStorage::shader_get_code(RID p_shader) const {}

void MaterialStorage::get_shader_parameter_list(RID p_shader, List<PropertyInfo> *p_param_list) const {}

void MaterialStorage::shader_set_default_texture_parameter(RID p_shader, const StringName &p_name, RID p_texture, int p_index) {}

RID MaterialStorage::shader_get_default_texture_parameter(RID p_shader, const StringName &p_name, int p_index) const {}

Variant MaterialStorage::shader_get_parameter_default(RID p_shader, const StringName &p_param) const {}

void MaterialStorage::shader_set_data_request_function(ShaderType p_shader_type, ShaderDataRequestFunction p_function) {}

RS::ShaderNativeSourceCode MaterialStorage::shader_get_native_source_code(RID p_shader) const {}

/* MATERIAL API */

void MaterialStorage::_material_uniform_set_erased(void *p_material) {}

void MaterialStorage::_material_queue_update(Material *material, bool p_uniform, bool p_texture) {}

void MaterialStorage::_update_queued_materials() {}

RID MaterialStorage::material_allocate() {}

void MaterialStorage::material_initialize(RID p_rid) {}

void MaterialStorage::material_free(RID p_rid) {}

void MaterialStorage::material_set_shader(RID p_material, RID p_shader) {}

MaterialStorage::ShaderData *MaterialStorage::material_get_shader_data(RID p_material) {}

void MaterialStorage::material_set_param(RID p_material, const StringName &p_param, const Variant &p_value) {}

Variant MaterialStorage::material_get_param(RID p_material, const StringName &p_param) const {}

void MaterialStorage::material_set_next_pass(RID p_material, RID p_next_material) {}

void MaterialStorage::material_set_render_priority(RID p_material, int priority) {}

bool MaterialStorage::material_is_animated(RID p_material) {}

bool MaterialStorage::material_casts_shadows(RID p_material) {}

void MaterialStorage::material_get_instance_shader_parameters(RID p_material, List<InstanceShaderParam> *r_parameters) {}

void MaterialStorage::material_update_dependency(RID p_material, DependencyTracker *p_instance) {}

MaterialStorage::Samplers MaterialStorage::samplers_rd_allocate(float p_mipmap_bias) const {}

void MaterialStorage::samplers_rd_free(Samplers &p_samplers) const {}

void MaterialStorage::material_set_data_request_function(ShaderType p_shader_type, MaterialStorage::MaterialDataRequestFunction p_function) {}

MaterialStorage::MaterialDataRequestFunction MaterialStorage::material_get_data_request_function(ShaderType p_shader_type) {}