Skip to content

Commit

Permalink
[d3d8] Use unsigned values to identify remapped sampler states
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterSnowfall authored and doitsujin committed Nov 16, 2024
1 parent 482e758 commit ce1b06d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/d3d8/d3d8_d3d9_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ namespace dxvk {
}

// If this D3DTEXTURESTAGESTATETYPE has been remapped to a d3d9::D3DSAMPLERSTATETYPE
// it will be returned, otherwise returns -1
// it will be returned, otherwise returns -1u
inline d3d9::D3DSAMPLERSTATETYPE GetSamplerStateType9(const D3DTEXTURESTAGESTATETYPE StageType) {
switch (StageType) {
// 13-21:
Expand All @@ -169,11 +169,11 @@ namespace dxvk {
case D3DTSS_MINFILTER: return d3d9::D3DSAMP_MINFILTER;
case D3DTSS_MIPFILTER: return d3d9::D3DSAMP_MIPFILTER;
case D3DTSS_MIPMAPLODBIAS: return d3d9::D3DSAMP_MIPMAPLODBIAS;
case D3DTSS_MAXMIPLEVEL: return d3d9::D3DSAMP_MIPFILTER;
case D3DTSS_MAXMIPLEVEL: return d3d9::D3DSAMP_MAXMIPLEVEL;
case D3DTSS_MAXANISOTROPY: return d3d9::D3DSAMP_MAXANISOTROPY;
// 25:
case D3DTSS_ADDRESSW: return d3d9::D3DSAMP_ADDRESSW;
default: return d3d9::D3DSAMPLERSTATETYPE(-1);
default: return d3d9::D3DSAMPLERSTATETYPE(-1u);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/d3d8/d3d8_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ namespace dxvk {
DWORD* pValue) {
d3d9::D3DSAMPLERSTATETYPE stateType = GetSamplerStateType9(Type);

if (stateType != -1) {
if (stateType != -1u) {
// if the type has been remapped to a sampler state type:
return GetD3D9()->GetSamplerState(Stage, stateType, pValue);
}
Expand All @@ -1298,7 +1298,7 @@ namespace dxvk {
d3d9::D3DSAMPLERSTATETYPE stateType = GetSamplerStateType9(Type);

StateChange();
if (stateType != -1) {
if (stateType != -1u) {
// if the type has been remapped to a sampler state type:
return GetD3D9()->SetSamplerState(Stage, stateType, Value);
} else {
Expand Down

0 comments on commit ce1b06d

Please sign in to comment.