summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-05-23 22:25:12 -0400
committerMarek Olšák <[email protected]>2018-07-31 18:28:41 -0400
commit8632626c81a09315276d7defa63092247d7fd308 (patch)
treeed5377da2e0d5e3061b333e49651988124c226d8 /src/gallium/state_trackers
parent0caf74bbcdf38914cecffa8772ee9b122b249b78 (diff)
gallium: add pipe_resource::nr_storage_samples, and set it same as nr_samples
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/dri/dri2.c3
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_st.c1
-rw-r--r--src/gallium/state_trackers/nine/buffer9.c1
-rw-r--r--src/gallium/state_trackers/nine/cubetexture9.c1
-rw-r--r--src/gallium/state_trackers/nine/device9.c2
-rw-r--r--src/gallium/state_trackers/nine/surface9.c2
-rw-r--r--src/gallium/state_trackers/nine/swapchain9.c3
-rw-r--r--src/gallium/state_trackers/nine/texture9.c1
-rw-r--r--src/gallium/state_trackers/nine/volume9.c1
-rw-r--r--src/gallium/state_trackers/nine/volumetexture9.c1
-rw-r--r--src/gallium/state_trackers/wgl/stw_st.c1
11 files changed, 16 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 34205853335..9a22e47693b 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -832,6 +832,7 @@ dri2_allocate_textures(struct dri_context *ctx,
templ.bind = drawable->textures[statt]->bind &
~(PIPE_BIND_SCANOUT | PIPE_BIND_SHARED);
templ.nr_samples = drawable->stvis.samples;
+ templ.nr_storage_samples = drawable->stvis.samples;
/* Try to reuse the resource.
* (the other resource parameters should be constant)
@@ -883,10 +884,12 @@ dri2_allocate_textures(struct dri_context *ctx,
if (drawable->stvis.samples > 1) {
templ.nr_samples = drawable->stvis.samples;
+ templ.nr_storage_samples = drawable->stvis.samples;
zsbuf = &drawable->msaa_textures[statt];
}
else {
templ.nr_samples = 0;
+ templ.nr_storage_samples = 0;
zsbuf = &drawable->textures[statt];
}
diff --git a/src/gallium/state_trackers/glx/xlib/xm_st.c b/src/gallium/state_trackers/glx/xlib/xm_st.c
index 9def70fc746..2fa80f4da28 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_st.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_st.c
@@ -136,6 +136,7 @@ xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
templ.array_size = 1;
templ.last_level = 0;
templ.nr_samples = xstfb->stvis.samples;
+ templ.nr_storage_samples = xstfb->stvis.samples;
for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
enum pipe_format format;
diff --git a/src/gallium/state_trackers/nine/buffer9.c b/src/gallium/state_trackers/nine/buffer9.c
index ca4e4380277..69b08e8c10e 100644
--- a/src/gallium/state_trackers/nine/buffer9.c
+++ b/src/gallium/state_trackers/nine/buffer9.c
@@ -121,6 +121,7 @@ NineBuffer9_ctor( struct NineBuffer9 *This,
info->array_size = 1;
info->last_level = 0;
info->nr_samples = 0;
+ info->nr_storage_samples = 0;
hr = NineResource9_ctor(&This->base, pParams, NULL, TRUE,
Type, Pool, Usage);
diff --git a/src/gallium/state_trackers/nine/cubetexture9.c b/src/gallium/state_trackers/nine/cubetexture9.c
index 65251ad2b7e..89821682f8f 100644
--- a/src/gallium/state_trackers/nine/cubetexture9.c
+++ b/src/gallium/state_trackers/nine/cubetexture9.c
@@ -90,6 +90,7 @@ NineCubeTexture9_ctor( struct NineCubeTexture9 *This,
info->last_level = util_logbase2(EdgeLength);
info->array_size = 6;
info->nr_samples = 0;
+ info->nr_storage_samples = 0;
info->bind = PIPE_BIND_SAMPLER_VIEW;
info->usage = PIPE_USAGE_DEFAULT;
info->flags = 0;
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 127f2ae195b..c434efb8bc7 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -3008,7 +3008,7 @@ NineDevice9_ProcessVertices( struct NineDevice9 *This,
templ.bind = PIPE_BIND_STREAM_OUTPUT;
templ.usage = PIPE_USAGE_STREAM;
templ.height0 = templ.depth0 = templ.array_size = 1;
- templ.last_level = templ.nr_samples = 0;
+ templ.last_level = templ.nr_samples = templ.nr_storage_samples = 0;
resource = screen_sw->resource_create(screen_sw, &templ);
if (!resource)
diff --git a/src/gallium/state_trackers/nine/surface9.c b/src/gallium/state_trackers/nine/surface9.c
index d917fa1f868..4c6a6957703 100644
--- a/src/gallium/state_trackers/nine/surface9.c
+++ b/src/gallium/state_trackers/nine/surface9.c
@@ -104,6 +104,7 @@ NineSurface9_ctor( struct NineSurface9 *This,
This->base.info.last_level = 0;
This->base.info.array_size = 1;
This->base.info.nr_samples = multisample_type;
+ This->base.info.nr_storage_samples = multisample_type;
This->base.info.usage = PIPE_USAGE_DEFAULT;
This->base.info.bind = PIPE_BIND_SAMPLER_VIEW; /* StretchRect */
@@ -803,6 +804,7 @@ NineSurface9_SetResourceResize( struct NineSurface9 *This,
This->desc.Width = This->base.info.width0 = resource->width0;
This->desc.Height = This->base.info.height0 = resource->height0;
This->base.info.nr_samples = resource->nr_samples;
+ This->base.info.nr_storage_samples = resource->nr_storage_samples;
This->stride = nine_format_get_stride(This->base.info.format,
This->desc.Width);
diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c
index 7cf5c54bfa8..aa485a6268b 100644
--- a/src/gallium/state_trackers/nine/swapchain9.c
+++ b/src/gallium/state_trackers/nine/swapchain9.c
@@ -307,6 +307,7 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This,
for (i = 0; i < newBufferCount; ++i) {
tmplt.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
tmplt.nr_samples = multisample_type;
+ tmplt.nr_storage_samples = multisample_type;
if (!has_present_buffers)
tmplt.bind |= NINE_BIND_PRESENTBUFFER_FLAGS;
tmplt.format = d3d9_to_pipe_format_checked(This->screen,
@@ -345,6 +346,7 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This,
tmplt.format = PIPE_FORMAT_B8G8R8X8_UNORM;
tmplt.bind = NINE_BIND_PRESENTBUFFER_FLAGS;
tmplt.nr_samples = 0;
+ tmplt.nr_storage_samples = 0;
if (This->actx->linear_framebuffer)
tmplt.bind |= PIPE_BIND_LINEAR;
if (pParams->SwapEffect != D3DSWAPEFFECT_DISCARD)
@@ -361,6 +363,7 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This,
if (pParams->EnableAutoDepthStencil) {
tmplt.bind = d3d9_get_pipe_depth_format_bindings(pParams->AutoDepthStencilFormat);
tmplt.nr_samples = multisample_type;
+ tmplt.nr_storage_samples = multisample_type;
tmplt.format = d3d9_to_pipe_format_checked(This->screen,
pParams->AutoDepthStencilFormat,
PIPE_TEXTURE_2D,
diff --git a/src/gallium/state_trackers/nine/texture9.c b/src/gallium/state_trackers/nine/texture9.c
index 78ca4add4ae..fca5e603230 100644
--- a/src/gallium/state_trackers/nine/texture9.c
+++ b/src/gallium/state_trackers/nine/texture9.c
@@ -131,6 +131,7 @@ NineTexture9_ctor( struct NineTexture9 *This,
info->last_level = util_logbase2(MAX2(Width, Height));
info->array_size = 1;
info->nr_samples = 0;
+ info->nr_storage_samples = 0;
info->bind = PIPE_BIND_SAMPLER_VIEW;
info->usage = PIPE_USAGE_DEFAULT;
info->flags = 0;
diff --git a/src/gallium/state_trackers/nine/volume9.c b/src/gallium/state_trackers/nine/volume9.c
index 62af3e62251..ec811aeba13 100644
--- a/src/gallium/state_trackers/nine/volume9.c
+++ b/src/gallium/state_trackers/nine/volume9.c
@@ -92,6 +92,7 @@ NineVolume9_ctor( struct NineVolume9 *This,
This->info.last_level = 0;
This->info.array_size = 1;
This->info.nr_samples = 0;
+ This->info.nr_storage_samples = 0;
This->info.usage = PIPE_USAGE_DEFAULT;
This->info.bind = PIPE_BIND_SAMPLER_VIEW;
This->info.flags = 0;
diff --git a/src/gallium/state_trackers/nine/volumetexture9.c b/src/gallium/state_trackers/nine/volumetexture9.c
index c836dd21023..5dec4844864 100644
--- a/src/gallium/state_trackers/nine/volumetexture9.c
+++ b/src/gallium/state_trackers/nine/volumetexture9.c
@@ -88,6 +88,7 @@ NineVolumeTexture9_ctor( struct NineVolumeTexture9 *This,
info->last_level = util_logbase2(MAX2(MAX2(Width, Height), Depth));
info->array_size = 1;
info->nr_samples = 0;
+ info->nr_storage_samples = 0;
info->bind = PIPE_BIND_SAMPLER_VIEW;
info->usage = PIPE_USAGE_DEFAULT;
info->flags = 0;
diff --git a/src/gallium/state_trackers/wgl/stw_st.c b/src/gallium/state_trackers/wgl/stw_st.c
index 7cf18f0a8b0..2445c33a293 100644
--- a/src/gallium/state_trackers/wgl/stw_st.c
+++ b/src/gallium/state_trackers/wgl/stw_st.c
@@ -95,6 +95,7 @@ stw_st_framebuffer_validate_locked(struct st_framebuffer_iface *stfb,
templ.array_size = 1;
templ.last_level = 0;
templ.nr_samples = stwfb->stvis.samples;
+ templ.nr_storage_samples = stwfb->stvis.samples;;
for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
enum pipe_format format;