diff options
author | Eduardo Lima Mitev <elima@igalia.com> | 2015-11-14 12:21:21 +0100 |
---|---|---|
committer | Eduardo Lima Mitev <elima@igalia.com> | 2016-03-03 15:14:05 +0100 |
commit | 2dabff9068a86a070615df587e4e9327b1d1ca6e (patch) | |
tree | 145711b0c6611dd3b64c8a88d146f39effbc49cf /src/mesa/drivers/dri/i965/brw_formatquery.c | |
parent | 28144c4476343a5e2f679ce96ec72cddc5762b04 (diff) | |
download | external_mesa3d-2dabff9068a86a070615df587e4e9327b1d1ca6e.zip external_mesa3d-2dabff9068a86a070615df587e4e9327b1d1ca6e.tar.gz external_mesa3d-2dabff9068a86a070615df587e4e9327b1d1ca6e.tar.bz2 |
i965: Move brw_query_samples_for_format() to brw_queryformat.c
Now that there is a dedicated source file for internal format queries, this
function belongs there.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_formatquery.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_formatquery.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_formatquery.c b/src/mesa/drivers/dri/i965/brw_formatquery.c index ad59f03..5ee1d69 100644 --- a/src/mesa/drivers/dri/i965/brw_formatquery.c +++ b/src/mesa/drivers/dri/i965/brw_formatquery.c @@ -24,6 +24,45 @@ #include "brw_context.h" #include "main/formatquery.h" +size_t +brw_query_samples_for_format(struct gl_context *ctx, GLenum target, + GLenum internalFormat, int samples[16]) +{ + struct brw_context *brw = brw_context(ctx); + + (void) target; + (void) internalFormat; + + switch (brw->gen) { + case 9: + samples[0] = 16; + samples[1] = 8; + samples[2] = 4; + samples[3] = 2; + return 4; + + case 8: + samples[0] = 8; + samples[1] = 4; + samples[2] = 2; + return 3; + + case 7: + samples[0] = 8; + samples[1] = 4; + return 2; + + case 6: + samples[0] = 4; + return 1; + + default: + assert(brw->gen < 6); + samples[0] = 1; + return 1; + } +} + void brw_query_internal_format(struct gl_context *ctx, GLenum target, GLenum internalFormat, GLenum pname, GLint *params) |