mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-17 17:52:11 +01:00
[dxbc] Check if the signature is nullptr before using it
Fixes a crash in The Witcher 3.
This commit is contained in:
parent
31772af4a5
commit
0ab27aa4e3
@ -49,13 +49,15 @@ namespace dxvk {
|
||||
DxbcClipCullInfo DxbcAnalyzer::getClipCullInfo(const Rc<DxbcIsgn>& sgn) const {
|
||||
DxbcClipCullInfo result;
|
||||
|
||||
for (auto e = sgn->begin(); e != sgn->end(); e++) {
|
||||
const uint32_t componentCount = e->componentMask.popCount();
|
||||
|
||||
if (e->systemValue == DxbcSystemValue::ClipDistance)
|
||||
result.numClipPlanes += componentCount;
|
||||
if (e->systemValue == DxbcSystemValue::CullDistance)
|
||||
result.numCullPlanes += componentCount;
|
||||
if (sgn != nullptr) {
|
||||
for (auto e = sgn->begin(); e != sgn->end(); e++) {
|
||||
const uint32_t componentCount = e->componentMask.popCount();
|
||||
|
||||
if (e->systemValue == DxbcSystemValue::ClipDistance)
|
||||
result.numClipPlanes += componentCount;
|
||||
if (e->systemValue == DxbcSystemValue::CullDistance)
|
||||
result.numCullPlanes += componentCount;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user