diff options
author | Alexander von Gluck IV <[email protected]> | 2014-12-29 21:51:46 +0000 |
---|---|---|
committer | Alexander von Gluck IV <[email protected]> | 2015-01-01 21:33:36 -0500 |
commit | 290553b6d637779cb733549a582230437545d335 (patch) | |
tree | ef0d08cccb015fd247279815afb3c08b0ade74c7 /src/gallium/winsys/sw/hgl | |
parent | b77eaafcdc1b9f050d44d46608e542a9e593da3e (diff) |
gallium/state_tracker: Rewrite Haiku's state tracker
* More gallium-like
* Leverage stamps properly and don't call mesa functions
Diffstat (limited to 'src/gallium/winsys/sw/hgl')
-rw-r--r-- | src/gallium/winsys/sw/hgl/hgl_sw_winsys.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c index 8e8413bbb97..a71d2a76791 100644 --- a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c +++ b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c @@ -1,7 +1,7 @@ /************************************************************************** * * Copyright 2009 Artur Wyszynski <[email protected]> - * Copyright 2013 Alexander von Gluck IV <[email protected]> + * Copyright 2013-2014 Alexander von Gluck IV <[email protected]> * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -25,6 +25,7 @@ * **************************************************************************/ +#include <stdio.h> #include "pipe/p_compiler.h" #include "pipe/p_defines.h" @@ -40,6 +41,16 @@ #include "hgl_sw_winsys.h" +#ifdef DEBUG +# define TRACE(x...) printf("hgl:winsys: " x) +# define CALLED() TRACE("CALLED: %s\n", __PRETTY_FUNCTION__) +#else +# define TRACE(x...) +# define CALLED() +#endif +#define ERROR(x...) printf("hgl:winsys: " x) + + struct haiku_displaytarget { enum pipe_format format; @@ -75,7 +86,7 @@ hgl_winsys_is_displaytarget_format_supported(struct sw_winsys* winsys, unsigned textureUsage, enum pipe_format format) { // TODO STUB - return true; + return TRUE; } static color_space @@ -85,8 +96,8 @@ hgl_winsys_convert_cs(enum pipe_format format) switch(format) { case PIPE_FORMAT_B5G6R5_UNORM: return B_CMAP8; - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_A8B8G8R8_UNORM: + case PIPE_FORMAT_X8B8G8R8_UNORM: default: return B_RGB32; } @@ -101,6 +112,8 @@ hgl_winsys_displaytarget_create(struct sw_winsys* winsys, = CALLOC_STRUCT(haiku_displaytarget); assert(haikuDisplayTarget); + TRACE("%s: %d x %d\n", __func__, width, height); + haikuDisplayTarget->colorSpace = hgl_winsys_convert_cs(format); haikuDisplayTarget->format = format; haikuDisplayTarget->width = width; @@ -193,6 +206,9 @@ hgl_winsys_displaytarget_display(struct sw_winsys* winsys, haikuDisplayTarget->size, haikuDisplayTarget->stride, haikuDisplayTarget->colorSpace); + // Dump the rendered bitmap to disk for debugging + //dump_bitmap(bitmap); + return; } |