| 199 | } |
| 200 | |
| 201 | void GetProgramUniformCount(dmGraphics::HProgram program, uint32_t total_constants_count, uint32_t* constant_count_out, uint32_t* samplers_count_out) |
| 202 | { |
| 203 | uint32_t constants_count = 0; |
| 204 | uint32_t samplers_count = 0; |
| 205 | |
| 206 | for (uint32_t i = 0; i < total_constants_count; ++i) |
| 207 | { |
| 208 | dmGraphics::Uniform uniform_desc = {}; |
| 209 | dmGraphics::GetUniform(program, i, &uniform_desc); |
| 210 | |
| 211 | if (!IsUniformTypeSupported(uniform_desc.m_Type)) |
| 212 | { |
| 213 | dmLogWarning("Type for uniform %s is not supported (%d)", uniform_desc.m_Name, uniform_desc.m_Type); |
| 214 | continue; |
| 215 | } |
| 216 | |
| 217 | if (uniform_desc.m_Type == dmGraphics::TYPE_FLOAT_VEC4 || uniform_desc.m_Type == dmGraphics::TYPE_FLOAT_MAT4) |
| 218 | { |
| 219 | constants_count++; |
| 220 | } |
| 221 | else if (dmGraphics::IsTypeTextureType(uniform_desc.m_Type)) |
| 222 | { |
| 223 | samplers_count++; |
| 224 | } |
| 225 | else if (uniform_desc.m_Type == dmGraphics::TYPE_SAMPLER) |
| 226 | { |
| 227 | // ignore samplers for now |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | *constant_count_out = constants_count; |
| 232 | *samplers_count_out = samplers_count; |
| 233 | } |
| 234 | |
| 235 | static Constant* FindConstant(dmArray<RenderConstant>& constants, dmhash_t name_hash) |
| 236 | { |
no test coverage detected