From 4686f610b18a04bc6213ccadf7be1176bbda3e34 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 31 Jan 2014 17:23:11 -0700 Subject: svga: refactor some shader code Put common code in new svga_shader.c file. Considate separate vertex/ fragment shader ID generation. Reviewed-by: Jose Fonseca --- src/gallium/drivers/svga/svga_pipe_vs.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/gallium/drivers/svga/svga_pipe_vs.c') diff --git a/src/gallium/drivers/svga/svga_pipe_vs.c b/src/gallium/drivers/svga/svga_pipe_vs.c index fd132ebf280..c3ac663b4a2 100644 --- a/src/gallium/drivers/svga/svga_pipe_vs.c +++ b/src/gallium/drivers/svga/svga_pipe_vs.c @@ -36,6 +36,7 @@ #include "svga_hw_reg.h" #include "svga_cmd.h" #include "svga_debug.h" +#include "svga_shader.h" /** @@ -158,17 +159,8 @@ svga_delete_vs_state(struct pipe_context *pipe, void *shader) for (variant = vs->base.variants; variant; variant = tmp) { tmp = variant->next; - ret = SVGA3D_DestroyShader(svga->swc, variant->id, SVGA3D_SHADERTYPE_VS); - if (ret != PIPE_OK) { - svga_context_flush(svga, NULL); - ret = SVGA3D_DestroyShader(svga->swc, variant->id, - SVGA3D_SHADERTYPE_VS); - assert(ret == PIPE_OK); - } - - util_bitmask_clear(svga->vs_bm, variant->id); - - svga_destroy_shader_variant(variant); + ret = svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_VS, variant); + (void) ret; /* PIPE_ERROR_ not handled yet */ /* * Remove stale references to this variant to ensure a new variant on the -- cgit v1.2.3