diff options
author | Marek Olšák <[email protected]> | 2018-06-11 15:04:11 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-08-04 02:46:55 -0400 |
commit | 8e3d0019e1b548327ac43a90256d8593f25cc129 (patch) | |
tree | 16240a7da2353edc9bbabf4ddffdc29dc1fdff33 /src | |
parent | 459f05c7ec4b885450acd7e4b64eb4ad8c955c03 (diff) |
st/mesa: pass storage_sample_count parameter into st_choose_format
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 14 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 6 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_format.c | 24 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_format.h | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_texture.c | 2 |
6 files changed, 30 insertions, 22 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 5a331f841de..b8895684bc2 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -535,7 +535,7 @@ make_texture(struct st_context *st, GLenum intFormat = internal_format(ctx, format, type); pipeFormat = st_choose_format(st, intFormat, format, type, - st->internal_target, 0, + st->internal_target, 0, 0, PIPE_BIND_SAMPLER_VIEW, FALSE); assert(pipeFormat != PIPE_FORMAT_NONE); } @@ -1584,7 +1584,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, /* srcFormat is non-renderable. Find a compatible renderable format. */ if (type == GL_DEPTH) { srcFormat = st_choose_format(st, GL_DEPTH_COMPONENT, GL_NONE, - GL_NONE, st->internal_target, 0, + GL_NONE, st->internal_target, 0, 0, srcBind, FALSE); } else { @@ -1592,27 +1592,27 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, if (util_format_is_float(srcFormat)) { srcFormat = st_choose_format(st, GL_RGBA32F, GL_NONE, - GL_NONE, st->internal_target, 0, + GL_NONE, st->internal_target, 0, 0, srcBind, FALSE); } else if (util_format_is_pure_sint(srcFormat)) { srcFormat = st_choose_format(st, GL_RGBA32I, GL_NONE, - GL_NONE, st->internal_target, 0, + GL_NONE, st->internal_target, 0, 0, srcBind, FALSE); } else if (util_format_is_pure_uint(srcFormat)) { srcFormat = st_choose_format(st, GL_RGBA32UI, GL_NONE, - GL_NONE, st->internal_target, 0, + GL_NONE, st->internal_target, 0, 0, srcBind, FALSE); } else if (util_format_is_snorm(srcFormat)) { srcFormat = st_choose_format(st, GL_RGBA16_SNORM, GL_NONE, - GL_NONE, st->internal_target, 0, + GL_NONE, st->internal_target, 0, 0, srcBind, FALSE); } else { srcFormat = st_choose_format(st, GL_RGBA, GL_NONE, - GL_NONE, st->internal_target, 0, + GL_NONE, st->internal_target, 0, 0, srcBind, FALSE); } } diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 2bb910fcecd..811451656ca 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -83,7 +83,7 @@ st_renderbuffer_alloc_sw_storage(struct gl_context * ctx, format = PIPE_FORMAT_R16G16B16A16_SNORM; } else { - format = st_choose_renderbuffer_format(st, internalFormat, 0); + format = st_choose_renderbuffer_format(st, internalFormat, 0, 0); /* Not setting gl_renderbuffer::Format here will cause * FRAMEBUFFER_UNSUPPORTED and ValidateFramebuffer will not be called. @@ -169,7 +169,7 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, } for (i = start; i <= ctx->Const.MaxSamples; i++) { - format = st_choose_renderbuffer_format(st, internalFormat, i); + format = st_choose_renderbuffer_format(st, internalFormat, i, i); if (format != PIPE_FORMAT_NONE) { rb->NumSamples = i; @@ -178,7 +178,7 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, } } } else { - format = st_choose_renderbuffer_format(st, internalFormat, 0); + format = st_choose_renderbuffer_format(st, internalFormat, 0, 0); } /* Not setting gl_renderbuffer::Format here will cause diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 93b6b32b7e2..5406d0247c5 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -2043,7 +2043,7 @@ st_GetTexSubImage(struct gl_context * ctx, } dst_format = st_choose_format(st, dst_glformat, format, type, - pipe_target, 0, bind, FALSE); + pipe_target, 0, 0, bind, FALSE); if (dst_format == PIPE_FORMAT_NONE) { /* unable to get an rgba format!?! */ diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index c2535e85324..16a18c272dc 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -2053,13 +2053,15 @@ find_supported_format(struct pipe_screen *screen, const enum pipe_format formats[], enum pipe_texture_target target, unsigned sample_count, + unsigned storage_sample_count, unsigned bindings, boolean allow_dxt) { uint i; for (i = 0; formats[i]; i++) { if (screen->is_format_supported(screen, formats[i], target, - sample_count, sample_count, bindings)) { + sample_count, storage_sample_count, + bindings)) { if (!allow_dxt && util_format_is_s3tc(formats[i])) { /* we can't return a dxt format, continue searching */ continue; @@ -2164,6 +2166,7 @@ enum pipe_format st_choose_format(struct st_context *st, GLenum internalFormat, GLenum format, GLenum type, enum pipe_texture_target target, unsigned sample_count, + unsigned storage_sample_count, unsigned bindings, boolean allow_dxt) { struct pipe_screen *screen = st->pipe->screen; @@ -2193,7 +2196,7 @@ st_choose_format(struct st_context *st, GLenum internalFormat, pf = find_exact_format(internalFormat, format, type); if (pf != PIPE_FORMAT_NONE && screen->is_format_supported(screen, pf, target, sample_count, - sample_count, bindings)) { + storage_sample_count, bindings)) { goto success; } @@ -2219,7 +2222,8 @@ st_choose_format(struct st_context *st, GLenum internalFormat, * which is supported by the driver. */ pf = find_supported_format(screen, mapping->pipeFormats, - target, sample_count, bindings, + target, sample_count, + storage_sample_count, bindings, allow_dxt); goto success; } @@ -2247,7 +2251,8 @@ success: */ enum pipe_format st_choose_renderbuffer_format(struct st_context *st, - GLenum internalFormat, unsigned sample_count) + GLenum internalFormat, unsigned sample_count, + unsigned storage_sample_count) { unsigned bindings; if (_mesa_is_depth_or_stencil_format(internalFormat)) @@ -2255,7 +2260,8 @@ st_choose_renderbuffer_format(struct st_context *st, else bindings = PIPE_BIND_RENDER_TARGET; return st_choose_format(st, internalFormat, GL_NONE, GL_NONE, - PIPE_TEXTURE_2D, sample_count, bindings, FALSE); + PIPE_TEXTURE_2D, sample_count, + storage_sample_count, bindings, FALSE); } @@ -2387,12 +2393,12 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target, } pFormat = st_choose_format(st, internalFormat, format, type, - pTarget, 0, bindings, GL_TRUE); + pTarget, 0, 0, bindings, GL_TRUE); if (pFormat == PIPE_FORMAT_NONE && !is_renderbuffer) { /* try choosing format again, this time without render target bindings */ pFormat = st_choose_format(st, internalFormat, format, type, - pTarget, 0, PIPE_BIND_SAMPLER_VIEW, + pTarget, 0, 0, PIPE_BIND_SAMPLER_VIEW, GL_TRUE); } @@ -2450,7 +2456,7 @@ st_QuerySamplesForFormat(struct gl_context *ctx, GLenum target, /* Set sample counts in descending order. */ for (i = 16; i > 1; i--) { format = st_choose_format(st, internalFormat, GL_NONE, GL_NONE, - PIPE_TEXTURE_2D, i, bind, FALSE); + PIPE_TEXTURE_2D, i, i, bind, FALSE); if (format != PIPE_FORMAT_NONE) { samples[num_sample_counts++] = i; @@ -2509,7 +2515,7 @@ st_QueryInternalFormat(struct gl_context *ctx, GLenum target, internalFormat, GL_NONE, GL_NONE, - PIPE_TEXTURE_2D, 1, + PIPE_TEXTURE_2D, 0, 0, bindings, FALSE); if (pformat) params[0] = internalFormat; diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h index 466b5d073fc..036d3378286 100644 --- a/src/mesa/state_tracker/st_format.h +++ b/src/mesa/state_tracker/st_format.h @@ -54,11 +54,13 @@ extern enum pipe_format st_choose_format(struct st_context *st, GLenum internalFormat, GLenum format, GLenum type, enum pipe_texture_target target, unsigned sample_count, + unsigned storage_sample_count, unsigned bindings, boolean allow_dxt); extern enum pipe_format st_choose_renderbuffer_format(struct st_context *st, - GLenum internalFormat, unsigned sample_count); + GLenum internalFormat, unsigned sample_count, + unsigned storage_sample_count); extern enum pipe_format st_choose_matching_format(struct st_context *st, unsigned bind, diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 5da98bd338f..9655eede5fe 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -415,7 +415,7 @@ st_create_color_map_texture(struct gl_context *ctx) /* find an RGBA texture format */ format = st_choose_format(st, GL_RGBA, GL_NONE, GL_NONE, - PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW, + PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_SAMPLER_VIEW, FALSE); /* create texture for color map/table */ |