summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2008-10-01 15:29:04 -0700
committerCarl Worth <cworth@cworth.org>2008-10-01 15:33:04 -0700
commit128223ee9b7880e640056475462eca9a88415492 (patch)
tree2b8dc823249f3056d977dda3c5b52148f1ea7836
parentb7279f1be1b913c1c6ee8ebfb95c97800217a821 (diff)
Add support for RepeatPad and RepeatReflect.
It's quite simple to support these modes---we simply need to turn on the support for them in the hardware. These changes have been verified with the extend-pad and extend-reflect tests in cairo's test suite. However, this currently required using a custom-modified version of cairo. The issue is that released versions of cairo, (and even cairo master so far), don't pass RepeatPad and RepeatReflect to Render, (due to various bugs and workarounds in cairo and pixman). I do plan to fix those issues in cairo, so that in a future release of cairo, (1.8.2 perhaps?), the cairo test suite will usefully test these new repeat modes in our driver.
-rw-r--r--src/i965_render.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/i965_render.c b/src/i965_render.c
index b4a2a73c..498fa1f8 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -209,7 +209,7 @@ static Bool i965_check_composite_texture(PicturePtr pPict, int unit)
I830FALLBACK("Unsupported picture format 0x%x\n",
(int)pPict->format);
- if (pPict->repeat && pPict->repeatType != RepeatNormal)
+ if (pPict->repeat && pPict->repeatType > RepeatReflect)
I830FALLBACK("extended repeat (%d) not supported\n",
pPict->repeatType);
@@ -427,6 +427,8 @@ typedef enum {
typedef enum {
SAMPLER_STATE_EXTEND_NONE,
SAMPLER_STATE_EXTEND_REPEAT,
+ SAMPLER_STATE_EXTEND_PAD,
+ SAMPLER_STATE_EXTEND_REFLECT,
SAMPLER_STATE_EXTEND_COUNT
} sampler_state_extend_t;
@@ -596,6 +598,16 @@ sampler_state_init (struct brw_sampler_state *sampler_state,
sampler_state->ss1.s_wrap_mode = BRW_TEXCOORDMODE_WRAP;
sampler_state->ss1.t_wrap_mode = BRW_TEXCOORDMODE_WRAP;
break;
+ case SAMPLER_STATE_EXTEND_PAD:
+ sampler_state->ss1.r_wrap_mode = BRW_TEXCOORDMODE_CLAMP;
+ sampler_state->ss1.s_wrap_mode = BRW_TEXCOORDMODE_CLAMP;
+ sampler_state->ss1.t_wrap_mode = BRW_TEXCOORDMODE_CLAMP;
+ break;
+ case SAMPLER_STATE_EXTEND_REFLECT:
+ sampler_state->ss1.r_wrap_mode = BRW_TEXCOORDMODE_MIRROR;
+ sampler_state->ss1.s_wrap_mode = BRW_TEXCOORDMODE_MIRROR;
+ sampler_state->ss1.t_wrap_mode = BRW_TEXCOORDMODE_MIRROR;
+ break;
}
assert((default_color_offset & 31) == 0);
@@ -838,6 +850,10 @@ sampler_state_extend_from_picture (int repeat, int repeat_type)
return SAMPLER_STATE_EXTEND_NONE;
case RepeatNormal:
return SAMPLER_STATE_EXTEND_REPEAT;
+ case RepeatPad:
+ return SAMPLER_STATE_EXTEND_PAD;
+ case RepeatReflect:
+ return SAMPLER_STATE_EXTEND_REFLECT;
default:
return -1;
}