mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 21:40:08 +01:00
st/mesa: always report the max samples as supported
This is required by GL. Doing this even when the backend driver does not support it leads to creating attachments which are not renderable. This is not ideal, but does pass tests. This covers scenarios such as missing MSAA for 128-bit formats on Sandybridge, and missing 8x MSAA on 128-bit formats on NVIDIA Tesla generation boards. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11372>
This commit is contained in:
parent
b14b1bef5d
commit
561f9ae74b
1 changed files with 9 additions and 1 deletions
|
|
@ -1392,6 +1392,7 @@ st_QuerySamplesForFormat(struct gl_context *ctx, GLenum target,
|
|||
struct st_context *st = st_context(ctx);
|
||||
enum pipe_format format;
|
||||
unsigned i, bind, num_sample_counts = 0;
|
||||
unsigned min_max_samples;
|
||||
|
||||
(void) target;
|
||||
|
||||
|
|
@ -1400,6 +1401,13 @@ st_QuerySamplesForFormat(struct gl_context *ctx, GLenum target,
|
|||
else
|
||||
bind = PIPE_BIND_RENDER_TARGET;
|
||||
|
||||
if (_mesa_is_enum_format_integer(internalFormat))
|
||||
min_max_samples = ctx->Const.MaxIntegerSamples;
|
||||
else if (_mesa_is_depth_or_stencil_format(internalFormat))
|
||||
min_max_samples = ctx->Const.MaxDepthTextureSamples;
|
||||
else
|
||||
min_max_samples = ctx->Const.MaxColorTextureSamples;
|
||||
|
||||
/* If an sRGB framebuffer is unsupported, sRGB formats behave like linear
|
||||
* formats.
|
||||
*/
|
||||
|
|
@ -1413,7 +1421,7 @@ st_QuerySamplesForFormat(struct gl_context *ctx, GLenum target,
|
|||
PIPE_TEXTURE_2D, i, i, bind,
|
||||
false, false);
|
||||
|
||||
if (format != PIPE_FORMAT_NONE) {
|
||||
if (format != PIPE_FORMAT_NONE || i == min_max_samples) {
|
||||
samples[num_sample_counts++] = i;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue