Skip to content

Commit

Permalink
shaders: do not crash if fetching sampler data fails
Browse files Browse the repository at this point in the history
  • Loading branch information
DHrpcs3 committed Aug 31, 2024
1 parent a6f2eff commit e4f370c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion hw/amdgpu/shader/src/Fragment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5555,7 +5555,16 @@ spirv::SamplerValue Fragment::createSampler(RegisterId base) {
sbuffer, std::size(sbuffer), TypeId::Sampler);
return builder.createLoad(context->getSamplerType(), uniform->variable);
} else {
util::unreachable();
std::uint32_t sbuffer[] = {
0,
0,
0,
0,
};

auto uniform = context->getOrCreateUniformConstant(
sbuffer, std::size(sbuffer), TypeId::Sampler);
return builder.createLoad(context->getSamplerType(), uniform->variable);
}
}

Expand Down

0 comments on commit e4f370c

Please sign in to comment.