mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d11] Add range checking to GetShaderResources
This commit is contained in:
parent
65655ce37c
commit
cb7adeef08
@ -1874,8 +1874,8 @@ namespace dxvk {
|
|||||||
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumViews; i++)
|
GetShaderResources(m_state.vs.shaderResources,
|
||||||
ppShaderResourceViews[i] = m_state.vs.shaderResources.views[StartSlot + i].ref();
|
StartSlot, NumViews, ppShaderResourceViews);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2016,8 +2016,8 @@ namespace dxvk {
|
|||||||
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumViews; i++)
|
GetShaderResources(m_state.hs.shaderResources,
|
||||||
ppShaderResourceViews[i] = m_state.hs.shaderResources.views[StartSlot + i].ref();
|
StartSlot, NumViews, ppShaderResourceViews);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2158,8 +2158,8 @@ namespace dxvk {
|
|||||||
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumViews; i++)
|
GetShaderResources(m_state.ds.shaderResources,
|
||||||
ppShaderResourceViews[i] = m_state.ds.shaderResources.views[StartSlot + i].ref();
|
StartSlot, NumViews, ppShaderResourceViews);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2300,8 +2300,8 @@ namespace dxvk {
|
|||||||
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumViews; i++)
|
GetShaderResources(m_state.gs.shaderResources,
|
||||||
ppShaderResourceViews[i] = m_state.gs.shaderResources.views[StartSlot + i].ref();
|
StartSlot, NumViews, ppShaderResourceViews);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2442,8 +2442,8 @@ namespace dxvk {
|
|||||||
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumViews; i++)
|
GetShaderResources(m_state.ps.shaderResources,
|
||||||
ppShaderResourceViews[i] = m_state.ps.shaderResources.views[StartSlot + i].ref();
|
StartSlot, NumViews, ppShaderResourceViews);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2640,8 +2640,8 @@ namespace dxvk {
|
|||||||
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumViews; i++)
|
GetShaderResources(m_state.cs.shaderResources,
|
||||||
ppShaderResourceViews[i] = m_state.cs.shaderResources.views[StartSlot + i].ref();
|
StartSlot, NumViews, ppShaderResourceViews);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3798,6 +3798,19 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void D3D11DeviceContext::GetShaderResources(
|
||||||
|
const D3D11ShaderResourceBindings& Bindings,
|
||||||
|
UINT StartSlot,
|
||||||
|
UINT NumViews,
|
||||||
|
ID3D11ShaderResourceView** ppShaderResourceViews) {
|
||||||
|
for (uint32_t i = 0; i < NumViews; i++) {
|
||||||
|
ppShaderResourceViews[i] = StartSlot + i < Bindings.views.size()
|
||||||
|
? Bindings.views[StartSlot + i].ref()
|
||||||
|
: nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void D3D11DeviceContext::GetSamplers(
|
void D3D11DeviceContext::GetSamplers(
|
||||||
const D3D11SamplerBindings& Bindings,
|
const D3D11SamplerBindings& Bindings,
|
||||||
UINT StartSlot,
|
UINT StartSlot,
|
||||||
|
@ -830,6 +830,12 @@ namespace dxvk {
|
|||||||
UINT* pFirstConstant,
|
UINT* pFirstConstant,
|
||||||
UINT* pNumConstants);
|
UINT* pNumConstants);
|
||||||
|
|
||||||
|
void GetShaderResources(
|
||||||
|
const D3D11ShaderResourceBindings& Bindings,
|
||||||
|
UINT StartSlot,
|
||||||
|
UINT NumViews,
|
||||||
|
ID3D11ShaderResourceView** ppShaderResourceViews);
|
||||||
|
|
||||||
void GetSamplers(
|
void GetSamplers(
|
||||||
const D3D11SamplerBindings& Bindings,
|
const D3D11SamplerBindings& Bindings,
|
||||||
UINT StartSlot,
|
UINT StartSlot,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user