svga: if we get nr_samples==1, store nr_samples=0
We need to be more careful not to treat nr_samples=1 as an msaa surface. This patch prevents us from errantly declaring an MSAA shader resource with 1 sample. No Piglit regressions, fixes the above-described errors. Reviewed-by: Neha Bhende <bhenden@vmware.com>
This commit is contained in:
parent
3c71c42827
commit
3e39abf6a0
|
@ -985,13 +985,16 @@ svga_texture_create(struct pipe_screen *screen,
|
|||
tex->key.arraySize = 1;
|
||||
tex->key.numFaces = 1;
|
||||
|
||||
/* single sample texture can be treated as non-multisamples texture */
|
||||
tex->key.sampleCount = template->nr_samples > 1 ? template->nr_samples : 0;
|
||||
|
||||
if (template->nr_samples > 1) {
|
||||
/* nr_samples=1 must be treated as a non-multisample texture */
|
||||
if (tex->b.b.nr_samples == 1) {
|
||||
tex->b.b.nr_samples = 0;
|
||||
}
|
||||
else if (tex->b.b.nr_samples > 1) {
|
||||
tex->key.flags |= SVGA3D_SURFACE_MASKABLE_ANTIALIAS;
|
||||
}
|
||||
|
||||
tex->key.sampleCount = tex->b.b.nr_samples;
|
||||
|
||||
if (svgascreen->sws->have_vgpu10) {
|
||||
switch (template->target) {
|
||||
case PIPE_TEXTURE_1D:
|
||||
|
|
Loading…
Reference in New Issue