summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/d3d1x
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2011-09-16 09:39:34 +0100
committerDave Airlie <[email protected]>2011-09-18 15:12:47 +0100
commit6dd284f7c8fac22f64c13fdf9909094f5ec59086 (patch)
tree8fe6c89638f05d1638b3a5d0395e011d68eda336 /src/gallium/state_trackers/d3d1x
parent78026b8acef9d6eea4f37d9c5435447944d1befd (diff)
gallium: move clear paths from rgba to a pointer to a color union (v2)
This moves the gallium interface for clears from using a pointer to 4 floats to a pointer to a union of float/unsigned/int values. Notes: 1. the value is opaque. 2. only when the value is used should it be interpretered according to the surface format it is going to be used with. 3. float clears on integer buffers and vice-versa are undefined. v2: fixed up vega and graw, dropped hunks that shouldn't have been in patch. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/d3d1x')
-rw-r--r--src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp10
-rw-r--r--src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h7
2 files changed, 11 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp b/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp
index 2bf001261eb..e3329e4d5d3 100644
--- a/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp
+++ b/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp
@@ -1162,7 +1162,7 @@ struct GalliumDXGISwapChain : public GalliumDXGIObject<IDXGISwapChain, GalliumDX
if(1)
{
unsigned blit_x, blit_y, blit_w, blit_h;
- float black[4] = {0, 0, 0, 0};
+ static const union pipe_color_union black;
if(!formats_compatible || src->width0 != dst_w || src->height0 != dst_h) {
struct pipe_surface templat;
@@ -1205,9 +1205,9 @@ struct GalliumDXGISwapChain : public GalliumDXGIObject<IDXGISwapChain, GalliumDX
}
if(blit_x)
- pipe->clear_render_target(pipe, dst_surface, black, rect.left, rect.top, blit_x, dst_h);
+ pipe->clear_render_target(pipe, dst_surface, &black, rect.left, rect.top, blit_x, dst_h);
if(blit_y)
- pipe->clear_render_target(pipe, dst_surface, black, rect.left, rect.top, dst_w, blit_y);
+ pipe->clear_render_target(pipe, dst_surface, &black, rect.left, rect.top, dst_w, blit_y);
if(formats_compatible && blit_w == src->width0 && blit_h == src->height0)
{
@@ -1226,9 +1226,9 @@ struct GalliumDXGISwapChain : public GalliumDXGIObject<IDXGISwapChain, GalliumDX
}
if(blit_w != dst_w)
- pipe->clear_render_target(pipe, dst_surface, black, rect.left + blit_x + blit_w, rect.top, dst_w - blit_x - blit_w, dst_h);
+ pipe->clear_render_target(pipe, dst_surface, &black, rect.left + blit_x + blit_w, rect.top, dst_w - blit_x - blit_w, dst_h);
if(blit_h != dst_h)
- pipe->clear_render_target(pipe, dst_surface, black, rect.left, rect.top + blit_y + blit_h, dst_w, dst_h - blit_y - blit_h);
+ pipe->clear_render_target(pipe, dst_surface, &black, rect.left, rect.top + blit_y + blit_h, dst_w, dst_h - blit_y - blit_h);
}
if(dst_surface)
diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
index d43fdeab963..fcb82a19624 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
+++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
@@ -1594,7 +1594,12 @@ changed:
{
SYNCHRONIZED;
GalliumD3D11RenderTargetView* view = ((GalliumD3D11RenderTargetView*)render_target_view);
- pipe->clear_render_target(pipe, view->object, color, 0, 0, view->object->width, view->object->height);
+ union pipe_color_union cc;
+ cc.f[0] = color[0];
+ cc.f[1] = color[1];
+ cc.f[2] = color[2];
+ cc.f[3] = color[3];
+ pipe->clear_render_target(pipe, view->object, &cc, 0, 0, view->object->width, view->object->height);
}
virtual void STDMETHODCALLTYPE ClearDepthStencilView(