Skip to content

Commit

Permalink
GLSL: Just skip over impossible declarations instead of early-exit.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKristian-Work committed Oct 15, 2024
1 parent 1f4b24e commit e670b39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ struct FHitGroupRootConstants
uint UserData;
};

layout(binding = 20, std430) readonly buffer type_StructuredBuffer_FHitGroupRootConstants
{
FHitGroupRootConstants _RESERVED_IDENTIFIER_FIXUP_m0[];
} HitGroupData;

void main()
{
}
Expand Down
4 changes: 2 additions & 2 deletions spirv_glsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3693,11 +3693,11 @@ void CompilerGLSL::emit_resources()
auto &type = this->get<SPIRType>(undef.basetype);
// OpUndef can be void for some reason ...
if (type.basetype == SPIRType::Void)
return;
continue;

// This will break. It is bogus and should not be legal.
if (type_is_top_level_block(type))
return;
continue;

string initializer;
if (options.force_zero_initialized_variables && type_can_zero_initialize(type))
Expand Down

0 comments on commit e670b39

Please sign in to comment.