summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-07-25 16:13:57 -0700
committerEric Anholt <[email protected]>2017-10-10 10:45:22 -0700
commite6764348564e2f865f382a81eae3ccfbf957d2fd (patch)
tree17e5dbddee4276d247d7df7fef4946ecfc96a8e4 /src/mesa/main
parent087b39a3460e796cee04b754d8cb08251c7a51bc (diff)
mesa: Implement a new GL_MESA_tile_raster_order extension.
The intent is to use this extension on vc4 to allow X11 to do overlapping CopyArea() within a pixmap without first blitting the pixmap to a temporary. With associated glamor patches, improves x11perf -copywinwin100 performance on a Raspberry Pi 3 from ~4700/sec to ~5130/sec, and is an even larger boost to uncomposited window movement performance (most copywinwin100 copies don't overlap). v2: Fix glIsEnabled() on the new enums. v3: Drop the local spec since I'm upstreaming the spec. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.c2
-rw-r--r--src/mesa/main/enable.c39
-rw-r--r--src/mesa/main/extensions_table.h1
-rw-r--r--src/mesa/main/mtypes.h13
4 files changed, 55 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 676103d4778..6d24b93c192 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -867,6 +867,8 @@ init_attrib_groups(struct gl_context *ctx)
return GL_FALSE;
/* Miscellaneous */
+ ctx->TileRasterOrderIncreasingX = GL_TRUE;
+ ctx->TileRasterOrderIncreasingY = GL_TRUE;
ctx->NewState = _NEW_ALL;
ctx->NewDriverState = ~0;
ctx->ErrorValue = GL_NO_ERROR;
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 2e5fb009314..8e99f2504f1 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1040,6 +1040,33 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
}
break;
+ case GL_TILE_RASTER_ORDER_FIXED_MESA:
+ CHECK_EXTENSION(MESA_tile_raster_order, cap);
+ if (ctx->TileRasterOrderFixed != state) {
+ FLUSH_VERTICES(ctx, 0);
+ ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder;
+ ctx->TileRasterOrderFixed = state;
+ }
+ break;
+
+ case GL_TILE_RASTER_ORDER_INCREASING_X_MESA:
+ CHECK_EXTENSION(MESA_tile_raster_order, cap);
+ if (ctx->TileRasterOrderIncreasingX != state) {
+ FLUSH_VERTICES(ctx, 0);
+ ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder;
+ ctx->TileRasterOrderIncreasingX = state;
+ }
+ break;
+
+ case GL_TILE_RASTER_ORDER_INCREASING_Y_MESA:
+ CHECK_EXTENSION(MESA_tile_raster_order, cap);
+ if (ctx->TileRasterOrderIncreasingY != state) {
+ FLUSH_VERTICES(ctx, 0);
+ ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder;
+ ctx->TileRasterOrderIncreasingY = state;
+ }
+ break;
+
/* GL 3.1 primitive restart. Note: this enum is different from
* GL_PRIMITIVE_RESTART_NV (which is client state).
*/
@@ -1716,6 +1743,18 @@ _mesa_IsEnabled( GLenum cap )
CHECK_EXTENSION(INTEL_conservative_rasterization);
return ctx->IntelConservativeRasterization;
+ case GL_TILE_RASTER_ORDER_FIXED_MESA:
+ CHECK_EXTENSION(MESA_tile_raster_order);
+ return ctx->TileRasterOrderFixed;
+
+ case GL_TILE_RASTER_ORDER_INCREASING_X_MESA:
+ CHECK_EXTENSION(MESA_tile_raster_order);
+ return ctx->TileRasterOrderIncreasingX;
+
+ case GL_TILE_RASTER_ORDER_INCREASING_Y_MESA:
+ CHECK_EXTENSION(MESA_tile_raster_order);
+ return ctx->TileRasterOrderIncreasingY;
+
default:
goto invalid_enum_error;
}
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index c1c39f9a16d..a8dab772341 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -314,6 +314,7 @@ EXT(KHR_texture_compression_astc_hdr , KHR_texture_compression_astc_hdr
EXT(KHR_texture_compression_astc_ldr , KHR_texture_compression_astc_ldr , GLL, GLC, x , ES2, 2012)
EXT(KHR_texture_compression_astc_sliced_3d , KHR_texture_compression_astc_sliced_3d , GLL, GLC, x , ES2, 2015)
+EXT(MESA_tile_raster_order , MESA_tile_raster_order , GLL, GLC, x , ES2, 2017)
EXT(MESA_pack_invert , MESA_pack_invert , GLL, GLC, x , x , 2002)
EXT(MESA_shader_integer_functions , MESA_shader_integer_functions , GLL, GLC, x , 30, 2016)
EXT(MESA_texture_signed_rgba , EXT_texture_snorm , GLL, GLC, x , x , 2009)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 455e7514ab9..ea62d0bfb71 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4186,6 +4186,7 @@ struct gl_extensions
GLboolean KHR_texture_compression_astc_hdr;
GLboolean KHR_texture_compression_astc_ldr;
GLboolean KHR_texture_compression_astc_sliced_3d;
+ GLboolean MESA_tile_raster_order;
GLboolean MESA_pack_invert;
GLboolean MESA_shader_framebuffer_fetch;
GLboolean MESA_shader_framebuffer_fetch_non_coherent;
@@ -4437,6 +4438,9 @@ struct gl_driver_flags
/** gl_context::RasterDiscard */
uint64_t NewRasterizerDiscard;
+ /** gl_context::TileRasterOrder* */
+ uint64_t NewTileRasterOrder;
+
/**
* gl_context::UniformBufferBindings
* gl_shader_program::UniformBlocks
@@ -4984,6 +4988,15 @@ struct gl_context
bool _AttribZeroAliasesVertex;
/**
+ * When set, TileRasterOrderIncreasingX/Y control the order that a tiled
+ * renderer's tiles should be excecuted, to meet the requirements of
+ * GL_MESA_tile_raster_order.
+ */
+ GLboolean TileRasterOrderFixed;
+ GLboolean TileRasterOrderIncreasingX;
+ GLboolean TileRasterOrderIncreasingY;
+
+ /**
* \name Hooks for module contexts.
*
* These will eventually live in the driver or elsewhere.