DX9: Revert a bad optimization, hopefully fixing #10205. Vulkan: Add a missing check.

This commit is contained in:
Henrik Rydgård 2017-11-30 15:28:15 +01:00
parent d032b41d94
commit d884eeda99
2 changed files with 9 additions and 4 deletions

View File

@ -147,9 +147,13 @@ void ShaderManagerDX9::PSSetColorUniform3(int creg, u32 color) {
}
void ShaderManagerDX9::PSSetColorUniform3Alpha255(int creg, u32 color, u8 alpha) {
float f[4];
Uint8x3ToFloat4_AlphaUint8(f, color, alpha);
device_->SetPixelShaderConstantF(creg, f, 1);
const float col[4] = {
(float)((color & 0xFF)),
(float)((color & 0xFF00) >> 8),
(float)((color & 0xFF0000) >> 16),
(float)alpha,
};
device_->SetPixelShaderConstantF(creg, col, 1);
}
void ShaderManagerDX9::PSSetFloat(int creg, float value) {

View File

@ -69,7 +69,8 @@ DepalShaderCacheVulkan::~DepalShaderCacheVulkan() {
void DepalShaderCacheVulkan::DeviceLost() {
Clear();
vulkan_->Delete().QueueDeleteShaderModule(vshader_);
if (vshader_)
vulkan_->Delete().QueueDeleteShaderModule(vshader_);
draw_ = nullptr;
vulkan_ = nullptr;
}