radeonsi: add an initial dump_debug_state implementation dumping shaders
[mesa.git] / src / gallium / drivers / svga / svga_sampler_view.c
index efbc13899a4271548bf70b216a70c7c2f9c6ea9d..55dc49f2d2c7e6b98ec29d8acd4e95017042f580 100644 (file)
@@ -103,6 +103,9 @@ svga_get_tex_sampler_view(struct pipe_context *pipe,
    }
 
    sv = CALLOC_STRUCT(svga_sampler_view);
+   if (!sv)
+      return NULL;
+
    pipe_reference_init(&sv->reference, 1);
 
    /* Note: we're not refcounting the texture resource here to avoid
@@ -147,7 +150,6 @@ svga_get_tex_sampler_view(struct pipe_context *pipe,
                                           &sv->key);
 
    if (!sv->handle) {
-      assert(0);
       sv->key.cachable = 0;
       sv->handle = tex->handle;
       debug_reference(&sv->reference,
@@ -188,6 +190,7 @@ svga_validate_sampler_view(struct svga_context *svga, struct svga_sampler_view *
 
    for (i = v->min_lod; i <= v->max_lod; i++) {
       for (k = 0; k < numFaces; k++) {
+         assert(i < Elements(tex->view_age));
          if (v->age < tex->view_age[i])
             svga_texture_copy_handle(svga,
                                      tex->handle, 0, 0, 0, i, k,