summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-07-01 15:43:19 -0700
committerEric Anholt <[email protected]>2019-07-16 12:51:13 -0700
commit4d23157a8bf5da2f20ad477029fcf59d9df8557e (patch)
tree443ac4dfe62817446c49f5fb2b27c896246593f7 /src/mesa/state_tracker
parent35e2d31ba4218cd55085c97764741eaf2fa3a332 (diff)
mesa: Give _mesa_format_get_color_encoding a clearer name.
It only returned one of two values. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_framebuffer.c2
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c5
-rw-r--r--src/mesa/state_tracker/st_format.c2
3 files changed, 4 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
index 15727fa9d80..4a82c63e8dc 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -146,7 +146,7 @@ st_update_framebuffer_state( struct st_context *st )
if (strb) {
if (strb->is_rtt || (strb->texture &&
- _mesa_get_format_color_encoding(strb->Base.Format) == GL_SRGB)) {
+ _mesa_is_format_srgb(strb->Base.Format))) {
/* rendering to a GL texture, may have to update surface */
st_update_renderbuffer_surface(st, strb);
}
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 5e3425a73a6..bf23f4f3a8d 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -465,7 +465,7 @@ st_update_renderbuffer_surface(struct st_context *st,
* to determine if the rb is sRGB-capable.
*/
boolean enable_srgb = st->ctx->Color.sRGBEnabled &&
- _mesa_get_format_color_encoding(strb->Base.Format) == GL_SRGB;
+ _mesa_is_format_srgb(strb->Base.Format);
enum pipe_format format = resource->format;
if (strb->is_rtt) {
@@ -669,8 +669,7 @@ st_validate_attachment(struct gl_context *ctx,
/* If the encoding is sRGB and sRGB rendering cannot be enabled,
* check for linear format support instead.
* Later when we create a surface, we change the format to a linear one. */
- if (!ctx->Extensions.EXT_sRGB &&
- _mesa_get_format_color_encoding(texFormat) == GL_SRGB) {
+ if (!ctx->Extensions.EXT_sRGB && _mesa_is_format_srgb(texFormat)) {
const mesa_format linearFormat = _mesa_get_srgb_format_linear(texFormat);
format = st_mesa_format_to_pipe_format(st_context(ctx), linearFormat);
}
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 9e6f76739f7..4edb6782473 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -2251,7 +2251,7 @@ st_choose_matching_format(struct st_context *st, unsigned bind,
mesa_format mesa_format;
for (mesa_format = 1; mesa_format < MESA_FORMAT_COUNT; mesa_format++) {
- if (_mesa_get_format_color_encoding(mesa_format) == GL_SRGB) {
+ if (_mesa_is_format_srgb(mesa_format)) {
continue;
}
if (_mesa_get_format_bits(mesa_format, GL_TEXTURE_INTENSITY_SIZE) > 0) {