mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-21 13:29:26 +01:00
[dxbc] Bound-check mip level for resinfo instruction
This commit is contained in:
parent
abf5ed154f
commit
08da6d8ca4
@ -3077,7 +3077,14 @@ namespace dxvk {
|
||||
// result into a four-component vector later.
|
||||
DxbcRegisterValue imageSize = emitQueryTextureSize(ins.src[1], mipLod);
|
||||
DxbcRegisterValue imageLevels = emitQueryTextureLods(ins.src[1]);
|
||||
|
||||
|
||||
// If the mip level is out of bounds, D3D requires us to return
|
||||
// zero before applying modifiers, whereas SPIR-V is undefined,
|
||||
// so we need to fix it up manually here.
|
||||
imageSize.id = m_module.opSelect(getVectorTypeId(imageSize.type),
|
||||
m_module.opULessThan(m_module.defBoolType(), mipLod.id, imageLevels.id),
|
||||
imageSize.id, emitBuildZeroVector(imageSize.type).id);
|
||||
|
||||
// Convert intermediates to the requested type
|
||||
if (returnType == DxbcScalarType::Float32) {
|
||||
imageSize.type.ctype = DxbcScalarType::Float32;
|
||||
|
Loading…
x
Reference in New Issue
Block a user