diff options
Diffstat (limited to 'src/gallium/state_trackers/vega')
-rw-r--r-- | src/gallium/state_trackers/vega/Makefile | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/SConscript | 84 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/api_context.c | 7 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/api_filters.c | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/api_images.c | 18 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/api_masks.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/api_paint.c | 1 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/api_path.c | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/api_text.c | 1 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/image.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/paint.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/polygon.c | 1 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/renderer.c | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/shaders_cache.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/vg_context.c | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/vg_manager.c | 1 |
16 files changed, 67 insertions, 71 deletions
diff --git a/src/gallium/state_trackers/vega/Makefile b/src/gallium/state_trackers/vega/Makefile index e0a87151c4..0543fac094 100644 --- a/src/gallium/state_trackers/vega/Makefile +++ b/src/gallium/state_trackers/vega/Makefile @@ -9,6 +9,9 @@ LIBRARY_INCLUDES = \ -I$(TOP)/include \ -I$(TOP)/src/mapi +LIBRARY_DEFINES = \ + -DVEGA_VERSION_STRING=\"$(MESA_VERSION)\" + C_SOURCES = \ api.c \ api_context.c \ diff --git a/src/gallium/state_trackers/vega/SConscript b/src/gallium/state_trackers/vega/SConscript index 548053eb64..a62783ab18 100644 --- a/src/gallium/state_trackers/vega/SConscript +++ b/src/gallium/state_trackers/vega/SConscript @@ -3,49 +3,51 @@ Import('*') -if 'egl' in env['statetrackers']: +env = env.Clone() - env = env.Clone() +env.Append(CPPPATH = [ + '#/src/mapi', +]) +env.Append(CPPDEFINES = [ + 'VEGA_VERSION_STRING=', +]) - env.Append(CPPPATH = [ - '#/src/mapi', - ]) +vega_sources = [ + 'api.c', + 'api_context.c', + 'api_filters.c', + 'api_images.c', + 'api_masks.c', + 'api_misc.c', + 'api_paint.c', + 'api_params.c', + 'api_path.c', + 'api_text.c', + 'api_transform.c', + 'vgu.c', + 'vg_context.c', + 'vg_manager.c', + 'vg_state.c', + 'vg_translate.c', + 'polygon.c', + 'bezier.c', + 'path.c', + 'paint.c', + 'arc.c', + 'image.c', + 'renderer.c', + 'stroker.c', + 'mask.c', + 'shader.c', + 'shaders_cache.c', +] - vega_sources = [ - 'api.c', - 'api_context.c', - 'api_filters.c', - 'api_images.c', - 'api_masks.c', - 'api_misc.c', - 'api_paint.c', - 'api_params.c', - 'api_path.c', - 'api_text.c', - 'api_transform.c', - 'vgu.c', - 'vg_context.c', - 'vg_manager.c', - 'vg_state.c', - 'vg_translate.c', - 'polygon.c', - 'bezier.c', - 'path.c', - 'paint.c', - 'arc.c', - 'image.c', - 'renderer.c', - 'stroker.c', - 'mask.c', - 'shader.c', - 'shaders_cache.c', - ] +# vgapi_header must be generated first +env.Depends(vega_sources, vgapi_header) - # vgapi_header must be generated first - env.Depends(vega_sources, vgapi_header) +st_vega = env.ConvenienceLibrary( + target = 'st_vega', + source = vega_sources, +) - st_vega = env.ConvenienceLibrary( - target = 'st_vega', - source = vega_sources, - ) - Export('st_vega') +Export('st_vega') diff --git a/src/gallium/state_trackers/vega/api_context.c b/src/gallium/state_trackers/vega/api_context.c index 0d04d8e871..d6bbda5e07 100644 --- a/src/gallium/state_trackers/vega/api_context.c +++ b/src/gallium/state_trackers/vega/api_context.c @@ -73,7 +73,8 @@ void vegaFinish(void) pipe = ctx->pipe; pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence); - - pipe->screen->fence_finish(pipe->screen, fence, 0); - pipe->screen->fence_reference(pipe->screen, &fence, NULL); + if (fence) { + pipe->screen->fence_finish(pipe->screen, fence, 0); + pipe->screen->fence_reference(pipe->screen, &fence, NULL); + } } diff --git a/src/gallium/state_trackers/vega/api_filters.c b/src/gallium/state_trackers/vega/api_filters.c index 8ace985336..fa1e00d1f8 100644 --- a/src/gallium/state_trackers/vega/api_filters.c +++ b/src/gallium/state_trackers/vega/api_filters.c @@ -37,10 +37,8 @@ #include "pipe/p_state.h" #include "util/u_inlines.h" #include "pipe/p_screen.h" -#include "pipe/p_shader_tokens.h" #include "util/u_format.h" -#include "util/u_memory.h" #include "util/u_sampler.h" #include "util/u_string.h" @@ -798,6 +796,8 @@ void vegaLookupSingle(VGImage dst, VGImage src, return; } + vg_validate_state(ctx); + for (i = 0; i < 256; ++i) { VGuint rgba = lookupTable[i]; VGubyte blue, green, red, alpha; diff --git a/src/gallium/state_trackers/vega/api_images.c b/src/gallium/state_trackers/vega/api_images.c index c36b3d2f3c..e9f038c5f9 100644 --- a/src/gallium/state_trackers/vega/api_images.c +++ b/src/gallium/state_trackers/vega/api_images.c @@ -36,9 +36,8 @@ #include "pipe/p_context.h" #include "pipe/p_screen.h" #include "util/u_inlines.h" -#include "util/u_blit.h" #include "util/u_tile.h" -#include "util/u_memory.h" +#include "util/u_math.h" static INLINE VGboolean supported_image_format(VGImageFormat format) { @@ -404,7 +403,6 @@ void vegaReadPixels(void * data, VGint dataStride, VGfloat temp[VEGA_MAX_IMAGE_WIDTH][4]; VGfloat *df = (VGfloat*)temp; - VGint y = (fb->height - sy) - 1, yStep = -1; VGint i; VGubyte *dst = (VGubyte *)data; VGint xoffset = 0, yoffset = 0; @@ -432,18 +430,26 @@ void vegaReadPixels(void * data, VGint dataStride, } if (sy < 0) { yoffset = -sy; + yoffset *= dataStride; height += sy; sy = 0; - y = (fb->height - sy) - 1; - yoffset *= dataStride; + } + + if (sx + width > fb->width || sy + height > fb->height) { + width = fb->width - sx; + height = fb->height - sy; + /* nothing to read */ + if (width <= 0 || height <= 0) + return; } { + VGint y = (fb->height - sy) - 1, yStep = -1; struct pipe_transfer *transfer; transfer = pipe_get_transfer(pipe, strb->texture, 0, 0, 0, PIPE_TRANSFER_READ, - 0, 0, width, height); + 0, 0, sx + width, fb->height - sy); /* Do a row at a time to flip image data vertically */ for (i = 0; i < height; i++) { diff --git a/src/gallium/state_trackers/vega/api_masks.c b/src/gallium/state_trackers/vega/api_masks.c index 94c1ff5375..189390ec2d 100644 --- a/src/gallium/state_trackers/vega/api_masks.c +++ b/src/gallium/state_trackers/vega/api_masks.c @@ -27,7 +27,6 @@ #include "VG/openvg.h" #include "mask.h" -#include "renderer.h" #include "api.h" #include "vg_context.h" @@ -36,7 +35,6 @@ #include "util/u_pack_color.h" #include "util/u_draw_quad.h" -#include "util/u_memory.h" #define DISABLE_1_1_MASKING 1 diff --git a/src/gallium/state_trackers/vega/api_paint.c b/src/gallium/state_trackers/vega/api_paint.c index d88341b04f..1411806455 100644 --- a/src/gallium/state_trackers/vega/api_paint.c +++ b/src/gallium/state_trackers/vega/api_paint.c @@ -28,7 +28,6 @@ #include "vg_context.h" #include "paint.h" -#include "image.h" #include "api.h" VGPaint vegaCreatePaint(void) diff --git a/src/gallium/state_trackers/vega/api_path.c b/src/gallium/state_trackers/vega/api_path.c index 6c9a2e8d65..f76adddb58 100644 --- a/src/gallium/state_trackers/vega/api_path.c +++ b/src/gallium/state_trackers/vega/api_path.c @@ -28,13 +28,9 @@ #include "vg_context.h" #include "path.h" -#include "polygon.h" -#include "paint.h" #include "api.h" #include "pipe/p_context.h" -#include "util/u_inlines.h" -#include "util/u_draw_quad.h" VGPath vegaCreatePath(VGint pathFormat, VGPathDatatype datatype, diff --git a/src/gallium/state_trackers/vega/api_text.c b/src/gallium/state_trackers/vega/api_text.c index b35f3be90a..2a62da0a1d 100644 --- a/src/gallium/state_trackers/vega/api_text.c +++ b/src/gallium/state_trackers/vega/api_text.c @@ -27,7 +27,6 @@ #include "VG/openvg.h" #include "vg_context.h" -#include "api.h" #include "util/u_memory.h" diff --git a/src/gallium/state_trackers/vega/image.c b/src/gallium/state_trackers/vega/image.c index c12dc71b86..28bbe420a2 100644 --- a/src/gallium/state_trackers/vega/image.c +++ b/src/gallium/state_trackers/vega/image.c @@ -32,13 +32,11 @@ #include "renderer.h" #include "util_array.h" #include "api_consts.h" -#include "shaders_cache.h" #include "shader.h" #include "pipe/p_context.h" #include "pipe/p_screen.h" #include "util/u_inlines.h" -#include "util/u_blit.h" #include "util/u_format.h" #include "util/u_tile.h" #include "util/u_memory.h" diff --git a/src/gallium/state_trackers/vega/paint.c b/src/gallium/state_trackers/vega/paint.c index 2c0eb6b23d..c0c8cddabe 100644 --- a/src/gallium/state_trackers/vega/paint.c +++ b/src/gallium/state_trackers/vega/paint.c @@ -26,7 +26,6 @@ #include "paint.h" -#include "shaders_cache.h" #include "matrix.h" #include "image.h" #include "st_inlines.h" @@ -34,7 +33,6 @@ #include "pipe/p_compiler.h" #include "util/u_inlines.h" -#include "util/u_format.h" #include "util/u_memory.h" #include "util/u_math.h" #include "util/u_sampler.h" diff --git a/src/gallium/state_trackers/vega/polygon.c b/src/gallium/state_trackers/vega/polygon.c index bc94170eb9..ca8831064c 100644 --- a/src/gallium/state_trackers/vega/polygon.c +++ b/src/gallium/state_trackers/vega/polygon.c @@ -29,7 +29,6 @@ #include "matrix.h" /*for floatsEqual*/ #include "vg_context.h" #include "vg_state.h" -#include "paint.h" #include "renderer.h" #include "util_array.h" #include "VG/openvg.h" diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c index 8c023044c4..c6f5f7a05b 100644 --- a/src/gallium/state_trackers/vega/renderer.c +++ b/src/gallium/state_trackers/vega/renderer.c @@ -35,12 +35,9 @@ #include "pipe/p_shader_tokens.h" #include "util/u_draw_quad.h" -#include "util/u_format.h" #include "util/u_simple_shaders.h" #include "util/u_memory.h" -#include "util/u_rect.h" #include "util/u_sampler.h" -#include "util/u_surface.h" #include "cso_cache/cso_context.h" diff --git a/src/gallium/state_trackers/vega/shaders_cache.c b/src/gallium/state_trackers/vega/shaders_cache.c index 53e6bfcf16..e002a7ed42 100644 --- a/src/gallium/state_trackers/vega/shaders_cache.c +++ b/src/gallium/state_trackers/vega/shaders_cache.c @@ -30,8 +30,6 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "util/u_inlines.h" -#include "pipe/p_screen.h" #include "pipe/p_shader_tokens.h" #include "tgsi/tgsi_build.h" diff --git a/src/gallium/state_trackers/vega/vg_context.c b/src/gallium/state_trackers/vega/vg_context.c index 5cb2590602..99e444affd 100644 --- a/src/gallium/state_trackers/vega/vg_context.c +++ b/src/gallium/state_trackers/vega/vg_context.c @@ -37,7 +37,6 @@ #include "pipe/p_context.h" #include "util/u_inlines.h" -#include "pipe/p_shader_tokens.h" #include "cso_cache/cso_context.h" @@ -128,6 +127,7 @@ struct vg_context * vg_create_context(struct pipe_context *pipe, ctx->mask.sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE; ctx->mask.sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE; + ctx->mask.sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE; ctx->mask.sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE; ctx->mask.sampler.min_img_filter = PIPE_TEX_FILTER_NEAREST; ctx->mask.sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST; @@ -135,6 +135,7 @@ struct vg_context * vg_create_context(struct pipe_context *pipe, ctx->blend_sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE; ctx->blend_sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE; + ctx->blend_sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE; ctx->blend_sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE; ctx->blend_sampler.min_img_filter = PIPE_TEX_FILTER_NEAREST; ctx->blend_sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST; diff --git a/src/gallium/state_trackers/vega/vg_manager.c b/src/gallium/state_trackers/vega/vg_manager.c index 232deefa16..bb15ec024f 100644 --- a/src/gallium/state_trackers/vega/vg_manager.c +++ b/src/gallium/state_trackers/vega/vg_manager.c @@ -535,6 +535,7 @@ vg_api_destroy(struct st_api *stapi) } static const struct st_api vg_api = { + "Vega " VEGA_VERSION_STRING, ST_API_OPENVG, ST_PROFILE_DEFAULT_MASK, vg_api_destroy, |