summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-01-12 12:02:17 -0800
committerEric Anholt <[email protected]>2018-01-12 21:57:37 -0800
commit8e4c705515c14128e05ccb3bd18aa7aa15232716 (patch)
tree36edabc3212f49fdad2dd1ec9078c0b67e35d37a /src/gallium
parent95873a184e735b37e39ad1ba5ce05391f27b52e2 (diff)
broadcom/vc5: Update pixel center setup for V3D 4.x.
The fxcd/fycd instructions now return half-integer pixel centers when not doing sample-rate shading.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/vc5/vc5_screen.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc5/vc5_screen.c b/src/gallium/drivers/vc5/vc5_screen.c
index 44b5cdebcd6..1e794bc223f 100644
--- a/src/gallium/drivers/vc5/vc5_screen.c
+++ b/src/gallium/drivers/vc5/vc5_screen.c
@@ -82,6 +82,8 @@ vc5_screen_destroy(struct pipe_screen *pscreen)
static int
vc5_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
{
+ struct vc5_screen *screen = vc5_screen(pscreen);
+
switch (param) {
/* Supported features (boolean caps). */
case PIPE_CAP_VERTEX_COLOR_CLAMPED:
@@ -127,11 +129,19 @@ vc5_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return 1;
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
- case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
return 1;
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
- case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
return 0;
+ case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
+ if (screen->devinfo.ver >= 40)
+ return 0;
+ else
+ return 1;
+ case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
+ if (screen->devinfo.ver >= 40)
+ return 1;
+ else
+ return 0;
case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
case PIPE_CAP_MIXED_COLOR_DEPTH_BITS: