Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions c_api_src/wrap_love_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6057,15 +6057,26 @@ namespace wrap
return false;
}

if (matrix_count <= 0)
{
wrap_ee("no matrix was supplied for uniform variable '%s'", name);
return false;
}

int columns = info->matrix.columns;
int rows = info->matrix.rows;
if (columns_lenght != columns || rows_length != rows_length)
if (columns_lenght != columns || rows_length != rows)
{
wrap_ee("matrix columns or rows error, uniform variable %s send type error", name);
return false;
}

int count = inline_type_Shader_getCount(info, matrix_count);
int count = inline_type_Shader_getCount(info, matrix_count);
int components = rows * columns;
float* values = info->floats;

memcpy(values, valueArray, components * count * sizeof(float));

return wrap_catchexcept([&]() { shader->updateUniform(info, count); });
}

Expand Down