Skip to content

Build Failed/blender-launcher errors #105

@HighImGriff

Description

@HighImGriff

(note if you do not see blender.exe and only see blender-launcher.exe then your build failed)
While building the engine I found 2 issues that needed to be resolved.

The first was inside of intern\cycles\util\profiling.cpp

add these 3 headers

#include <chrono>
#include <thread>
#include <string>

the next was inside of intern\cycles\scene\image.cpp

find this if block

if (FileFormat == TypeDesc::FLOAT) {
  if (is_rgba) {
    for (size_t i = 0; i < num_pixels; i += 4) {
      StorageType *pixel = &pixels[i * 4];
      if (!isfinite(pixel[0]) || !isfinite(pixel[1]) || !isfinite(pixel[2]) || !isfinite(pixel[3])) {
        pixel[0] = 0;
        pixel[1] = 0;
        pixel[2] = 0;
        pixel[3] = 0;
      }
    }
  } else {
    for (size_t i = 0; i < num_pixels; ++i) {
      StorageType *pixel = &pixels[i];
      if (!isfinite(pixel[0])) {
        pixel[0] = 0;
      }
    }
  }
}

and replace with

 if (FileFormat == TypeDesc::FLOAT) {
    if (is_rgba) {
      for (size_t i = 0; i < num_pixels; i += 4) {
        StorageType *pixel = &pixels[i * 4];
        if (!isfinite(static_cast<float>(pixel[0])) || !isfinite(static_cast<float>(pixel[1])) ||
            !isfinite(static_cast<float>(pixel[2])) || !isfinite(static_cast<float>(pixel[3])))
        {
          pixel[0] = 0;
          pixel[1] = 0;
          pixel[2] = 0;
          pixel[3] = 0;
        }
      }
    }
    else {
      for (size_t i = 0; i < num_pixels; ++i) {
        StorageType *pixel = &pixels[i];
        if (!isfinite(static_cast<float>(pixel[0]))) {
          pixel[0] = 0;
        }
      }
    }
  }

I didn't get it to work when I tried this but this was also said to work

if constexpr (FileFormat == TypeDesc::FLOAT) {
  if (is_rgba) {
    for (size_t i = 0; i < num_pixels; i += 4) {
      StorageType *pixel = &pixels[i * 4];
      if (!isfinite(pixel[0]) || !isfinite(pixel[1]) || !isfinite(pixel[2]) ||
          !isfinite(pixel[3]))
      {
        pixel[0] = 0;
        pixel[1] = 0;
        pixel[2] = 0;
        pixel[3] = 0;
      }
    }
  }
  else {
    for (size_t i = 0; i < num_pixels; ++i) {
      StorageType *pixel = &pixels[i];
      if (!isfinite(pixel[0])) {
        pixel[0] = 0;
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions