summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_state.cpp
diff options
context:
space:
mode:
authorGeorge Kyriazis <[email protected]>2017-02-10 10:24:32 -0600
committerTim Rowley <[email protected]>2017-02-23 16:36:13 -0600
commit669d8f626f64cee1bc74ef7869aac8585b6dcfe6 (patch)
tree981ce7c2e5a1b0c00c65745c71f60ef0f1d1a35d /src/gallium/drivers/swr/swr_state.cpp
parent987d8037cabaafaeba2cb8b82cb7fa7290dc4464 (diff)
swr: add fetch shader cache
For now, the cache key is all of FETCH_COMPILE_STATE. Use new/delete for swr_vertex_element_state, since we have to call the constructors/destructors of the struct elements. Reviewed-by: Bruce Cherniak <[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, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
index f1f4963c259..116f19f1ecf 100644
--- a/src/gallium/drivers/swr/swr_state.cpp
+++ b/src/gallium/drivers/swr/swr_state.cpp
@@ -451,7 +451,7 @@ swr_create_vertex_elements_state(struct pipe_context *pipe,
{
struct swr_vertex_element_state *velems;
assert(num_elements <= PIPE_MAX_ATTRIBS);
- velems = CALLOC_STRUCT(swr_vertex_element_state);
+ velems = new swr_vertex_element_state;
if (velems) {
velems->fsState.bVertexIDOffsetEnable = true;
velems->fsState.numAttribs = num_elements;
@@ -521,8 +521,10 @@ swr_bind_vertex_elements_state(struct pipe_context *pipe, void *velems)
static void
swr_delete_vertex_elements_state(struct pipe_context *pipe, void *velems)
{
+ struct swr_vertex_element_state *swr_velems =
+ (struct swr_vertex_element_state *) velems;
/* XXX Need to destroy fetch shader? */
- FREE(velems);
+ delete swr_velems;
}