Skip to content

Commit

Permalink
Fix HLSL geometry shader debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
dfranx committed Dec 23, 2020
1 parent 5c01b0e commit a2b1747
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/SHADERed/Objects/DebugInformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@ namespace ed {
auto* outputPtr1 = &m_pixel->VertexShaderOutput[1];
auto* outputPtr2 = &m_pixel->VertexShaderOutput[2];

if (m_pixel->GeometryShaderUsed) {
if (m_pixel->GeometryShaderUsed && m_pixel->GeometrySelectedPrimitive != -1 && m_pixel->GeometrySelectedVertex != -1) {
if (m_pixel->GeometryOutputType == GeometryShaderOutput::Points) {
outputPtr0 = &m_pixel->GeometryOutput[m_pixel->GeometrySelectedPrimitive].Output[m_pixel->GeometrySelectedVertex];
outputPtr1 = nullptr;
Expand Down Expand Up @@ -2072,22 +2072,26 @@ namespace ed {
}
} while (currentBlock->pointer);

if (blockName == nullptr)
blockName = slot->name;

// copy the VS shader output
for (spvm_word vert = 0; vert < slot->member_count; vert++) {
// find the interface block from the VertexShaderOutput
spvm_result_t blockData = nullptr;
for (spvm_word j = 0; j < pixel.VertexShaderOutput[vert].size(); j++) {
const char* vsOutName = pixel.VertexShaderOutput[vert][j].name;

if (vsOutName && blockName && strcmp(vsOutName, blockName) == 0) {
// check by name or by location
if ((vsOutName && blockName && strcmp(vsOutName, blockName) == 0) ||
(pixel.VertexShaderOutput[vert][j].return_type == location)) {
blockData = &pixel.VertexShaderOutput[vert][j];
break;
}
}

if (blockData) {
if (blockData && slot->members[vert].member_count == blockData->member_count)
spvm_member_memcpy(slot->members[vert].members, blockData->members, blockData->member_count);
}
}
}
}
Expand Down

0 comments on commit a2b1747

Please sign in to comment.