summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_state.cpp
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-04-20 19:42:16 -0500
committerTim Rowley <[email protected]>2016-04-22 18:05:02 -0500
commitee9621e2f5653cf2dfa8589bd3a57bafb122c6bd (patch)
treea33122ae117b3a96b96bcb9dd19f5151b9b10fd3 /src/gallium/drivers/swr/swr_state.cpp
parent5815c8b3d3b7fe3311ac51533438f24f09768ad6 (diff)
swr: fix memory leaks from vs/fs compilation
v2: varient -> variant Reviewed by: George Kyriazis <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_state.cpp')
-rw-r--r--src/gallium/drivers/swr/swr_state.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
index 4ce2d12a48d..18c4fb23c9b 100644
--- a/src/gallium/drivers/swr/swr_state.cpp
+++ b/src/gallium/drivers/swr/swr_state.cpp
@@ -1030,10 +1030,9 @@ swr_update_derived(struct pipe_context *pipe,
auto search = ctx->vs->map.find(key);
PFN_VERTEX_FUNC func;
if (search != ctx->vs->map.end()) {
- func = search->second;
+ func = search->second->shader;
} else {
func = swr_compile_vs(ctx, key);
- ctx->vs->map.insert(std::make_pair(key, func));
}
SwrSetVertexFunc(ctx->swrContext, func);
@@ -1062,10 +1061,9 @@ swr_update_derived(struct pipe_context *pipe,
auto search = ctx->fs->map.find(key);
PFN_PIXEL_KERNEL func;
if (search != ctx->fs->map.end()) {
- func = search->second;
+ func = search->second->shader;
} else {
func = swr_compile_fs(ctx, key);
- ctx->fs->map.insert(std::make_pair(key, func));
}
SWR_PS_STATE psState = {0};
psState.pfnPixelShader = func;