gallium: separate out floating-point CAPs into its own enum
[mesa.git] / src / gallium / drivers / identity / id_screen.c
index 52573b211fbd1d78f436db7b470ee5b5b0d0dc4f..5675c27c63b6c10ca75a35ebfec542c1888040b4 100644 (file)
@@ -67,7 +67,7 @@ identity_screen_get_vendor(struct pipe_screen *_screen)
 
 static int
 identity_screen_get_param(struct pipe_screen *_screen,
-                          int param)
+                          enum pipe_cap param)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
    struct pipe_screen *screen = id_screen->screen;
@@ -76,9 +76,20 @@ identity_screen_get_param(struct pipe_screen *_screen,
                             param);
 }
 
+static int
+identity_screen_get_shader_param(struct pipe_screen *_screen,
+                          unsigned shader, enum pipe_shader_cap param)
+{
+   struct identity_screen *id_screen = identity_screen(_screen);
+   struct pipe_screen *screen = id_screen->screen;
+
+   return screen->get_shader_param(screen, shader,
+                            param);
+}
+
 static float
 identity_screen_get_paramf(struct pipe_screen *_screen,
-                           int param)
+                           enum pipe_capf param)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
    struct pipe_screen *screen = id_screen->screen;
@@ -91,8 +102,8 @@ static boolean
 identity_screen_is_format_supported(struct pipe_screen *_screen,
                                     enum pipe_format format,
                                     enum pipe_texture_target target,
-                                    unsigned tex_usage,
-                                    unsigned geom_flags)
+                                    unsigned sample_count,
+                                    unsigned tex_usage)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
    struct pipe_screen *screen = id_screen->screen;
@@ -100,8 +111,8 @@ identity_screen_is_format_supported(struct pipe_screen *_screen,
    return screen->is_format_supported(screen,
                                       format,
                                       target,
-                                      tex_usage,
-                                      geom_flags);
+                                      sample_count,
+                                      tex_usage);
 }
 
 static struct pipe_context *
@@ -120,14 +131,14 @@ identity_screen_context_create(struct pipe_screen *_screen,
 
 static struct pipe_resource *
 identity_screen_resource_create(struct pipe_screen *_screen,
-                               const struct pipe_resource *templat)
+                                const struct pipe_resource *templat)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
    struct pipe_screen *screen = id_screen->screen;
    struct pipe_resource *result;
 
    result = screen->resource_create(screen,
-                                   templat);
+                                    templat);
 
    if (result)
       return identity_resource_create(id_screen, result);
@@ -136,8 +147,8 @@ identity_screen_resource_create(struct pipe_screen *_screen,
 
 static struct pipe_resource *
 identity_screen_resource_from_handle(struct pipe_screen *_screen,
-                                    const struct pipe_resource *templ,
-                                    struct winsys_handle *handle)
+                                     const struct pipe_resource *templ,
+                                     struct winsys_handle *handle)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
    struct pipe_screen *screen = id_screen->screen;
@@ -154,67 +165,34 @@ identity_screen_resource_from_handle(struct pipe_screen *_screen,
 
 static boolean
 identity_screen_resource_get_handle(struct pipe_screen *_screen,
-                                   struct pipe_resource *_texture,
-                                   struct winsys_handle *handle)
+                                    struct pipe_resource *_resource,
+                                    struct winsys_handle *handle)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
-   struct identity_resource *id_resource = identity_resource(_texture);
+   struct identity_resource *id_resource = identity_resource(_resource);
    struct pipe_screen *screen = id_screen->screen;
-   struct pipe_resource *texture = id_resource->resource;
+   struct pipe_resource *resource = id_resource->resource;
 
    /* TODO trace call */
 
-   return screen->resource_get_handle(screen, texture, handle);
+   return screen->resource_get_handle(screen, resource, handle);
 }
 
 
 
 static void
 identity_screen_resource_destroy(struct pipe_screen *screen,
-                                struct pipe_resource *_texture)
+                                 struct pipe_resource *_resource)
 {
-   identity_resource_destroy(identity_resource(_texture));
+   identity_resource_destroy(identity_resource(_resource));
 }
 
