mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 12:48:32 +09:00
[Fix] (Diligent/PSO): Avoid adding duplicate shader resources.
This commit is contained in:
@@ -214,7 +214,7 @@ namespace MG_Diligent {
|
||||
PSOKey key{program, currentStateHash};
|
||||
|
||||
auto it = psoCache.find(key);
|
||||
if (it != psoCache.end()) {
|
||||
if (it != psoCache.end() && it->second) {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
@@ -302,6 +302,8 @@ namespace MG_Diligent {
|
||||
|
||||
static std::vector<Diligent::ShaderResourceVariableDesc> Variables;
|
||||
static std::vector<Diligent::ImmutableSamplerDesc> ImmutableSamplers;
|
||||
Variables.clear();
|
||||
ImmutableSamplers.clear();
|
||||
|
||||
MG_Global::unordered_map<GLuint, std::string> shaderSourcesMap;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user