softpipe: enable clear_texture with util_clear_texture
authorLars Hamre <chemecse@gmail.com>
Wed, 22 Feb 2017 15:56:43 +0000 (10:56 -0500)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 24 Feb 2017 14:41:13 +0000 (15:41 +0100)
Passes all corresponding piglit tests.

Signed-off-by: Lars Hamre <chemecse@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/softpipe/sp_texture.c

index 02eff918237c6c2018f0f8aa5218f7f897c549f1..aa061d728a06193fb73684aa99c1697ab55c6b35 100644 (file)
@@ -260,6 +260,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS:
    case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
       return 1;
+   case PIPE_CAP_CLEAR_TEXTURE:
+      return 1;
    case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
@@ -268,7 +270,6 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TGSI_TXQS:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
    case PIPE_CAP_SHAREABLE_SHADERS:
-   case PIPE_CAP_CLEAR_TEXTURE:
    case PIPE_CAP_DRAW_PARAMETERS:
    case PIPE_CAP_TGSI_PACK_HALF_FLOAT:
    case PIPE_CAP_MULTI_DRAW_INDIRECT:
index 8dca15860e41b52f00aa50b58e04cac7fd7d8d44..ea5e2c64b849af402a1c0370ccba661377109229 100644 (file)
@@ -37,6 +37,7 @@
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #include "util/u_transfer.h"
+#include "util/u_surface.h"
 
 #include "sp_context.h"
 #include "sp_flush.h"
@@ -520,6 +521,7 @@ softpipe_init_texture_funcs(struct pipe_context *pipe)
 
    pipe->create_surface = softpipe_create_surface;
    pipe->surface_destroy = softpipe_surface_destroy;
+   pipe->clear_texture = util_clear_texture;
 }