key->cachable = 1;
key->arraySize = 1;
key->numFaces = 1;
- key->sampleCount = tex->b.b.nr_samples;
+
+ /* single sample surface can be treated as non-multisamples surface */
+ key->sampleCount = tex->b.b.nr_samples > 1 ? tex->b.b.nr_samples : 0;
if (key->sampleCount > 1) {
key->flags |= SVGA3D_SURFACE_MASKABLE_ANTIALIAS;
{
enum pipe_error ret = PIPE_OK;
enum pipe_shader_type shader;
- struct pipe_surface *surf = NULL;
assert(svga_have_vgpu10(svga));
+ assert(s);
SVGA_STATS_TIME_PUSH(svga_sws(svga),
SVGA_STATS_TIME_VALIDATESURFACEVIEW);
"same resource used in shaderResource and renderTarget 0x%x\n",
s->handle);
s = create_backed_surface_view(svga, s);
- if (!s)
- goto done;
-
+ /* s may be null here if the function failed */
break;
}
}
- if (s->view_id == SVGA3D_INVALID_ID) {
+ if (s && s->view_id == SVGA3D_INVALID_ID) {
SVGA3dResourceType resType;
SVGA3dRenderTargetViewDesc desc;
if (ret != PIPE_OK) {
util_bitmask_clear(svga->surface_view_id_bm, s->view_id);
s->view_id = SVGA3D_INVALID_ID;
- goto done;
+ s = NULL;
}
}
- surf = &s->base;
-done:
SVGA_STATS_TIME_POP(svga_sws(svga));
- return surf;
+ return s ? &s->base : NULL;
}