mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[d3d9] Handle unbound textures in fixed function shaders
This commit is contained in:
parent
6c5f73ac26
commit
116feca6af
@ -6661,6 +6661,8 @@ namespace dxvk {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage.TextureBound = m_state.textures[idx] != nullptr ? 1 : 0;
|
||||||
|
|
||||||
stage.ColorOp = data[DXVK_TSS_COLOROP];
|
stage.ColorOp = data[DXVK_TSS_COLOROP];
|
||||||
stage.AlphaOp = data[DXVK_TSS_ALPHAOP];
|
stage.AlphaOp = data[DXVK_TSS_ALPHAOP];
|
||||||
|
|
||||||
|
@ -1548,6 +1548,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
uint32_t texture = m_module.constvec4f32(0.0f, 0.0f, 0.0f, 1.0f);
|
uint32_t texture = m_module.constvec4f32(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
|
||||||
|
uint32_t unboundTextureConstId = m_module.constvec4f32(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < caps::TextureStageCount; i++) {
|
for (uint32_t i = 0; i < caps::TextureStageCount; i++) {
|
||||||
const auto& stage = m_fsKey.Stages[i].Contents;
|
const auto& stage = m_fsKey.Stages[i].Contents;
|
||||||
|
|
||||||
@ -1706,7 +1708,11 @@ namespace dxvk {
|
|||||||
reg = temp;
|
reg = temp;
|
||||||
break;
|
break;
|
||||||
case D3DTA_TEXTURE:
|
case D3DTA_TEXTURE:
|
||||||
|
if (stage.TextureBound != 0) {
|
||||||
reg = GetTexture();
|
reg = GetTexture();
|
||||||
|
} else {
|
||||||
|
reg = unboundTextureConstId;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case D3DTA_TFACTOR:
|
case D3DTA_TFACTOR:
|
||||||
reg = m_ps.constants.textureFactor;
|
reg = m_ps.constants.textureFactor;
|
||||||
|
@ -150,6 +150,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
uint32_t ProjectedCount : 3;
|
uint32_t ProjectedCount : 3;
|
||||||
|
|
||||||
|
uint32_t TextureBound : 1;
|
||||||
|
|
||||||
// Included in here, read from Stage 0 for packing reasons
|
// Included in here, read from Stage 0 for packing reasons
|
||||||
// Affects all stages.
|
// Affects all stages.
|
||||||
uint32_t GlobalSpecularEnable : 1;
|
uint32_t GlobalSpecularEnable : 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user