Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dfranx committed Feb 15, 2021
1 parent c1686d0 commit ff894c1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions libs/ImFileDialog/ImFileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ namespace ifd {
ImGui::SameLine();
}
if (ImGui::Button(btnList[i].c_str(), ImVec2(0, GUI_ELEMENT_SIZE))) {
#ifdef _WIN32
std::string newPath = "";
#else
std::string newPath = "/";
#endif
for (int j = 0; j <= i; j++) {
newPath += btnList[j];
#ifdef _WIN32
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/RenderEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ namespace ed {
PipelineItem* item = m_items[i];
if (item->Type == PipelineItem::ItemType::ShaderPass) {
pipe::ShaderPass* shader = (pipe::ShaderPass*)item->Data;
if (strcmp(shader->VSPath, fname) == 0 || strcmp(shader->PSPath, fname) == 0 || strcmp(shader->GSPath, fname) == 0) {
if (strcmp(shader->VSPath, fname) == 0 || strcmp(shader->TESPath, fname) == 0 || strcmp(shader->TCSPath, fname) == 0 || strcmp(shader->PSPath, fname) == 0 || strcmp(shader->GSPath, fname) == 0) {
Recompile(item->Name);
}
} else if (item->Type == PipelineItem::ItemType::ComputePass && m_computeSupported) {
Expand Down
16 changes: 14 additions & 2 deletions src/SHADERed/Objects/ShaderCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ namespace ed {

// set macros
std::string preambleStr = (inLang == ShaderLanguage::HLSL) ? "#extension GL_GOOGLE_include_directive : enable\n" : "";
if (inLang == ShaderLanguage::HLSL && (sType == ShaderStage::TessellationControl || sType == ShaderStage::TessellationEvaluation))
preambleStr += "#extension GL_EXT_debug_printf : enable\n";

#ifdef SHADERED_WEB
preambleStr += "#define SHADERED_WEB\n";
Expand Down Expand Up @@ -462,10 +464,20 @@ namespace ed {
// link
glslang::TProgram prog;
prog.addShader(&shader);

if (!prog.link(messages)) {
if (msgs != nullptr)
if (msgs != nullptr) {
msgs->Add(MessageStack::Type::Error, msgs->CurrentItem, "Shader linking failed", -1, sType);

const char* infoLog = prog.getInfoLog();
if (infoLog != nullptr) {
std::string info(infoLog);
size_t errorLoc = info.find("ERROR:");
size_t errorEnd = info.find("\n", errorLoc+1);
if (errorLoc != std::string::npos && errorEnd != std::string::npos)
msgs->Add(MessageStack::Type::Error, msgs->CurrentItem, info.substr(errorLoc+7, errorEnd-errorLoc-7), -1, sType);
}
}
return false;
}

Expand Down

0 comments on commit ff894c1

Please sign in to comment.