mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-04 16:24:29 +01:00
[d3d11] Add range checking to GetSamplers
This commit is contained in:
parent
ef9ad29b7f
commit
65655ce37c
@ -1885,8 +1885,8 @@ namespace dxvk {
|
|||||||
ID3D11SamplerState** ppSamplers) {
|
ID3D11SamplerState** ppSamplers) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumSamplers; i++)
|
GetSamplers(m_state.vs.samplers,
|
||||||
ppSamplers[i] = ref(m_state.vs.samplers[StartSlot + i]);
|
StartSlot, NumSamplers, ppSamplers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2027,8 +2027,8 @@ namespace dxvk {
|
|||||||
ID3D11SamplerState** ppSamplers) {
|
ID3D11SamplerState** ppSamplers) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumSamplers; i++)
|
GetSamplers(m_state.hs.samplers,
|
||||||
ppSamplers[i] = ref(m_state.hs.samplers[StartSlot + i]);
|
StartSlot, NumSamplers, ppSamplers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2169,8 +2169,8 @@ namespace dxvk {
|
|||||||
ID3D11SamplerState** ppSamplers) {
|
ID3D11SamplerState** ppSamplers) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumSamplers; i++)
|
GetSamplers(m_state.ds.samplers,
|
||||||
ppSamplers[i] = ref(m_state.ds.samplers[StartSlot + i]);
|
StartSlot, NumSamplers, ppSamplers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2311,8 +2311,8 @@ namespace dxvk {
|
|||||||
ID3D11SamplerState** ppSamplers) {
|
ID3D11SamplerState** ppSamplers) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumSamplers; i++)
|
GetSamplers(m_state.gs.samplers,
|
||||||
ppSamplers[i] = ref(m_state.gs.samplers[StartSlot + i]);
|
StartSlot, NumSamplers, ppSamplers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2453,8 +2453,8 @@ namespace dxvk {
|
|||||||
ID3D11SamplerState** ppSamplers) {
|
ID3D11SamplerState** ppSamplers) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumSamplers; i++)
|
GetSamplers(m_state.ps.samplers,
|
||||||
ppSamplers[i] = ref(m_state.ps.samplers[StartSlot + i]);
|
StartSlot, NumSamplers, ppSamplers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2651,8 +2651,8 @@ namespace dxvk {
|
|||||||
ID3D11SamplerState** ppSamplers) {
|
ID3D11SamplerState** ppSamplers) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumSamplers; i++)
|
GetSamplers(m_state.cs.samplers,
|
||||||
ppSamplers[i] = ref(m_state.cs.samplers[StartSlot + i]);
|
StartSlot, NumSamplers, ppSamplers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3798,6 +3798,19 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void D3D11DeviceContext::GetSamplers(
|
||||||
|
const D3D11SamplerBindings& Bindings,
|
||||||
|
UINT StartSlot,
|
||||||
|
UINT NumSamplers,
|
||||||
|
ID3D11SamplerState** ppSamplers) {
|
||||||
|
for (uint32_t i = 0; i < NumSamplers; i++) {
|
||||||
|
ppSamplers[i] = StartSlot + i < Bindings.size()
|
||||||
|
? ref(Bindings[StartSlot + i])
|
||||||
|
: nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void D3D11DeviceContext::ResetState() {
|
void D3D11DeviceContext::ResetState() {
|
||||||
EmitCs([] (DxvkContext* ctx) {
|
EmitCs([] (DxvkContext* ctx) {
|
||||||
// Reset render targets
|
// Reset render targets
|
||||||
|
@ -830,6 +830,12 @@ namespace dxvk {
|
|||||||
UINT* pFirstConstant,
|
UINT* pFirstConstant,
|
||||||
UINT* pNumConstants);
|
UINT* pNumConstants);
|
||||||
|
|
||||||
|
void GetSamplers(
|
||||||
|
const D3D11SamplerBindings& Bindings,
|
||||||
|
UINT StartSlot,
|
||||||
|
UINT NumSamplers,
|
||||||
|
ID3D11SamplerState** ppSamplers);
|
||||||
|
|
||||||
void ResetState();
|
void ResetState();
|
||||||
|
|
||||||
void RestoreState();
|
void RestoreState();
|
||||||
|
Loading…
Reference in New Issue
Block a user