MCPcopy Create free account
hub / github.com/crownengine/crown / check_uniform

Method check_uniform

src/resource/material_resource.cpp:180–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 s32 check_uniform(const StringView &name, UniformType::Enum type, const UniformValue &value, CompileOptions &opts)
181 {
182 UniformMetadata *meta = find_meta(name);
183
184 if (meta != NULL) {
185 // Uniform has been added already by add_shader_uniforms().
186 // Just check for type or range mismatch and overwrite value.
187 RETURN_IF_FALSE(MATERIAL_RESOURCE, type == meta->type, opts, "Uniform %s: type mismatch", meta->name);
188 u32 in = uniform_index(name);
189 CE_ENSURE(in != UINT32_MAX);
190 uniform_values[in] = value;
191 } else {
192 add_uniform(name, type, value);
193 }
194
195 return 0;
196 }
197
198 void alloc_blob()
199 {

Callers 1

parse_uniformsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected