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;
|
||||
}
|
||||
|
||||
stage.TextureBound = m_state.textures[idx] != nullptr ? 1 : 0;
|
||||
|
||||
stage.ColorOp = data[DXVK_TSS_COLOROP];
|
||||
stage.AlphaOp = data[DXVK_TSS_ALPHAOP];
|
||||
|
||||
|
@ -1545,9 +1545,11 @@ namespace dxvk {
|
||||
uint32_t current = diffuse;
|
||||
// Temp starts off as equal to vec4(0)
|
||||
uint32_t temp = m_module.constvec4f32(0.0f, 0.0f, 0.0f, 0.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++) {
|
||||
const auto& stage = m_fsKey.Stages[i].Contents;
|
||||
|
||||
@ -1706,7 +1708,11 @@ namespace dxvk {
|
||||
reg = temp;
|
||||
break;
|
||||
case D3DTA_TEXTURE:
|
||||
reg = GetTexture();
|
||||
if (stage.TextureBound != 0) {
|
||||
reg = GetTexture();
|
||||
} else {
|
||||
reg = unboundTextureConstId;
|
||||
}
|
||||
break;
|
||||
case D3DTA_TFACTOR:
|
||||
reg = m_ps.constants.textureFactor;
|
||||
|
@ -150,6 +150,8 @@ namespace dxvk {
|
||||
|
||||
uint32_t ProjectedCount : 3;
|
||||
|
||||
uint32_t TextureBound : 1;
|
||||
|
||||
// Included in here, read from Stage 0 for packing reasons
|
||||
// Affects all stages.
|
||||
uint32_t GlobalSpecularEnable : 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user