-static struct pipe_surface *
-identity_screen_get_tex_surface(struct pipe_screen *_screen,
-                                struct pipe_resource *_texture,
-                                unsigned face,
-                                unsigned level,
-                                unsigned zslice,
-                                unsigned usage)
-{
-   struct identity_screen *id_screen = identity_screen(_screen);
-   struct identity_resource *id_resource = identity_resource(_texture);
-   struct pipe_screen *screen = id_screen->screen;
-   struct pipe_resource *texture = id_resource->resource;
-   struct pipe_surface *result;
-
-   result = screen->get_tex_surface(screen,
-                                    texture,
-                                    face,
-                                    level,
-                                    zslice,
-                                    usage);
-
-   if (result)
-      return identity_surface_create(id_resource, result);
-   return NULL;
-}
-
-static void
-identity_screen_tex_surface_destroy(struct pipe_surface *_surface)
-{
-   identity_surface_destroy(identity_surface(_surface));
-}
-
-
 
 static struct pipe_resource *
 identity_screen_user_buffer_create(struct pipe_screen *_screen,
                                    void *ptr,
                                    unsigned bytes,
-                                  unsigned usage)
+                                   unsigned usage)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
    struct pipe_screen *screen = id_screen->screen;
@@ -223,7 +201,7 @@ identity_screen_user_buffer_create(struct pipe_screen *_screen,
    result = screen->user_buffer_create(screen,
                                        ptr,
                                        bytes,
-                                      usage);
+                                       usage);
 
    if (result)
       return identity_resource_create(id_screen, result);
@@ -234,16 +212,18 @@ identity_screen_user_buffer_create(struct pipe_screen *_screen,
 
 static void
 identity_screen_flush_frontbuffer(struct pipe_screen *_screen,
-                                  struct pipe_surface *_surface,
+                                  struct pipe_resource *_resource,
+                                  unsigned level, unsigned layer,
                                   void *context_private)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
-   struct identity_surface *id_surface = identity_surface(_surface);
+   struct identity_resource *id_resource = identity_resource(_resource);
    struct pipe_screen *screen = id_screen->screen;
-   struct pipe_surface *surface = id_surface->surface;
+   struct pipe_resource *resource = id_resource->resource;
 
    screen->flush_frontbuffer(screen,
-                             surface,
+                             resource,
+                             level, layer,
                              context_private);
 }
 
@@ -260,30 +240,28 @@ identity_screen_fence_reference(struct pipe_screen *_screen,
                            fence);
 }
 
-static int
+static boolean
 identity_screen_fence_signalled(struct pipe_screen *_screen,
-                                struct pipe_fence_handle *fence,
-                                unsigned flags)
+                                struct pipe_fence_handle *fence)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
    struct pipe_screen *screen = id_screen->screen;
 
    return screen->fence_signalled(screen,
-                                  fence,
-                                  flags);
+                                  fence);
 }
 
-static int
+static boolean
 identity_screen_fence_finish(struct pipe_screen *_screen,
                              struct pipe_fence_handle *fence,
-                             unsigned flags)
+                             uint64_t timeout)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
    struct pipe_screen *screen = id_screen->screen;
 
    return screen->fence_finish(screen,
                                fence,
-                               flags);
+                               timeout);
 }
 
 struct pipe_screen *
@@ -302,6 +280,7 @@ identity_screen_create(struct pipe_screen *screen)
    id_screen->base.get_name = identity_screen_get_name;
    id_screen->base.get_vendor = identity_screen_get_vendor;
    id_screen->base.get_param = identity_screen_get_param;
+   id_screen->base.get_shader_param = identity_screen_get_shader_param;
    id_screen->base.get_paramf = identity_screen_get_paramf;
    id_screen->base.is_format_supported = identity_screen_is_format_supported;
    id_screen->base.context_create = identity_screen_context_create;
@@ -309,8 +288,6 @@ identity_screen_create(struct pipe_screen *screen)
    id_screen->base.resource_from_handle = identity_screen_resource_from_handle;
    id_screen->base.resource_get_handle = identity_screen_resource_get_handle;
    id_screen->base.resource_destroy = identity_screen_resource_destroy;
-   id_screen->base.get_tex_surface = identity_screen_get_tex_surface;
-   id_screen->base.tex_surface_destroy = identity_screen_tex_surface_destroy;
    id_screen->base.user_buffer_create = identity_screen_user_buffer_create;
    id_screen->base.flush_frontbuffer = identity_screen_flush_frontbuffer;
    id_screen->base.fence_reference = identity_screen_fence_reference;