d3d1x: add template parameters to base class ctor calls for GCC 4.4
authorLuca Barbieri <luca@luca-barbieri.com>
Tue, 21 Sep 2010 20:34:40 +0000 (22:34 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Tue, 21 Sep 2010 20:35:01 +0000 (22:35 +0200)
GCC 4.5 is fine without them, but GCC 4.4 requires them.
Should fully fix the build on GCC 4.4

src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp
src/gallium/state_trackers/d3d1x/gd3d11/d3d11.cpp
src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
src/gallium/state_trackers/d3d1x/gd3d11/d3d11_objects.h

index 69ddbc5a0c040f9892363a069db49c9496864f40..41c8f29847e4905ccf2af11a3cb477af485b2784 100644 (file)
@@ -77,7 +77,7 @@ struct GalliumDXGIFactory : public GalliumDXGIObject<IDXGIFactory1, IUnknown>
        void* resolver_cookie;
 
         GalliumDXGIFactory(const struct native_platform* platform, void* display, PFNHWNDRESOLVER resolver, void* resolver_cookie)
-        : GalliumDXGIObject((IUnknown*)NULL), platform(platform), display(display), resolver(resolver ? resolver : identity_resolver), resolver_cookie(resolver_cookie)
+        : GalliumDXGIObject<IDXGIFactory1, IUnknown>((IUnknown*)NULL), platform(platform), display(display), resolver(resolver ? resolver : identity_resolver), resolver_cookie(resolver_cookie)
         {}
 
         virtual HRESULT STDMETHODCALLTYPE EnumAdapters(
@@ -316,7 +316,7 @@ struct GalliumDXGIOutput : public GalliumDXGIObject<IDXGIOutput, GalliumDXGIAdap
        DXGI_GAMMA_CONTROL* gamma;
 
        GalliumDXGIOutput(GalliumDXGIAdapter* adapter, std::string name, const struct native_connector* connector = 0)
-       : GalliumDXGIObject(adapter), connector(connector)
+       : GalliumDXGIObject<IDXGIOutput, GalliumDXGIAdapter>(adapter), connector(connector)
        {
                memset(&desc, 0, sizeof(desc));
                for(unsigned i = 0; i < std::min(name.size(), sizeof(desc.DeviceName) - 1); ++i)
@@ -818,7 +818,7 @@ struct GalliumDXGISwapChain : public GalliumDXGIObject<IDXGISwapChain, GalliumDX
        bool formats_compatible;
 
        GalliumDXGISwapChain(GalliumDXGIFactory* factory, IUnknown* p_device, const DXGI_SWAP_CHAIN_DESC& p_desc)
-       : GalliumDXGIObject(factory), desc(p_desc)
+       : GalliumDXGIObject<IDXGISwapChain, GalliumDXGIFactory>(factory), desc(p_desc)
        {
                HRESULT hr;
 
index 69dfd403f3d9f648f986006870183a330789caea..46a3905d8fcf56bb54d21cfb1a0ce9607c71e39b 100644 (file)
@@ -126,20 +126,22 @@ struct GalliumD3D11Caps
        unsigned stages;
 };
 
-// used to avoid needing to have forward declarations of functions
-// this is called "screen" because in the D3D10 case it's only part of the device
-struct GalliumD3D11Screen
-       : public GalliumDXGIDevice<
-               GalliumMultiComObject<
+typedef GalliumDXGIDevice<
+       GalliumMultiComObject<
 #if API >= 11
-                       GalliumPrivateDataComObject<ID3D11Device>,
+               GalliumPrivateDataComObject<ID3D11Device>,
 #else
-                       GalliumPrivateDataComObject<ID3D10Device1>,
+               GalliumPrivateDataComObject<ID3D10Device1>,
 #endif
-                       IGalliumDevice
-               >
+               IGalliumDevice
        >
+> GalliumD3D11ScreenBase;
+
+// used to avoid needing to have forward declarations of functions
+// this is called "screen" because in the D3D10 case it's only part of the device
+struct GalliumD3D11Screen : public GalliumD3D11ScreenBase
 {
+
        pipe_screen* screen;
        pipe_context* immediate_pipe;
        GalliumD3D11Caps screen_caps;
@@ -159,7 +161,7 @@ struct GalliumD3D11Screen
 
 
        GalliumD3D11Screen(pipe_screen* screen, struct pipe_context* immediate_pipe, IDXGIAdapter* adapter)
-       : GalliumDXGIDevice(adapter), screen(screen), immediate_pipe(immediate_pipe)
+       : GalliumD3D11ScreenBase(adapter), screen(screen), immediate_pipe(immediate_pipe)
        {
        }
 
index a8573cdf686e2aac696aa266eb1d676b9aab6d30..032cb0ea8410eb2384a349f034980bdf18958e3c 100644 (file)
@@ -119,7 +119,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
 #define SYNCHRONIZED do {} while(0)
 
        GalliumD3D11DeviceContext(GalliumD3D11Screen* device, pipe_context* pipe, bool owns_pipe, unsigned context_flags = 0)
-       : GalliumD3D11DeviceChild(device), pipe(pipe), owns_pipe(owns_pipe), context_flags(context_flags)
+       : GalliumD3D11DeviceChild<ID3D11DeviceContext>(device), pipe(pipe), owns_pipe(owns_pipe), context_flags(context_flags)
        {
                caps = device->screen_caps;
                init_context();
@@ -1988,7 +1988,7 @@ struct GalliumD3D11ImmediateDeviceContext
        : public GalliumD3D11DeviceContext<nonatomic_device_child_ptr_traits>
 {
        GalliumD3D11ImmediateDeviceContext(GalliumD3D11Screen* device, pipe_context* pipe, unsigned context_flags = 0)
-       : GalliumD3D11DeviceContext(device, pipe, context_flags)
+       : GalliumD3D11DeviceContext<nonatomic_device_child_ptr_traits>(device, pipe, context_flags)
        {
                // not necessary, but tests that the API at least basically works
                ClearState();
index ad6b28fceb1c51faf9c71cb6b4245e258596ddd5..b7542fd30e4fcf7597f0dd0872b87121de9f7a21 100644 (file)
@@ -684,14 +684,14 @@ struct GalliumD3D11QueryOrPredicate : public GalliumD3D11Asynchronous<Base>
 struct GalliumD3D11Query : public GalliumD3D11QueryOrPredicate<ID3D11Query>
 {
        GalliumD3D11Query(GalliumD3D11Screen* device, struct pipe_query* query, unsigned data_size, const D3D11_QUERY_DESC& desc)
-       : GalliumD3D11QueryOrPredicate(device, query, data_size, desc)
+       : GalliumD3D11QueryOrPredicate<ID3D11Query>(device, query, data_size, desc)
        {}
 };
 
 struct GalliumD3D11Predicate : public GalliumD3D11QueryOrPredicate<ID3D11Predicate>
 {
        GalliumD3D11Predicate(GalliumD3D11Screen* device, struct pipe_query* query, unsigned data_size, const D3D11_QUERY_DESC& desc)
-       : GalliumD3D11QueryOrPredicate(device, query, data_size, desc)
+       : GalliumD3D11QueryOrPredicate<ID3D11Predicate>(device, query, data_size, desc)
        {}
 
        ~GalliumD3D11Predicate()
@@ -704,7 +704,7 @@ struct GalliumD3D11Counter : public GalliumD3D11Asynchronous<ID3D11Counter>
 {
        D3D11_COUNTER_DESC desc;
        GalliumD3D11Counter(GalliumD3D11Screen* device, struct pipe_query* query, unsigned data_size, const D3D11_COUNTER_DESC& desc)
-       : GalliumD3D11Asynchronous(device, query, data_size), desc(desc)
+       : GalliumD3D11Asynchronous<ID3D11Counter>(device, query, data_size), desc(desc)
        {}
 
        virtual void STDMETHODCALLTYPE GetDesc(