#include "i915_screen.h"
-
/***********************************************************************
* Update framebuffer state
*/
{
switch (format) {
case PIPE_FORMAT_B8G8R8A8_UNORM:
+ case PIPE_FORMAT_B8G8R8A8_SRGB:
case PIPE_FORMAT_B8G8R8X8_UNORM:
case PIPE_FORMAT_R8G8B8A8_UNORM:
case PIPE_FORMAT_R8G8B8X8_UNORM:
i915->static_dirty |= I915_DST_RECT;
}
- /* we also send a new program to make sure the fixup for RGBA surfaces happens */
- i915->hardware_dirty |= I915_HW_STATIC | I915_HW_PROGRAM;
+ i915->hardware_dirty |= I915_HW_STATIC;
/* flush the cache in case we sample from the old renderbuffers */
i915_set_flush_dirty(i915, I915_FLUSH_CACHE);
I915_NEW_FRAMEBUFFER
};
-static const struct
+static uint32_t need_target_fixup(struct pipe_surface* p, uint32_t *fixup)
{
- enum pipe_format format;
- uint hw_swizzle;
-} fixup_formats[] = {
- { PIPE_FORMAT_R8G8B8A8_UNORM, 0x21030000 /* BGRA */},
- { PIPE_FORMAT_R8G8B8X8_UNORM, 0x21030000 /* BGRX */},
- { PIPE_FORMAT_L8_UNORM, 0x00030000 /* RRRA */},
- { PIPE_FORMAT_I8_UNORM, 0x00030000 /* RRRA */},
- { PIPE_FORMAT_A8_UNORM, 0x33330000 /* AAAA */},
- { PIPE_FORMAT_NONE, 0x00000000},
-};
+ const struct
+ {
+ enum pipe_format format;
+ uint hw_swizzle;
+ } fixup_formats[] = {
+ { PIPE_FORMAT_R8G8B8A8_UNORM, 0x21030000 /* BGRA */},
+ { PIPE_FORMAT_R8G8B8X8_UNORM, 0x21030000 /* BGRX */},
+ { PIPE_FORMAT_L8_UNORM, 0x00030000 /* RRRA */},
+ { PIPE_FORMAT_I8_UNORM, 0x00030000 /* RRRA */},
+ { PIPE_FORMAT_A8_UNORM, 0x33330000 /* AAAA */},
+ { PIPE_FORMAT_NONE, 0x00000000},
+ };
-static uint need_target_fixup(struct pipe_surface* p, uint32_t *fixup)
-{
enum pipe_format f;
/* if we don't have a surface bound yet, we don't need to fixup the shader */
if (!p)
return 0;
f = p->format;
- for(int i=0; fixup_formats[i].format != PIPE_FORMAT_NONE; i++)
+ for(int i = 0; fixup_formats[i].format != PIPE_FORMAT_NONE; i++)
if (fixup_formats[i].format == f) {
*fixup = fixup_formats[i].hw_swizzle;
- return 1;
+ return f;
}
*fixup = 0;
}
need_fixup = need_target_fixup(cbuf_surface, &fixup);
- if (i915->current.need_target_fixup != need_fixup ||
+ if (i915->current.target_fixup_format != need_fixup ||
i915->current.fixup_swizzle != fixup) {
- i915->current.need_target_fixup = need_fixup;
+ i915->current.target_fixup_format = need_fixup;
i915->current.fixup_swizzle = fixup;
+ /* we also send a new program to make sure the fixup for RGBA surfaces happens */
i915->hardware_dirty |= I915_HW_PROGRAM;
}
}