Permalink
Browse files

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

…a missing check.
  • Loading branch information...
hrydgard committed Nov 30, 2017
1 parent d032b41 commit d884eeda99d73fd8634543da0a3d47253e7f7bb7
Showing with 9 additions and 4 deletions.
  1. +7 −3 GPU/Directx9/ShaderManagerDX9.cpp
  2. +2 −1 GPU/Vulkan/DepalettizeShaderVulkan.cpp
@@ -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) {
@@ -69,7 +69,8 @@ DepalShaderCacheVulkan::~DepalShaderCacheVulkan() {
void DepalShaderCacheVulkan::DeviceLost() {
Clear();
vulkan_->Delete().QueueDeleteShaderModule(vshader_);
if (vshader_)
vulkan_->Delete().QueueDeleteShaderModule(vshader_);
draw_ = nullptr;
vulkan_ = nullptr;
}

0 comments on commit d884eed

Please sign in to comment.