summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
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/mesa/state_tracker
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/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_copyimage.c7
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c2
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c2
-rw-r--r--src/mesa/state_tracker/st_texture.c1
4 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_cb_copyimage.c b/src/mesa/state_tracker/st_cb_copyimage.c
index f5d8c047800..6d3eda014dc 100644
--- a/src/mesa/state_tracker/st_cb_copyimage.c
+++ b/src/mesa/state_tracker/st_cb_copyimage.c
@@ -360,7 +360,7 @@ same_size_and_swizzle(const struct util_format_description *d1,
static struct pipe_resource *
create_texture(struct pipe_screen *screen, enum pipe_format format,
- unsigned nr_samples,
+ unsigned nr_samples, unsigned nr_storage_samples,
unsigned width, unsigned height, unsigned depth)
{
struct pipe_resource templ;
@@ -372,6 +372,7 @@ create_texture(struct pipe_screen *screen, enum pipe_format format,
templ.depth0 = 1;
templ.array_size = depth;
templ.nr_samples = nr_samples;
+ templ.nr_storage_samples = nr_storage_samples;
templ.usage = PIPE_USAGE_DEFAULT;
templ.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
@@ -443,7 +444,7 @@ handle_complex_copy(struct pipe_context *pipe,
* then proceed the generic swizzled_copy.
*/
temp = create_texture(pipe->screen, canon_format, src->nr_samples,
- src_box->width,
+ src->nr_storage_samples, src_box->width,
src_box->height, src_box->depth);
u_box_3d(0, 0, 0, src_box->width, src_box->height, src_box->depth,
@@ -468,7 +469,7 @@ handle_complex_copy(struct pipe_context *pipe,
/* Use the temporary texture. First, use the generic copy, but use
* a canonical format in the destination. Then convert */
temp = create_texture(pipe->screen, canon_format, dst->nr_samples,
- src_box->width,
+ dst->nr_storage_samples, src_box->width,
src_box->height, src_box->depth);
u_box_3d(0, 0, 0, src_box->width, src_box->height, src_box->depth,
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 698c7046c1a..fb41b7b73cf 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -204,6 +204,8 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
templ.depth0 = 1;
templ.array_size = 1;
templ.nr_samples = rb->NumSamples;
+ templ.nr_storage_samples = rb->NumSamples;
+
if (util_format_is_depth_or_stencil(format)) {
templ.bind = PIPE_BIND_DEPTH_STENCIL;
}
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 56d8c411472..d1f060dc979 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -2791,6 +2791,7 @@ st_texture_create_from_memory(struct st_context *st,
/* only set this for OpenGL textures, not renderbuffers */
pt.flags = PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY;
pt.nr_samples = nr_samples;
+ pt.nr_storage_samples = nr_samples;
newtex = screen->resource_from_memobj(screen, &pt, memObj->memory, offset);
@@ -2956,6 +2957,7 @@ st_TestProxyTexImage(struct gl_context *ctx, GLenum target,
pt.target = gl_target_to_pipe(target);
pt.format = st_mesa_format_to_pipe_format(st, format);
pt.nr_samples = numSamples;
+ pt.nr_storage_samples = numSamples;
st_gl_texture_dims_to_pipe_dims(target,
width, height, depth,
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 7d8303615e9..09314519d48 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -95,6 +95,7 @@ st_texture_create(struct st_context *st,
/* only set this for OpenGL textures, not renderbuffers */
pt.flags = PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY;
pt.nr_samples = nr_samples;
+ pt.nr_storage_samples = nr_samples;
newtex = screen->resource_create(screen, &pt);