mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 19:54:19 +01:00
[d3d9] fix opCompositeExtract out of bound
Closes: https://github.com/doitsujin/dxvk/issues/3293 Signed-by: Oleksii Bozhenko <oleksii.bozhenko@globallogic.com>
This commit is contained in:
parent
2b09932d51
commit
80f7d2abd8
@ -1102,19 +1102,30 @@ namespace dxvk {
|
||||
m_module.opStore(m_vs.out.NORMAL, outNrm);
|
||||
|
||||
for (uint32_t i = 0; i < caps::TextureStageCount; i++) {
|
||||
uint32_t inputIndex = (m_vsKey.Data.Contents.TexcoordIndices >> (i * 3)) & 0b111;
|
||||
uint32_t inputFlags = (m_vsKey.Data.Contents.TexcoordFlags >> (i * 3)) & 0b111;
|
||||
uint32_t inputIndex = (m_vsKey.Data.Contents.TexcoordIndices >> (i * 3)) & 0b111;
|
||||
uint32_t inputFlags = (m_vsKey.Data.Contents.TexcoordFlags >> (i * 3)) & 0b111;
|
||||
uint32_t texcoordCount = (m_vsKey.Data.Contents.TexcoordDeclMask >> (i * 3)) & 0b111;
|
||||
|
||||
uint32_t transformed;
|
||||
|
||||
const uint32_t wIndex = 3;
|
||||
|
||||
uint32_t flags = (m_vsKey.Data.Contents.TransformFlags >> (i * 3)) & 0b111;
|
||||
uint32_t count = flags;
|
||||
uint32_t count;
|
||||
switch (inputFlags) {
|
||||
default:
|
||||
case (DXVK_TSS_TCI_PASSTHRU >> TCIOffset):
|
||||
transformed = m_vs.in.TEXCOORD[inputIndex & 0xFF];
|
||||
// flags is actually the number of elements that get passed
|
||||
// to the rasterizer.
|
||||
count = flags;
|
||||
if (texcoordCount) {
|
||||
// Clamp by the number of elements in the texcoord input.
|
||||
if (!count || count > texcoordCount)
|
||||
count = texcoordCount;
|
||||
}
|
||||
else
|
||||
flags = D3DTTFF_DISABLE;
|
||||
break;
|
||||
|
||||
case (DXVK_TSS_TCI_CAMERASPACENORMAL >> TCIOffset):
|
||||
@ -1798,10 +1809,9 @@ namespace dxvk {
|
||||
texcoord, texcoord, texcoordCnt, indices.data());
|
||||
|
||||
uint32_t projIdx = m_fsKey.Stages[i].Contents.ProjectedCount;
|
||||
if (projIdx == 0)
|
||||
if (projIdx == 0 || projIdx > texcoordCnt)
|
||||
projIdx = texcoordCnt;
|
||||
else
|
||||
projIdx--;
|
||||
--projIdx;
|
||||
|
||||
uint32_t projValue = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user