diff options
author | Younes Manton <[email protected]> | 2008-06-16 23:18:20 -0400 |
---|---|---|
committer | Younes Manton <[email protected]> | 2008-06-30 10:11:02 -0400 |
commit | 14d4f9e44e55e2b427579ed6788e579d70b289e7 (patch) | |
tree | 7ee97f5553a2b074dd3b26ad20f5ae4ca147eb8a /src/gallium/state_trackers/g3dvl | |
parent | c6ddcc10e31f26d17c1c8181013268766aca9ac6 (diff) |
g3dvl: Get rid of some Valgrind errors.
Get rid of some Valgrind memory leak and uninitialized var errors.
Diffstat (limited to 'src/gallium/state_trackers/g3dvl')
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_context.c | 24 | ||||
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_surface.c | 1 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/g3dvl/vl_context.c b/src/gallium/state_trackers/g3dvl/vl_context.c index 2d1d5434955..59a1ccd152b 100644 --- a/src/gallium/state_trackers/g3dvl/vl_context.c +++ b/src/gallium/state_trackers/g3dvl/vl_context.c @@ -209,6 +209,8 @@ static int vlCreateVertexShaderIMC(struct VL_CONTEXT *context) context->states.mc.i_vs = pipe->create_vs_state(pipe, &vs); + free(tokens); + return 0; } @@ -346,6 +348,8 @@ static int vlCreateFragmentShaderIMC(struct VL_CONTEXT *context) context->states.mc.i_fs = pipe->create_fs_state(pipe, &fs); + free(tokens); + return 0; } @@ -558,6 +562,8 @@ static int vlCreateVertexShaderPMC(struct VL_CONTEXT *context) context->states.mc.p_vs = pipe->create_vs_state(pipe, &vs); + free(tokens); + return 0; } @@ -833,6 +839,8 @@ static int vlCreateFragmentShaderPMC(struct VL_CONTEXT *context) context->states.mc.p_fs = pipe->create_fs_state(pipe, &fs); + free(tokens); + return 0; } @@ -1051,6 +1059,8 @@ static int vlCreateVertexShaderBMC(struct VL_CONTEXT *context) context->states.mc.b_vs = pipe->create_vs_state(pipe, &vs); + free(tokens); + return 0; } @@ -1349,6 +1359,8 @@ static int vlCreateFragmentShaderBMC(struct VL_CONTEXT *context) context->states.mc.b_fs = pipe->create_fs_state(pipe, &fs); + free(tokens); + return 0; } @@ -1502,7 +1514,7 @@ static int vlInitMC(struct VL_CONTEXT *context) /*sampler.prefilter = ;*/ /*sampler.shadow_ambient = ;*/ /*sampler.lod_bias = ;*/ - /*sampler.min_lod = ;*/ + sampler.min_lod = 0; /*sampler.max_lod = ;*/ /*sampler.border_color[i] = ;*/ /*sampler.max_anisotropy = ;*/ @@ -1692,6 +1704,8 @@ static int vlCreateVertexShaderCSC(struct VL_CONTEXT *context) context->states.csc.vertex_shader = pipe->create_vs_state(pipe, &vs); + free(tokens); + return 0; } @@ -1880,6 +1894,8 @@ static int vlCreateFragmentShaderCSC(struct VL_CONTEXT *context) context->states.csc.fragment_shader = pipe->create_fs_state(pipe, &fs); + free(tokens); + return 0; } @@ -2052,6 +2068,7 @@ static int vlInitCommon(struct VL_CONTEXT *context) pipe = context->pipe; rast.flatshade = 1; + rast.flatshade_first = 0; rast.light_twoside = 0; rast.front_winding = PIPE_WINDING_CCW; rast.cull_mode = PIPE_WINDING_CW; @@ -2061,6 +2078,7 @@ static int vlInitCommon(struct VL_CONTEXT *context) rast.offset_ccw = 0; rast.scissor = 0; rast.poly_smooth = 0; + rast.poly_stipple_enable = 0; rast.point_sprite = 0; rast.point_size_per_vertex = 0; rast.multisample = 0; @@ -2074,6 +2092,7 @@ static int vlInitCommon(struct VL_CONTEXT *context) rast.bypass_vs = 0; rast.origin_lower_left = 0; rast.line_width = 1; + rast.point_smooth = 0; rast.point_size = 1; rast.offset_units = 1; rast.offset_scale = 1; @@ -2199,6 +2218,9 @@ int vlDestroyContext(struct VL_CONTEXT *context) vlDestroy(context); + context->pipe->screen->destroy(context->pipe->screen); + context->pipe->destroy(context->pipe); + free(context); return 0; diff --git a/src/gallium/state_trackers/g3dvl/vl_surface.c b/src/gallium/state_trackers/g3dvl/vl_surface.c index 0e1adea4729..3f59d0f1551 100644 --- a/src/gallium/state_trackers/g3dvl/vl_surface.c +++ b/src/gallium/state_trackers/g3dvl/vl_surface.c @@ -195,6 +195,7 @@ int vlCreateSurface(struct VL_CONTEXT *context, struct VL_SURFACE **surface) template.depth[0] = 1; template.compressed = 0; template.cpp = 4; + template.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER | PIPE_TEXTURE_USAGE_RENDER_TARGET; sfc->texture = pipe->screen->texture_create(pipe->screen, &template); |