svga: Fix compile_vs error code.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 13 Jan 2010 13:40:09 +0000 (13:40 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 13 Jan 2010 13:40:09 +0000 (13:40 +0000)
It could erroneously return PIPE_OK in some circumstances.

Make compile_fs code identical.

src/gallium/drivers/svga/svga_state_fs.c
src/gallium/drivers/svga/svga_state_vs.c

index 44bb58c9000bde619fbc7101bb33f3f9ddf5ae38..4fe91416778d5298a3fbe050ba984a63945f7619 100644 (file)
@@ -76,8 +76,10 @@ static enum pipe_error compile_fs( struct svga_context *svga,
    }
 
    result->id = util_bitmask_add(svga->fs_bm);
-   if(result->id == UTIL_BITMASK_INVALID_INDEX)
+   if(result->id == UTIL_BITMASK_INVALID_INDEX) {
+      ret = PIPE_ERROR_OUT_OF_MEMORY;
       goto fail;
+   }
 
    ret = SVGA3D_DefineShader(svga->swc, 
                              result->id,
index db30f2735fd1e9bb084fb2add0511ba3fd43ba6f..5e33c127d928e3d2dc915a85bf833b21a13ec41e 100644 (file)
@@ -70,7 +70,7 @@ static enum pipe_error compile_vs( struct svga_context *svga,
                                    struct svga_shader_result **out_result )
 {
    struct svga_shader_result *result;
-   enum pipe_error ret = PIPE_OK;
+   enum pipe_error ret = PIPE_ERROR;
 
    result = svga_translate_vertex_program( vs, key );
    if (result == NULL) {
@@ -79,8 +79,10 @@ static enum pipe_error compile_vs( struct svga_context *svga,
    }
 
    result->id = util_bitmask_add(svga->vs_bm);
-   if(result->id == UTIL_BITMASK_INVALID_INDEX)
+   if(result->id == UTIL_BITMASK_INVALID_INDEX) {
+      ret = PIPE_ERROR_OUT_OF_MEMORY;
       goto fail;
+   }
 
    ret = SVGA3D_DefineShader(svga->swc, 
                              result->id,