Skip to content

Commit

Permalink
Bugfix matching texture names to shader slots
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyGaul committed Oct 23, 2024
1 parent 6859a75 commit 09021f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cute_graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1957,8 +1957,8 @@ void cf_apply_shader(CF_Shader shader_handle, CF_Material material_handle)
int found_image_count = 0;
for (int i = 0; found_image_count < sampler_count && i < material->fs.textures.count(); ++i) {
const char* image_name = material->fs.textures[i].name;
for (int i = 0; i < shader->image_names.size(); ++i) {
if (shader->image_names[i] == image_name) {
for (int j = 0; j < shader->image_names.size(); ++j) {
if (shader->image_names[j] == image_name) {
sampler_bindings[found_image_count].sampler = ((CF_TextureInternal*)material->fs.textures[i].handle.id)->sampler;
sampler_bindings[found_image_count].texture = ((CF_TextureInternal*)material->fs.textures[i].handle.id)->tex;
found_image_count++;
Expand Down

0 comments on commit 09021f4

Please sign in to comment.