From 6c598c78bd17642d731cf57b8369cc794f64ba2f Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Thu, 23 Sep 2010 13:44:22 +0200 Subject: d3d1x: normalize whitespace --- .../d3d1x/d3d1xshader/include/dxbc.h | 4 +- .../state_trackers/d3d1x/d3d1xshader/include/sm4.h | 2 +- .../d3d1x/d3d1xshader/src/sm4_analyze.cpp | 4 +- .../d3d1x/d3d1xstutil/include/d3d1xstutil.h | 260 ++++----- .../state_trackers/d3d1x/d3dapi/d3d10_1.idl | 18 +- .../state_trackers/d3d1x/d3dapi/d3d10misc.h | 18 +- .../state_trackers/d3d1x/d3dapi/d3d10shader.idl | 24 +- src/gallium/state_trackers/d3d1x/d3dapi/d3d11.idl | 628 ++++++++++----------- .../state_trackers/d3d1x/d3dapi/d3d11shader.idl | 36 +- .../state_trackers/d3d1x/d3dapi/d3dcommon.idl | 28 +- src/gallium/state_trackers/d3d1x/d3dapi/dxgi.idl | 520 ++++++++--------- .../state_trackers/d3d1x/d3dapi/dxgitype.idl | 68 +-- .../state_trackers/d3d1x/docs/coding_style.txt | 1 - .../state_trackers/d3d1x/dxgi/src/dxgi_loader.cpp | 238 ++++---- .../state_trackers/d3d1x/dxgi/src/dxgi_native.cpp | 356 ++++++------ .../state_trackers/d3d1x/dxgid3d10/dxgid3d10.cpp | 24 +- .../state_trackers/d3d1x/dxgid3d11/dxgid3d11.cpp | 22 +- src/gallium/state_trackers/d3d1x/gd3d11/d3d11.cpp | 26 +- .../state_trackers/d3d1x/gd3d11/d3d11_context.h | 352 ++++++------ .../state_trackers/d3d1x/gd3d11/d3d11_misc.h | 38 +- .../state_trackers/d3d1x/gd3d11/d3d11_objects.h | 206 +++---- .../state_trackers/d3d1x/gd3d11/d3d11_screen.h | 214 +++---- .../state_trackers/d3d1x/gd3d1x/d3d_enums.cpp | 2 +- .../state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp | 2 +- .../state_trackers/d3d1x/gd3dapi/galliumcom.idl | 2 +- .../state_trackers/d3d1x/gd3dapi/galliumdxgi.idl | 4 +- .../d3d1x/progs/d3d10app/d3d10x11main.cpp | 4 +- .../d3d1x/progs/d3d10tri/d3d10tri.cpp | 28 +- .../state_trackers/d3d1x/progs/d3d11app/d3d11u.h | 2 +- .../d3d1x/progs/d3d11app/d3d11x11main.cpp | 2 +- .../d3d1x/progs/d3d11gears/d3d11gears.cpp | 8 +- .../d3d1x/progs/d3d11tri/d3d11tri.cpp | 28 +- 32 files changed, 1584 insertions(+), 1585 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/d3d1x/d3d1xshader/include/dxbc.h b/src/gallium/state_trackers/d3d1x/d3d1xshader/include/dxbc.h index 06a078af6e..5c7c87e5e8 100644 --- a/src/gallium/state_trackers/d3d1x/d3d1xshader/include/dxbc.h +++ b/src/gallium/state_trackers/d3d1x/d3d1xshader/include/dxbc.h @@ -33,7 +33,7 @@ #include #include "le32.h" -#define FOURCC(a, b, c, d) ((uint32_t)(uint8_t)(a) | ((uint32_t)(uint8_t)(b) << 8) | ((uint32_t)(uint8_t)(c) << 16) | ((uint32_t)(uint8_t)(d) << 24 )) +#define FOURCC(a, b, c, d) ((uint32_t)(uint8_t)(a) | ((uint32_t)(uint8_t)(b) << 8) | ((uint32_t)(uint8_t)(c) << 16) | ((uint32_t)(uint8_t)(d) << 24 )) #define FOURCC_DXBC FOURCC('D', 'X', 'B', 'C') #define FOURCC_RDEF FOURCC('R', 'D', 'E', 'F') #define FOURCC_ISGN FOURCC('I', 'S', 'G', 'N') @@ -100,7 +100,7 @@ static inline dxbc_chunk_header* dxbc_find_shader_bytecode(const void* data, int static inline dxbc_chunk_signature* dxbc_find_signature(const void* data, int size, bool output) { - return (dxbc_chunk_signature*)dxbc_find_chunk(data, size, output ? FOURCC_OSGN : FOURCC_ISGN); + return (dxbc_chunk_signature*)dxbc_find_chunk(data, size, output ? FOURCC_OSGN : FOURCC_ISGN); } struct _D3D11_SIGNATURE_PARAMETER_DESC; diff --git a/src/gallium/state_trackers/d3d1x/d3d1xshader/include/sm4.h b/src/gallium/state_trackers/d3d1x/d3d1xshader/include/sm4.h index 07f84f0c73..c8404d9691 100644 --- a/src/gallium/state_trackers/d3d1x/d3d1xshader/include/sm4.h +++ b/src/gallium/state_trackers/d3d1x/d3d1xshader/include/sm4.h @@ -157,7 +157,7 @@ struct sm4_token_instruction }; }; -union sm4_token_instruction_extended +union sm4_token_instruction_extended { struct { diff --git a/src/gallium/state_trackers/d3d1x/d3d1xshader/src/sm4_analyze.cpp b/src/gallium/state_trackers/d3d1x/d3d1xshader/src/sm4_analyze.cpp index 848db1bdbb..7903d547f1 100644 --- a/src/gallium/state_trackers/d3d1x/d3d1xshader/src/sm4_analyze.cpp +++ b/src/gallium/state_trackers/d3d1x/d3d1xshader/src/sm4_analyze.cpp @@ -167,7 +167,7 @@ bool sm4_allocate_resource_sampler_pairs(sm4_program& program) program.resource_sampler_to_slot[*i] = program.slot_to_resource.size(); if(!program.resource_to_slot.count(i->first)) { - program.resource_to_slot[i->first] = program.slot_to_resource.size(); + program.resource_to_slot[i->first] = program.slot_to_resource.size(); resinfos.erase(i->first); } program.slot_to_resource.push_back(i->first); @@ -177,7 +177,7 @@ bool sm4_allocate_resource_sampler_pairs(sm4_program& program) for(std::set::iterator i = resinfos.begin(); i != resinfos.end(); ++i) { program.resource_sampler_to_slot[std::make_pair(*i, -1)] = program.slot_to_resource.size(); - program.resource_to_slot[*i] = program.slot_to_resource.size(); + program.resource_to_slot[*i] = program.slot_to_resource.size(); program.slot_to_resource.push_back(*i); program.slot_to_sampler.push_back(-1); } diff --git a/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h b/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h index 974518a5ce..eebabaa9af 100644 --- a/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h +++ b/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h @@ -200,7 +200,7 @@ extern "C" * with are unsafe regarding vtable layout. * In particular, consider the case where we try to delete GalliumComObject * with a pointer to GalliumComObject. - * Since we think that this is a GalliumComObject, we'll look for the + * Since we think that this is a GalliumComObject, we'll look for the * destructor in the vtable slot immediately after the ID3D11Resource vtable, but this is * actually an ID3D11Texture2D function implemented by the object! * @@ -441,7 +441,7 @@ struct GalliumComObject : public Base virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID riid, - void **ppvObject) + void **ppvObject) { /* see the initial comment for an explaination of this magic trick */ if(&riid == &IID_MAGIC_DELETE_THIS) @@ -487,9 +487,9 @@ struct GalliumMultiComObject : public BaseClass, SecondaryInterface return E_NOINTERFACE; } - virtual HRESULT STDMETHODCALLTYPE QueryInterface( + virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID riid, - void **ppvObject) + void **ppvObject) { /* see the initial comment for an explaination of this magic trick */ if(&riid == &IID_MAGIC_DELETE_THIS) @@ -836,77 +836,77 @@ struct GalliumPrivateDataComObject : public GalliumComObject } HRESULT get_private_data( - __in REFGUID guid, - __inout UINT *pDataSize, - __out_bcount_opt(*pDataSize) void *pData) - { + __in REFGUID guid, + __inout UINT *pDataSize, + __out_bcount_opt(*pDataSize) void *pData) + { lock_t lock(private_data_mutex); - private_data_map_t::iterator i = private_data_map.find(guid); - *pDataSize = 0; - if(i == private_data_map.end()) - return DXGI_ERROR_NOT_FOUND; - if(i->second.second == ~0u) - { - /* TODO: is GetPrivateData on interface data supposed to do this? */ - if(*pDataSize < sizeof(void*)) - return E_INVALIDARG; - if(pData) - { - memcpy(pData, &i->second.first, sizeof(void*)); + private_data_map_t::iterator i = private_data_map.find(guid); + *pDataSize = 0; + if(i == private_data_map.end()) + return DXGI_ERROR_NOT_FOUND; + if(i->second.second == ~0u) + { + /* TODO: is GetPrivateData on interface data supposed to do this? */ + if(*pDataSize < sizeof(void*)) + return E_INVALIDARG; + if(pData) + { + memcpy(pData, &i->second.first, sizeof(void*)); ((IUnknown*)i->second.first)->AddRef(); - } - *pDataSize = sizeof(void*); - } - else - { - unsigned size = std::min(*pDataSize, i->second.second); - if(pData) - memcpy(pData, i->second.first, size); - *pDataSize = size; - } - return S_OK; - } - - HRESULT set_private_data( - __in REFGUID guid, - __in UINT DataSize, - __in_bcount_opt( DataSize ) const void *pData) - { - void* p = 0; - - if(DataSize && pData) - { - p = malloc(DataSize); - if(!p) - return E_OUTOFMEMORY; - } - - lock_t lock(private_data_mutex); - std::pair& v = private_data_map[guid]; - if(v.first) - { - if(v.second == ~0u) - ((IUnknown*)v.first)->Release(); - else - free(v.first); - } - if(DataSize && pData) - { - memcpy(p, pData, DataSize); - v.first = p; - v.second = DataSize; - } - else - private_data_map.erase(guid); - return S_OK; - } - - HRESULT set_private_data_interface( - __in REFGUID guid, - __in_opt const IUnknown *pData) - { - lock_t lock(private_data_mutex); - std::pair& v = private_data_map[guid]; + } + *pDataSize = sizeof(void*); + } + else + { + unsigned size = std::min(*pDataSize, i->second.second); + if(pData) + memcpy(pData, i->second.first, size); + *pDataSize = size; + } + return S_OK; + } + + HRESULT set_private_data( + __in REFGUID guid, + __in UINT DataSize, + __in_bcount_opt( DataSize ) const void *pData) + { + void* p = 0; + + if(DataSize && pData) + { + p = malloc(DataSize); + if(!p) + return E_OUTOFMEMORY; + } + + lock_t lock(private_data_mutex); + std::pair& v = private_data_map[guid]; + if(v.first) + { + if(v.second == ~0u) + ((IUnknown*)v.first)->Release(); + else + free(v.first); + } + if(DataSize && pData) + { + memcpy(p, pData, DataSize); + v.first = p; + v.second = DataSize; + } + else + private_data_map.erase(guid); + return S_OK; + } + + HRESULT set_private_data_interface( + __in REFGUID guid, + __in_opt const IUnknown *pData) + { + lock_t lock(private_data_mutex); + std::pair& v = private_data_map[guid]; if(v.first) { if(v.second == ~0u) @@ -923,30 +923,30 @@ struct GalliumPrivateDataComObject : public GalliumComObject else private_data_map.erase(guid); return S_OK; - } + } virtual HRESULT STDMETHODCALLTYPE GetPrivateData( - __in REFGUID guid, - __inout UINT *pDataSize, - __out_bcount_opt(*pDataSize) void *pData) - { + __in REFGUID guid, + __inout UINT *pDataSize, + __out_bcount_opt(*pDataSize) void *pData) + { return get_private_data(guid, pDataSize, pData); - } - - virtual HRESULT STDMETHODCALLTYPE SetPrivateData( - __in REFGUID guid, - __in UINT DataSize, - __in_bcount_opt( DataSize ) const void *pData) - { - return set_private_data(guid, DataSize, pData); - } - - virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( - __in REFGUID guid, - __in_opt const IUnknown *pData) - { - return set_private_data_interface(guid, pData); - } + } + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + __in REFGUID guid, + __in UINT DataSize, + __in_bcount_opt( DataSize ) const void *pData) + { + return set_private_data(guid, DataSize, pData); + } + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + __in REFGUID guid, + __in_opt const IUnknown *pData) + { + return set_private_data_interface(guid, pData); + } }; template @@ -954,27 +954,27 @@ struct GalliumMultiPrivateDataComObject : public GalliumMultiComObjectQueryInterface(riid, ppParent); - } + virtual HRESULT STDMETHODCALLTYPE GetParent( + __in REFIID riid, + __out void **ppParent) + { + return adapter.p->QueryInterface(riid, ppParent); + } virtual HRESULT STDMETHODCALLTYPE GetAdapter( - __out IDXGIAdapter **pAdapter) + __out IDXGIAdapter **pAdapter) { *pAdapter = adapter.ref(); return S_OK; } virtual HRESULT STDMETHODCALLTYPE QueryResourceResidency( - __in_ecount(NumResources) IUnknown *const *ppResources, - __out_ecount(NumResources) DXGI_RESIDENCY *pResidencyStatus, + __in_ecount(NumResources) IUnknown *const *ppResources, + __out_ecount(NumResources) DXGI_RESIDENCY *pResidencyStatus, UINT NumResources) { for(unsigned i = 0; i < NumResources; ++i) @@ -1046,7 +1046,7 @@ struct GalliumDXGIDevice : public GalliumMultiPrivateDataComObject + * Chia-I Wu */ #include "dxgi_private.h" @@ -38,153 +38,153 @@ extern "C" static const char * get_search_path(void) { - static const char *search_path; + static const char *search_path; - if (!search_path) { - static char buffer[1024]; - const char *p; - int ret; + if (!search_path) { + static char buffer[1024]; + const char *p; + int ret; - p = getenv("DXGI_DRIVERS_PATH"); - if(!p) - p = getenv("EGL_DRIVERS_PATH"); + p = getenv("DXGI_DRIVERS_PATH"); + if(!p) + p = getenv("EGL_DRIVERS_PATH"); #ifdef __unix__ - if (p && (geteuid() != getuid() || getegid() != getgid())) { - p = NULL; - } + if (p && (geteuid() != getuid() || getegid() != getgid())) { + p = NULL; + } #endif - if (p) { - ret = snprintf(buffer, sizeof(buffer), - "%s:%s", p, DXGI_DRIVER_SEARCH_DIR); - if (ret > 0 && ret < (int)sizeof(buffer)) - search_path = buffer; - } - } - if (!search_path) - search_path = DXGI_DRIVER_SEARCH_DIR; - - return search_path; + if (p) { + ret = snprintf(buffer, sizeof(buffer), + "%s:%s", p, DXGI_DRIVER_SEARCH_DIR); + if (ret > 0 && ret < (int)sizeof(buffer)) + search_path = buffer; + } + } + if (!search_path) + search_path = DXGI_DRIVER_SEARCH_DIR; + + return search_path; } static void for_each_colon_separated(const char *search_path, - bool (*loader)(const char *, size_t, void *), - void *loader_data) + bool (*loader)(const char *, size_t, void *), + void *loader_data) { - const char *cur, *next; - size_t len; + const char *cur, *next; + size_t len; - cur = search_path; - while (cur) { - next = strchr(cur, ':'); - len = (next) ? next - cur : strlen(cur); + cur = search_path; + while (cur) { + next = strchr(cur, ':'); + len = (next) ? next - cur : strlen(cur); - if (!loader(cur, len, loader_data)) - break; + if (!loader(cur, len, loader_data)) + break; - cur = (next) ? next + 1 : NULL; - } + cur = (next) ? next + 1 : NULL; + } } void for_each_in_search_path(bool (*callback)(const char *, size_t, void *), - void *callback_data) + void *callback_data) { - const char *search_path = get_search_path(); - for_each_colon_separated(search_path, callback, callback_data); + const char *search_path = get_search_path(); + for_each_colon_separated(search_path, callback, callback_data); } static struct pipe_module { - boolean initialized; - char *name; - struct util_dl_library *lib; - const struct drm_driver_descriptor *drmdd; - struct pipe_screen *(*swrast_create_screen)(struct sw_winsys *); + boolean initialized; + char *name; + struct util_dl_library *lib; + const struct drm_driver_descriptor *drmdd; + struct pipe_screen *(*swrast_create_screen)(struct sw_winsys *); } pipe_modules[16]; static bool dlopen_pipe_module_cb(const char *dir, size_t len, void *callback_data) { - struct pipe_module *pmod = (struct pipe_module *) callback_data; - char path[1024]; - int ret; - - if (len) { - ret = snprintf(path, sizeof(path), - "%.*s/" PIPE_PREFIX "%s" UTIL_DL_EXT, len, dir, pmod->name); - } - else { - ret = snprintf(path, sizeof(path), - PIPE_PREFIX "%s" UTIL_DL_EXT, pmod->name); - } - if (ret > 0 && ret < (int)sizeof(path)) { - pmod->lib = util_dl_open(path); - } - - return !(pmod->lib); + struct pipe_module *pmod = (struct pipe_module *) callback_data; + char path[1024]; + int ret; + + if (len) { + ret = snprintf(path, sizeof(path), + "%.*s/" PIPE_PREFIX "%s" UTIL_DL_EXT, len, dir, pmod->name); + } + else { + ret = snprintf(path, sizeof(path), + PIPE_PREFIX "%s" UTIL_DL_EXT, pmod->name); + } + if (ret > 0 && ret < (int)sizeof(path)) { + pmod->lib = util_dl_open(path); + } + + return !(pmod->lib); } static bool load_pipe_module(struct pipe_module *pmod, const char *name) { - pmod->name = strdup(name); - if (!pmod->name) - return FALSE; - - for_each_in_search_path(dlopen_pipe_module_cb, (void *) pmod); - if (pmod->lib) { - pmod->drmdd = (const struct drm_driver_descriptor *) - util_dl_get_proc_address(pmod->lib, "driver_descriptor"); - - /* sanity check on the name */ - if (pmod->drmdd && strcmp(pmod->drmdd->name, pmod->name) != 0) - pmod->drmdd = NULL; - - /* swrast */ - if (pmod->drmdd && !pmod->drmdd->driver_name) { - pmod->swrast_create_screen = - (struct pipe_screen *(*)(struct sw_winsys *)) - util_dl_get_proc_address(pmod->lib, "swrast_create_screen"); - if (!pmod->swrast_create_screen) - pmod->drmdd = NULL; - } - - if (!pmod->drmdd) { - util_dl_close(pmod->lib); - pmod->lib = NULL; - } - } - - return (pmod->drmdd != NULL); + pmod->name = strdup(name); + if (!pmod->name) + return FALSE; + + for_each_in_search_path(dlopen_pipe_module_cb, (void *) pmod); + if (pmod->lib) { + pmod->drmdd = (const struct drm_driver_descriptor *) + util_dl_get_proc_address(pmod->lib, "driver_descriptor"); + + /* sanity check on the name */ + if (pmod->drmdd && strcmp(pmod->drmdd->name, pmod->name) != 0) + pmod->drmdd = NULL; + + /* swrast */ + if (pmod->drmdd && !pmod->drmdd->driver_name) { + pmod->swrast_create_screen = + (struct pipe_screen *(*)(struct sw_winsys *)) + util_dl_get_proc_address(pmod->lib, "swrast_create_screen"); + if (!pmod->swrast_create_screen) + pmod->drmdd = NULL; + } + + if (!pmod->drmdd) { + util_dl_close(pmod->lib); + pmod->lib = NULL; + } + } + + return (pmod->drmdd != NULL); } static struct pipe_module * get_pipe_module(const char *name) { - struct pipe_module *pmod = NULL; - unsigned i; - - if (!name) - return NULL; - - for (i = 0; i < sizeof(pipe_modules) / sizeof(pipe_modules[0]); i++) { - if (!pipe_modules[i].initialized || - strcmp(pipe_modules[i].name, name) == 0) { - pmod = &pipe_modules[i]; - break; - } - } - if (!pmod) - return NULL; - - if (!pmod->initialized) { - load_pipe_module(pmod, name); - pmod->initialized = TRUE; - } - - return pmod; + struct pipe_module *pmod = NULL; + unsigned i; + + if (!name) + return NULL; + + for (i = 0; i < sizeof(pipe_modules) / sizeof(pipe_modules[0]); i++) { + if (!pipe_modules[i].initialized || + strcmp(pipe_modules[i].name, name) == 0) { + pmod = &pipe_modules[i]; + break; + } + } + if (!pmod) + return NULL; + + if (!pmod->initialized) { + load_pipe_module(pmod, name); + pmod->initialized = TRUE; + } + + return pmod; } struct native_display; @@ -192,15 +192,15 @@ struct native_display; struct pipe_screen * dxgi_loader_create_drm_screen(struct native_display* dpy, const char *name, int fd) { - struct pipe_module *pmod = get_pipe_module(name); - return (pmod && pmod->drmdd && pmod->drmdd->create_screen) ? - pmod->drmdd->create_screen(fd) : NULL; + struct pipe_module *pmod = get_pipe_module(name); + return (pmod && pmod->drmdd && pmod->drmdd->create_screen) ? + pmod->drmdd->create_screen(fd) : NULL; } struct pipe_screen * dxgi_loader_create_sw_screen(struct native_display* dpy, struct sw_winsys *ws) { - struct pipe_module *pmod = get_pipe_module("swrast"); - return (pmod && pmod->swrast_create_screen) ? - pmod->swrast_create_screen(ws) : NULL; + struct pipe_module *pmod = get_pipe_module("swrast"); + return (pmod && pmod->swrast_create_screen) ? + pmod->swrast_create_screen(ws) : NULL; } 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 2149d83a9c..bf820e9b21 100644 --- a/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp +++ b/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp @@ -55,12 +55,12 @@ struct GalliumDXGIObject : public GalliumPrivateDataComObject this->parent = p_parent; } - virtual HRESULT STDMETHODCALLTYPE GetParent( - __in REFIID riid, - __out void **ppParent) - { - return parent->QueryInterface(riid, ppParent); - } + virtual HRESULT STDMETHODCALLTYPE GetParent( + __in REFIID riid, + __out void **ppParent) + { + return parent->QueryInterface(riid, ppParent); + } }; COM_INTERFACE(IGalliumDXGIBackend, IUnknown) @@ -96,7 +96,7 @@ struct GalliumDXGIIdentityBackend : public GalliumComObject struct GalliumDXGIFactory : public GalliumDXGIObject { - HWND associated_window; + HWND associated_window; const struct native_platform* platform; void* display; ComPtr backend; @@ -104,98 +104,98 @@ struct GalliumDXGIFactory : public GalliumDXGIObject GalliumDXGIFactory(const struct native_platform* platform, void* display, IGalliumDXGIBackend* p_backend) : GalliumDXGIObject((IUnknown*)NULL), platform(platform), display(display) - { + { if(p_backend) backend = p_backend; else backend.reset(new GalliumDXGIIdentityBackend()); } - virtual HRESULT STDMETHODCALLTYPE EnumAdapters( - UINT Adapter, - __out IDXGIAdapter **ppAdapter) + virtual HRESULT STDMETHODCALLTYPE EnumAdapters( + UINT Adapter, + __out IDXGIAdapter **ppAdapter) { return EnumAdapters1(Adapter, (IDXGIAdapter1**)ppAdapter); } - virtual HRESULT STDMETHODCALLTYPE EnumAdapters1( - UINT Adapter, - __out IDXGIAdapter1 **ppAdapter) - { - *ppAdapter = 0; + virtual HRESULT STDMETHODCALLTYPE EnumAdapters1( + UINT Adapter, + __out IDXGIAdapter1 **ppAdapter) + { + *ppAdapter = 0; if(Adapter == 0) { return GalliumDXGIAdapterCreate(this, platform, display, ppAdapter); } #if 0 // TODO: enable this - if(platform == native_get_x11_platform()) - { - unsigned nscreens = ScreenCount((Display*)display); - if(Adapter < nscreens) - { - unsigned def_screen = DefaultScreen(display); - if(Adapter <= def_screen) - --Adapter; - *ppAdapter = GalliumDXGIAdapterCreate(this, platform, display, Adapter); - return S_OK; - } - } + if(platform == native_get_x11_platform()) + { + unsigned nscreens = ScreenCount((Display*)display); + if(Adapter < nscreens) + { + unsigned def_screen = DefaultScreen(display); + if(Adapter <= def_screen) + --Adapter; + *ppAdapter = GalliumDXGIAdapterCreate(this, platform, display, Adapter); + return S_OK; + } + } #endif return DXGI_ERROR_NOT_FOUND; - } - - /* TODO: this is a mysterious underdocumented magic API - * Can we have multiple windows associated? - * Can we have multiple windows associated if we use multiple factories? - * If so, what should GetWindowAssociation return? - * If not, does a new swapchain steal the association? - * Does this act for existing swapchains? For new swapchains? - */ - virtual HRESULT STDMETHODCALLTYPE MakeWindowAssociation( - HWND WindowHandle, - UINT Flags) - { - /* TODO: actually implement, for Wine, X11 and KMS*/ - associated_window = WindowHandle; - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE GetWindowAssociation( - __out HWND *pWindowHandle) - { - *pWindowHandle = associated_window; - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE CreateSwapChain( - __in IUnknown *pDevice, - __in DXGI_SWAP_CHAIN_DESC *pDesc, - __out IDXGISwapChain **ppSwapChain) - { - return GalliumDXGISwapChainCreate(this, pDevice, *pDesc, ppSwapChain); - } - - virtual HRESULT STDMETHODCALLTYPE CreateSoftwareAdapter( - HMODULE Module, - __out IDXGIAdapter **ppAdapter) - { - /* TODO: ignore the module, and just create a Gallium software screen */ - *ppAdapter = 0; - return E_NOTIMPL; - } - - /* TODO: support hotplug */ - virtual BOOL STDMETHODCALLTYPE IsCurrent( void) - { - return TRUE; - } + } + + /* TODO: this is a mysterious underdocumented magic API + * Can we have multiple windows associated? + * Can we have multiple windows associated if we use multiple factories? + * If so, what should GetWindowAssociation return? + * If not, does a new swapchain steal the association? + * Does this act for existing swapchains? For new swapchains? + */ + virtual HRESULT STDMETHODCALLTYPE MakeWindowAssociation( + HWND WindowHandle, + UINT Flags) + { + /* TODO: actually implement, for Wine, X11 and KMS*/ + associated_window = WindowHandle; + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE GetWindowAssociation( + __out HWND *pWindowHandle) + { + *pWindowHandle = associated_window; + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE CreateSwapChain( + __in IUnknown *pDevice, + __in DXGI_SWAP_CHAIN_DESC *pDesc, + __out IDXGISwapChain **ppSwapChain) + { + return GalliumDXGISwapChainCreate(this, pDevice, *pDesc, ppSwapChain); + } + + virtual HRESULT STDMETHODCALLTYPE CreateSoftwareAdapter( + HMODULE Module, + __out IDXGIAdapter **ppAdapter) + { + /* TODO: ignore the module, and just create a Gallium software screen */ + *ppAdapter = 0; + return E_NOTIMPL; + } + + /* TODO: support hotplug */ + virtual BOOL STDMETHODCALLTYPE IsCurrent( void) + { + return TRUE; + } }; struct GalliumDXGIAdapter : public GalliumMultiComObject< - GalliumDXGIObject, - IGalliumAdapter> + GalliumDXGIObject, + IGalliumAdapter> { struct native_display* display; const struct native_config** configs; @@ -275,62 +275,62 @@ struct GalliumDXGIAdapter free(connectors); } - virtual HRESULT STDMETHODCALLTYPE EnumOutputs( - UINT Output, - __out IDXGIOutput **ppOutput) + virtual HRESULT STDMETHODCALLTYPE EnumOutputs( + UINT Output, + __out IDXGIOutput **ppOutput) { - if(Output >= (unsigned)num_outputs) - return DXGI_ERROR_NOT_FOUND; + if(Output >= (unsigned)num_outputs) + return DXGI_ERROR_NOT_FOUND; - if(connectors) - { - std::ostringstream ss; - ss << "Output #" << Output; + if(connectors) + { + std::ostringstream ss; + ss << "Output #" << Output; return GalliumDXGIOutputCreate(this, ss.str(), connectors[Output], ppOutput); - } - else - return GalliumDXGIOutputCreate(this, "Unique output", NULL, ppOutput); + } + else + return GalliumDXGIOutputCreate(this, "Unique output", NULL, ppOutput); + } + + virtual HRESULT STDMETHODCALLTYPE GetDesc( + __out DXGI_ADAPTER_DESC *pDesc) + { + memcpy(pDesc, &desc, sizeof(*pDesc)); + return S_OK; } - virtual HRESULT STDMETHODCALLTYPE GetDesc( - __out DXGI_ADAPTER_DESC *pDesc) - { - memcpy(pDesc, &desc, sizeof(*pDesc)); - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE GetDesc1( - __out DXGI_ADAPTER_DESC1 *pDesc) - { - memcpy(pDesc, &desc, sizeof(*pDesc)); - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE CheckInterfaceSupport( - __in REFGUID InterfaceName, - __out LARGE_INTEGER *pUMDVersion) - { - // these number was taken from Windows 7 with Catalyst 10.8: its meaning is unclear - if(InterfaceName == IID_ID3D11Device || InterfaceName == IID_ID3D10Device1 || InterfaceName == IID_ID3D10Device) - { - pUMDVersion->QuadPart = 0x00080011000a0411ULL; - return S_OK; - } - return DXGI_ERROR_UNSUPPORTED; - } - - pipe_screen* STDMETHODCALLTYPE GetGalliumScreen() - { - return display->screen; - } - - pipe_screen* STDMETHODCALLTYPE GetGalliumReferenceSoftwareScreen() - { - // TODO: give a softpipe screen - return display->screen; - } - - pipe_screen* STDMETHODCALLTYPE GetGalliumFastSoftwareScreen() + virtual HRESULT STDMETHODCALLTYPE GetDesc1( + __out DXGI_ADAPTER_DESC1 *pDesc) + { + memcpy(pDesc, &desc, sizeof(*pDesc)); + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE CheckInterfaceSupport( + __in REFGUID InterfaceName, + __out LARGE_INTEGER *pUMDVersion) + { + // these number was taken from Windows 7 with Catalyst 10.8: its meaning is unclear + if(InterfaceName == IID_ID3D11Device || InterfaceName == IID_ID3D10Device1 || InterfaceName == IID_ID3D10Device) + { + pUMDVersion->QuadPart = 0x00080011000a0411ULL; + return S_OK; + } + return DXGI_ERROR_UNSUPPORTED; + } + + pipe_screen* STDMETHODCALLTYPE GetGalliumScreen() + { + return display->screen; + } + + pipe_screen* STDMETHODCALLTYPE GetGalliumReferenceSoftwareScreen() + { + // TODO: give a softpipe screen + return display->screen; + } + + pipe_screen* STDMETHODCALLTYPE GetGalliumFastSoftwareScreen() { // TODO: give an llvmpipe screen return display->screen; @@ -407,7 +407,7 @@ use_fake_mode: } virtual HRESULT STDMETHODCALLTYPE GetDesc( - __out DXGI_OUTPUT_DESC *pDesc) + __out DXGI_OUTPUT_DESC *pDesc) { *pDesc = desc; return S_OK; @@ -416,8 +416,8 @@ use_fake_mode: virtual HRESULT STDMETHODCALLTYPE GetDisplayModeList( DXGI_FORMAT EnumFormat, UINT Flags, - __inout UINT *pNumModes, - __out_ecount_part_opt(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc) + __inout UINT *pNumModes, + __out_ecount_part_opt(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc) { /* TODO: should we return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE when we don't * support modesetting instead of fake modes? @@ -452,9 +452,9 @@ use_fake_mode: } virtual HRESULT STDMETHODCALLTYPE FindClosestMatchingMode( - __in const DXGI_MODE_DESC *pModeToMatch, - __out DXGI_MODE_DESC *pClosestMatch, - __in_opt IUnknown *pConcernedDevice) + __in const DXGI_MODE_DESC *pModeToMatch, + __out DXGI_MODE_DESC *pClosestMatch, + __in_opt IUnknown *pConcernedDevice) { /* TODO: actually implement this */ DXGI_FORMAT dxgi_format = pModeToMatch->Format; @@ -482,7 +482,7 @@ use_fake_mode: } virtual HRESULT STDMETHODCALLTYPE TakeOwnership( - __in IUnknown *pDevice, + __in IUnknown *pDevice, BOOL Exclusive) { return S_OK; @@ -493,14 +493,14 @@ use_fake_mode: } virtual HRESULT STDMETHODCALLTYPE GetGammaControlCapabilities( - __out DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps) + __out DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps) { memset(pGammaCaps, 0, sizeof(*pGammaCaps)); return S_OK; } virtual HRESULT STDMETHODCALLTYPE SetGammaControl( - __in const DXGI_GAMMA_CONTROL *pArray) + __in const DXGI_GAMMA_CONTROL *pArray) { if(!gamma) gamma = new DXGI_GAMMA_CONTROL; @@ -509,7 +509,7 @@ use_fake_mode: } virtual HRESULT STDMETHODCALLTYPE GetGammaControl( - __out DXGI_GAMMA_CONTROL *pArray) + __out DXGI_GAMMA_CONTROL *pArray) { if(gamma) *pArray = *gamma; @@ -528,19 +528,19 @@ use_fake_mode: } virtual HRESULT STDMETHODCALLTYPE SetDisplaySurface( - __in IDXGISurface *pScanoutSurface) + __in IDXGISurface *pScanoutSurface) { return E_NOTIMPL; } virtual HRESULT STDMETHODCALLTYPE GetDisplaySurfaceData( - __in IDXGISurface *pDestination) + __in IDXGISurface *pDestination) { return E_NOTIMPL; } virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics( - __out DXGI_FRAME_STATISTICS *pStats) + __out DXGI_FRAME_STATISTICS *pStats) { memset(pStats, 0, sizeof(*pStats)); #ifdef _WIN32 @@ -579,7 +579,7 @@ use_fake_mode: * GetBuffer(n) with n > 0 points to resources that are identical to buffer 0, but * are classified as "read-only resources" (due to DXGI_USAGE_READ_ONLY), * meaning that you can't create render target views on them, or use them as - * a CopyResource/CopySubresourceRegion destination. + * a CopyResource/CopySubresourceRegion destination. * It appears the only valid operation is to use them as a source for CopyResource * and CopySubresourceRegion as well as just waiting for them to become * buffer 0 again. @@ -620,17 +620,17 @@ use_fake_mode: * * There are three strategies: * 1. Use a single buffer, and always copy it to a window system provided buffer, or - * just give the buffer to the window system if it supports that + * just give the buffer to the window system if it supports that * 2. Rotate the buffers in the D3D1x implementation, and recreate and rebind the views. - * Don't support driver-provided command lists + * Don't support driver-provided command lists * 3. Add this rotation functionality to the Gallium driver, with the idea that it would rotate - * remap GPU virtual memory, so that virtual address are unchanged, but the physical - * ones are rotated (so that pushbuffers remain valid). - * If the driver does not support this, either fall back to (1), or have a layer doing this, - * putting a deferred context layer over this intermediate layer. + * remap GPU virtual memory, so that virtual address are unchanged, but the physical + * ones are rotated (so that pushbuffers remain valid). + * If the driver does not support this, either fall back to (1), or have a layer doing this, + * putting a deferred context layer over this intermediate layer. * * (2) is not acceptable since it prevents an optimal implementation. - * (3) is the ideal solution, but it is complicated. + * (3) is the ideal solution, but it is complicated. * * Hence, we implement (1) for now, and will switch to (3) later. * @@ -872,7 +872,7 @@ struct GalliumDXGISwapChain : public GalliumDXGIObjectdestroy(pipe); } - virtual HRESULT STDMETHODCALLTYPE GetDevice( - __in REFIID riid, - __out void **ppDevice) - { - return dxgi_device->QueryInterface(riid, ppDevice); - } + virtual HRESULT STDMETHODCALLTYPE GetDevice( + __in REFIID riid, + __out void **ppDevice) + { + return dxgi_device->QueryInterface(riid, ppDevice); + } - HRESULT create_buffer0() - { - HRESULT hr; + HRESULT create_buffer0() + { + HRESULT hr; ComPtr new_buffer0; DXGI_USAGE usage = DXGI_USAGE_BACK_BUFFER | DXGI_USAGE_RENDER_TARGET_OUTPUT; if(desc.SwapEffect == DXGI_SWAP_EFFECT_DISCARD) @@ -987,7 +987,7 @@ struct GalliumDXGISwapChain : public GalliumDXGIObjectformat; gallium_buffer0_view = pipe->create_sampler_view(pipe, gallium_buffer0, &templat); return S_OK; - } + } bool validate() { @@ -1158,9 +1158,9 @@ end_present: } virtual HRESULT STDMETHODCALLTYPE GetBuffer( - UINT Buffer, - __in REFIID riid, - __out void **ppSurface) + UINT Buffer, + __in REFIID riid, + __out void **ppSurface) { if(Buffer > 0) { @@ -1182,7 +1182,7 @@ end_present: /* TODO: implement somehow */ virtual HRESULT STDMETHODCALLTYPE SetFullscreenState( BOOL Fullscreen, - __in_opt IDXGIOutput *pTarget) + __in_opt IDXGIOutput *pTarget) { fullscreen = Fullscreen; target = pTarget; @@ -1190,8 +1190,8 @@ end_present: } virtual HRESULT STDMETHODCALLTYPE GetFullscreenState( - __out BOOL *pFullscreen, - __out IDXGIOutput **ppTarget) + __out BOOL *pFullscreen, + __out IDXGIOutput **ppTarget) { if(pFullscreen) *pFullscreen = fullscreen; @@ -1201,7 +1201,7 @@ end_present: } virtual HRESULT STDMETHODCALLTYPE GetDesc( - __out DXGI_SWAP_CHAIN_DESC *pDesc) + __out DXGI_SWAP_CHAIN_DESC *pDesc) { *pDesc = desc; return S_OK; @@ -1243,14 +1243,14 @@ end_present: } virtual HRESULT STDMETHODCALLTYPE GetContainingOutput( - __out IDXGIOutput **ppOutput) + __out IDXGIOutput **ppOutput) { *ppOutput = adapter->outputs[0].ref(); return S_OK; } virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics( - __out DXGI_FRAME_STATISTICS *pStats) + __out DXGI_FRAME_STATISTICS *pStats) { memset(pStats, 0, sizeof(*pStats)); #ifdef _WIN32 @@ -1263,7 +1263,7 @@ end_present: } virtual HRESULT STDMETHODCALLTYPE GetLastPresentCount( - __out UINT *pLastPresentCount) + __out UINT *pLastPresentCount) { *pLastPresentCount = present_count; return S_OK; @@ -1389,11 +1389,11 @@ void STDMETHODCALLTYPE GalliumDXGIMakeDefault() } /* TODO: why did Microsoft add this? should we do something different for DXGI 1.0 and 1.1? - * Or perhaps what they actually mean is "only create a single factory in your application"? - * TODO: should we use a singleton here, so we never have multiple DXGI objects for the same thing? */ - HRESULT STDMETHODCALLTYPE CreateDXGIFactory1( - __in REFIID riid, - __out void **ppFactory + * Or perhaps what they actually mean is "only create a single factory in your application"? + * TODO: should we use a singleton here, so we never have multiple DXGI objects for the same thing? */ + HRESULT STDMETHODCALLTYPE CreateDXGIFactory1( + __in REFIID riid, + __out void **ppFactory ) { GalliumDXGIFactory* factory; @@ -1409,9 +1409,9 @@ void STDMETHODCALLTYPE GalliumDXGIMakeDefault() return hres; } - HRESULT STDMETHODCALLTYPE CreateDXGIFactory( - __in REFIID riid, - __out void **ppFactory + HRESULT STDMETHODCALLTYPE CreateDXGIFactory( + __in REFIID riid, + __out void **ppFactory ) { return CreateDXGIFactory1(riid, ppFactory); diff --git a/src/gallium/state_trackers/d3d1x/dxgid3d10/dxgid3d10.cpp b/src/gallium/state_trackers/d3d1x/dxgid3d10/dxgid3d10.cpp index dd00226134..3ab8cda191 100644 --- a/src/gallium/state_trackers/d3d1x/dxgid3d10/dxgid3d10.cpp +++ b/src/gallium/state_trackers/d3d1x/dxgid3d10/dxgid3d10.cpp @@ -30,13 +30,13 @@ #include #include -HRESULT D3D10CreateDevice1( +HRESULT D3D10CreateDevice1( __in_opt IDXGIAdapter *pAdapter, - __in D3D10_DRIVER_TYPE DriverType, - __in HMODULE Software, - __in unsigned Flags, - __in D3D10_FEATURE_LEVEL1 HardwareLevel, - __in unsigned SDKVersion, + __in D3D10_DRIVER_TYPE DriverType, + __in HMODULE Software, + __in unsigned Flags, + __in D3D10_FEATURE_LEVEL1 HardwareLevel, + __in unsigned SDKVersion, __out_opt ID3D10Device1 **ppDevice ) { @@ -87,7 +87,7 @@ HRESULT WINAPI D3D10CreateDeviceAndSwapChain1( D3D10_DRIVER_TYPE DriverType, HMODULE Software, unsigned Flags, - __in D3D10_FEATURE_LEVEL1 HardwareLevel, + __in D3D10_FEATURE_LEVEL1 HardwareLevel, unsigned SDKVersion, __in_opt DXGI_SWAP_CHAIN_DESC* pSwapChainDesc, __out_opt IDXGISwapChain** ppSwapChain, @@ -122,12 +122,12 @@ HRESULT WINAPI D3D10CreateDeviceAndSwapChain1( return hr; } -HRESULT D3D10CreateDevice( +HRESULT D3D10CreateDevice( __in_opt IDXGIAdapter *pAdapter, - __in D3D10_DRIVER_TYPE DriverType, - __in HMODULE Software, - __in unsigned Flags, - __in unsigned SDKVersion, + __in D3D10_DRIVER_TYPE DriverType, + __in HMODULE Software, + __in unsigned Flags, + __in unsigned SDKVersion, __out_opt ID3D10Device **ppDevice ) { diff --git a/src/gallium/state_trackers/d3d1x/dxgid3d11/dxgid3d11.cpp b/src/gallium/state_trackers/d3d1x/dxgid3d11/dxgid3d11.cpp index 86bb24baef..66f69bb730 100644 --- a/src/gallium/state_trackers/d3d1x/dxgid3d11/dxgid3d11.cpp +++ b/src/gallium/state_trackers/d3d1x/dxgid3d11/dxgid3d11.cpp @@ -30,17 +30,17 @@ #include #include -HRESULT D3D11CreateDevice( - __in_opt IDXGIAdapter *pAdapter, - __in D3D_DRIVER_TYPE DriverType, - __in HMODULE Software, - __in unsigned Flags, - __in_ecount_opt( FeatureLevels ) const D3D_FEATURE_LEVEL *pFeatureLevels, - __in unsigned FeatureLevels, - __in unsigned SDKVersion, - __out_opt ID3D11Device **ppDevice, - __out_opt D3D_FEATURE_LEVEL *pFeatureLevel, - __out_opt ID3D11DeviceContext **ppImmediateContext +HRESULT D3D11CreateDevice( + __in_opt IDXGIAdapter *pAdapter, + __in D3D_DRIVER_TYPE DriverType, + __in HMODULE Software, + __in unsigned Flags, + __in_ecount_opt( FeatureLevels ) const D3D_FEATURE_LEVEL *pFeatureLevels, + __in unsigned FeatureLevels, + __in unsigned SDKVersion, + __out_opt ID3D11Device **ppDevice, + __out_opt D3D_FEATURE_LEVEL *pFeatureLevel, + __out_opt ID3D11DeviceContext **ppImmediateContext ) { HRESULT hr; diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11.cpp b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11.cpp index 46a3905d8f..3d3990a63e 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11.cpp +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11.cpp @@ -168,23 +168,23 @@ struct GalliumD3D11Screen : public GalliumD3D11ScreenBase #if API < 11 // we use a D3D11-like API internally virtual HRESULT STDMETHODCALLTYPE Map( - __in ID3D11Resource *pResource, - __in unsigned Subresource, - __in D3D11_MAP MapType, - __in unsigned MapFlags, - __out D3D11_MAPPED_SUBRESOURCE *pMappedResource) = 0; + __in ID3D11Resource *pResource, + __in unsigned Subresource, + __in D3D11_MAP MapType, + __in unsigned MapFlags, + __out D3D11_MAPPED_SUBRESOURCE *pMappedResource) = 0; virtual void STDMETHODCALLTYPE Unmap( - __in ID3D11Resource *pResource, - __in unsigned Subresource) = 0; + __in ID3D11Resource *pResource, + __in unsigned Subresource) = 0; virtual void STDMETHODCALLTYPE Begin( - __in ID3D11Asynchronous *pAsync) = 0; + __in ID3D11Asynchronous *pAsync) = 0; virtual void STDMETHODCALLTYPE End( - __in ID3D11Asynchronous *pAsync) = 0; + __in ID3D11Asynchronous *pAsync) = 0; virtual HRESULT STDMETHODCALLTYPE GetData( - __in ID3D11Asynchronous *pAsync, - __out_bcount_opt(DataSize) void *pData, - __in unsigned DataSize, - __in unsigned GetDataFlags) = 0; + __in ID3D11Asynchronous *pAsync, + __out_bcount_opt(DataSize) void *pData, + __in unsigned DataSize, + __in unsigned GetDataFlags) = 0; // TODO: maybe we should use function overloading, but that might risk silent errors, // and cannot be exported to a C interface diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h index 3c789d3af0..04d5b86496 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h @@ -303,11 +303,11 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } #if API >= 11 #define SET_SHADER_EXTRA_ARGS , \ - __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, \ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, \ unsigned NumClassInstances #define GET_SHADER_EXTRA_ARGS , \ - __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, \ - __inout_opt unsigned *pNumClassInstances + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, \ + __inout_opt unsigned *pNumClassInstances #else #define SET_SHADER_EXTRA_ARGS #define GET_SHADER_EXTRA_ARGS @@ -396,65 +396,65 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl #define IMPLEMENT_SHADER_STAGE(XS, Stage) \ virtual void STDMETHODCALLTYPE XS##SetShader( \ - __in_opt ID3D11##Stage##Shader *pShader \ + __in_opt ID3D11##Stage##Shader *pShader \ SET_SHADER_EXTRA_ARGS) \ { \ SYNCHRONIZED; \ xs_set_shader((GalliumD3D11Shader<>*)pShader); \ } \ virtual void STDMETHODCALLTYPE XS##GetShader(\ - __out ID3D11##Stage##Shader **ppShader \ + __out ID3D11##Stage##Shader **ppShader \ GET_SHADER_EXTRA_ARGS) \ { \ SYNCHRONIZED; \ *ppShader = (ID3D11##Stage##Shader*)shaders[D3D11_STAGE_##XS].ref(); \ } \ virtual void STDMETHODCALLTYPE XS##SetConstantBuffers(\ - __in_range(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1) unsigned StartSlot, \ - __in_range(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot) unsigned NumBuffers, \ - __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) \ + __in_range(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1) unsigned StartSlot, \ + __in_range(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot) unsigned NumBuffers, \ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) \ { \ SYNCHRONIZED; \ xs_set_constant_buffers(StartSlot, NumBuffers, (GalliumD3D11Buffer *const *)ppConstantBuffers); \ } \ virtual void STDMETHODCALLTYPE XS##GetConstantBuffers(\ - __in_range(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1) unsigned StartSlot, \ - __in_range(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot) unsigned NumBuffers, \ - __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) \ + __in_range(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1) unsigned StartSlot, \ + __in_range(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot) unsigned NumBuffers, \ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) \ { \ SYNCHRONIZED; \ for(unsigned i = 0; i < NumBuffers; ++i) \ ppConstantBuffers[i] = constant_buffers[D3D11_STAGE_##XS][StartSlot + i].ref(); \ } \ virtual void STDMETHODCALLTYPE XS##SetShaderResources(\ - __in_range(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1) unsigned StartSlot, \ - __in_range(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot) unsigned NumViews, \ - __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) \ + __in_range(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1) unsigned StartSlot, \ + __in_range(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot) unsigned NumViews, \ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) \ { \ SYNCHRONIZED; \ xs_set_shader_resources(StartSlot, NumViews, (GalliumD3D11ShaderResourceView *const *)ppShaderResourceViews); \ } \ virtual void STDMETHODCALLTYPE XS##GetShaderResources(\ - __in_range(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1) unsigned StartSlot, \ - __in_range(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot) unsigned NumViews, \ - __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) \ + __in_range(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1) unsigned StartSlot, \ + __in_range(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot) unsigned NumViews, \ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) \ { \ SYNCHRONIZED; \ for(unsigned i = 0; i < NumViews; ++i) \ ppShaderResourceViews[i] = shader_resource_views[D3D11_STAGE_##XS][StartSlot + i].ref(); \ } \ virtual void STDMETHODCALLTYPE XS##SetSamplers(\ - __in_range(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1) unsigned StartSlot, \ - __in_range(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot) unsigned NumSamplers, \ - __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) \ + __in_range(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1) unsigned StartSlot, \ + __in_range(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot) unsigned NumSamplers, \ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) \ { \ SYNCHRONIZED; \ xs_set_samplers(StartSlot, NumSamplers, (GalliumD3D11SamplerState *const *)ppSamplers); \ } \ virtual void STDMETHODCALLTYPE XS##GetSamplers( \ - __in_range(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1) unsigned StartSlot, \ - __in_range(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot) unsigned NumSamplers, \ - __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) \ + __in_range(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1) unsigned StartSlot, \ + __in_range(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot) unsigned NumSamplers, \ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) \ { \ SYNCHRONIZED; \ for(unsigned i = 0; i < NumSamplers; ++i) \ @@ -477,10 +477,10 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl IMPLEMENT_SHADER_STAGE(CS, Compute) virtual void STDMETHODCALLTYPE CSSetUnorderedAccessViews( - __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1) unsigned StartSlot, - __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot) unsigned NumUAVs, - __in_ecount(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, - __in_ecount(NumUAVs) const unsigned *pUAVInitialCounts) + __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1) unsigned StartSlot, + __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot) unsigned NumUAVs, + __in_ecount(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, + __in_ecount(NumUAVs) const unsigned *pUAVInitialCounts) { SYNCHRONIZED; for(unsigned i = 0; i < NumUAVs; ++i) @@ -488,9 +488,9 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE CSGetUnorderedAccessViews( - __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1) unsigned StartSlot, - __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot) unsigned NumUAVs, - __out_ecount(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) + __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1) unsigned StartSlot, + __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot) unsigned NumUAVs, + __out_ecount(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) { SYNCHRONIZED; for(unsigned i = 0; i < NumUAVs; ++i) @@ -535,7 +535,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl if(s < caps.stages) { void* samplers_to_bind[PIPE_MAX_SAMPLERS]; - unsigned num_samplers_to_bind = shaders[s] ? shaders[s]->slot_to_sampler.size() : 0; + unsigned num_samplers_to_bind = shaders[s] ? shaders[s]->slot_to_sampler.size() : 0; for(unsigned i = 0; i < num_samplers_to_bind; ++i) { // index can be -1 to access sampler_csos[s].ld @@ -579,7 +579,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE IASetInputLayout( - __in_opt ID3D11InputLayout *pInputLayout) + __in_opt ID3D11InputLayout *pInputLayout) { SYNCHRONIZED; if(pInputLayout != input_layout.p) @@ -590,18 +590,18 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE IAGetInputLayout( - __out ID3D11InputLayout **ppInputLayout) + __out ID3D11InputLayout **ppInputLayout) { SYNCHRONIZED; *ppInputLayout = input_layout.ref(); } virtual void STDMETHODCALLTYPE IASetVertexBuffers( - __in_range(0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1) unsigned StartSlot, - __in_range(0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot) unsigned NumBuffers, - __in_ecount(NumBuffers) ID3D11Buffer *const *ppVertexBuffers, - __in_ecount(NumBuffers) const unsigned *pStrides, - __in_ecount(NumBuffers) const unsigned *pOffsets) + __in_range(0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1) unsigned StartSlot, + __in_range(0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot) unsigned NumBuffers, + __in_ecount(NumBuffers) ID3D11Buffer *const *ppVertexBuffers, + __in_ecount(NumBuffers) const unsigned *pStrides, + __in_ecount(NumBuffers) const unsigned *pOffsets) { SYNCHRONIZED; int last_different = -1; @@ -629,11 +629,11 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE IAGetVertexBuffers( - __in_range(0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1) unsigned StartSlot, - __in_range(0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot) unsigned NumBuffers, - __out_ecount_opt(NumBuffers) ID3D11Buffer **ppVertexBuffers, - __out_ecount_opt(NumBuffers) unsigned *pStrides, - __out_ecount_opt(NumBuffers) unsigned *pOffsets) + __in_range(0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1) unsigned StartSlot, + __in_range(0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot) unsigned NumBuffers, + __out_ecount_opt(NumBuffers) ID3D11Buffer **ppVertexBuffers, + __out_ecount_opt(NumBuffers) unsigned *pStrides, + __out_ecount_opt(NumBuffers) unsigned *pOffsets) { SYNCHRONIZED; if(ppVertexBuffers) @@ -677,9 +677,9 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE IASetIndexBuffer( - __in_opt ID3D11Buffer *pIndexBuffer, - __in DXGI_FORMAT Format, - __in unsigned Offset) + __in_opt ID3D11Buffer *pIndexBuffer, + __in DXGI_FORMAT Format, + __in unsigned Offset) { SYNCHRONIZED; if(index_buffer.p != pIndexBuffer || index_format != Format || index_offset != Offset) @@ -693,9 +693,9 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE IAGetIndexBuffer( - __out_opt ID3D11Buffer **pIndexBuffer, - __out_opt DXGI_FORMAT *Format, - __out_opt unsigned *Offset) + __out_opt ID3D11Buffer **pIndexBuffer, + __out_opt DXGI_FORMAT *Format, + __out_opt unsigned *Offset) { SYNCHRONIZED; if(pIndexBuffer) @@ -707,7 +707,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE IASetPrimitiveTopology( - __in D3D11_PRIMITIVE_TOPOLOGY Topology) + __in D3D11_PRIMITIVE_TOPOLOGY Topology) { SYNCHRONIZED; if(primitive_topology != Topology) @@ -721,16 +721,16 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE IAGetPrimitiveTopology( - __out D3D11_PRIMITIVE_TOPOLOGY *pTopology) + __out D3D11_PRIMITIVE_TOPOLOGY *pTopology) { SYNCHRONIZED; *pTopology = primitive_topology; } virtual void STDMETHODCALLTYPE DrawIndexed( - __in unsigned IndexCount, - __in unsigned StartIndexLocation, - __in int BaseVertexLocation) + __in unsigned IndexCount, + __in unsigned StartIndexLocation, + __in int BaseVertexLocation) { SYNCHRONIZED; if(update_flags) @@ -751,8 +751,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE Draw( - __in unsigned VertexCount, - __in unsigned StartVertexLocation) + __in unsigned VertexCount, + __in unsigned StartVertexLocation) { SYNCHRONIZED; if(update_flags) @@ -773,11 +773,11 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE DrawIndexedInstanced( - __in unsigned IndexCountPerInstance, - __in unsigned InstanceCount, - __in unsigned StartIndexLocation, - __in int BaseVertexLocation, - __in unsigned StartInstanceLocation) + __in unsigned IndexCountPerInstance, + __in unsigned InstanceCount, + __in unsigned StartIndexLocation, + __in int BaseVertexLocation, + __in unsigned StartInstanceLocation) { SYNCHRONIZED; if(update_flags) @@ -798,10 +798,10 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE DrawInstanced( - __in unsigned VertexCountPerInstance, - __in unsigned InstanceCount, - __in unsigned StartVertexLocation, - __in unsigned StartInstanceLocation) + __in unsigned VertexCountPerInstance, + __in unsigned InstanceCount, + __in unsigned StartVertexLocation, + __in unsigned StartInstanceLocation) { SYNCHRONIZED; if(update_flags) @@ -834,8 +834,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE DrawIndexedInstancedIndirect( - __in ID3D11Buffer *pBufferForArgs, - __in unsigned AlignedByteOffsetForArgs) + __in ID3D11Buffer *pBufferForArgs, + __in unsigned AlignedByteOffsetForArgs) { SYNCHRONIZED; if(update_flags) @@ -865,8 +865,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE DrawInstancedIndirect( - __in ID3D11Buffer *pBufferForArgs, - __in unsigned AlignedByteOffsetForArgs) + __in ID3D11Buffer *pBufferForArgs, + __in unsigned AlignedByteOffsetForArgs) { SYNCHRONIZED; if(update_flags) @@ -896,9 +896,9 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl #if API >= 11 virtual void STDMETHODCALLTYPE Dispatch( - __in unsigned ThreadGroupCountX, - __in unsigned ThreadGroupCountY, - __in unsigned ThreadGroupCountZ) + __in unsigned ThreadGroupCountX, + __in unsigned ThreadGroupCountY, + __in unsigned ThreadGroupCountZ) { // uncomment this when this is implemented // SYNCHRONIZED; @@ -907,8 +907,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE DispatchIndirect( - __in ID3D11Buffer *pBufferForArgs, - __in unsigned AlignedByteOffsetForArgs) + __in ID3D11Buffer *pBufferForArgs, + __in unsigned AlignedByteOffsetForArgs) { // uncomment this when this is implemented // SYNCHRONIZED; @@ -926,7 +926,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE RSSetState( - __in_opt ID3D11RasterizerState *pRasterizerState) + __in_opt ID3D11RasterizerState *pRasterizerState) { SYNCHRONIZED; if(pRasterizerState != rasterizer_state.p) @@ -943,7 +943,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE RSGetState( - __out ID3D11RasterizerState **ppRasterizerState) + __out ID3D11RasterizerState **ppRasterizerState) { SYNCHRONIZED; *ppRasterizerState = rasterizer_state.ref(); @@ -968,8 +968,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE RSSetViewports( - __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) unsigned NumViewports, - __in_ecount_opt(NumViewports) const D3D11_VIEWPORT *pViewports) + __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) unsigned NumViewports, + __in_ecount_opt(NumViewports) const D3D11_VIEWPORT *pViewports) { SYNCHRONIZED; if(NumViewports) @@ -992,8 +992,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE RSGetViewports( - __inout_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) unsigned *pNumViewports, - __out_ecount_opt(*pNumViewports) D3D11_VIEWPORT *pViewports) + __inout_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) unsigned *pNumViewports, + __out_ecount_opt(*pNumViewports) D3D11_VIEWPORT *pViewports) { SYNCHRONIZED; if(pViewports) @@ -1019,8 +1019,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE RSSetScissorRects( - __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) unsigned NumRects, - __in_ecount_opt(NumRects) const D3D11_RECT *pRects) + __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) unsigned NumRects, + __in_ecount_opt(NumRects) const D3D11_RECT *pRects) { SYNCHRONIZED; if(NumRects) @@ -1044,8 +1044,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE RSGetScissorRects( - __inout_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) unsigned *pNumRects, - __out_ecount_opt(*pNumRects) D3D11_RECT *pRects) + __inout_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) unsigned *pNumRects, + __out_ecount_opt(*pNumRects) D3D11_RECT *pRects) { SYNCHRONIZED; if(pRects) @@ -1061,9 +1061,9 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE OMSetBlendState( - __in_opt ID3D11BlendState *pBlendState, - __in_opt const float BlendFactor[ 4 ], - __in unsigned SampleMask) + __in_opt ID3D11BlendState *pBlendState, + __in_opt const float BlendFactor[ 4 ], + __in unsigned SampleMask) { SYNCHRONIZED; float white[4] = {1.0f, 1.0f, 1.0f, 1.0f}; @@ -1092,9 +1092,9 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE OMGetBlendState( - __out_opt ID3D11BlendState **ppBlendState, - __out_opt float BlendFactor[ 4 ], - __out_opt unsigned *pSampleMask) + __out_opt ID3D11BlendState **ppBlendState, + __out_opt float BlendFactor[ 4 ], + __out_opt unsigned *pSampleMask) { SYNCHRONIZED; if(ppBlendState) @@ -1114,8 +1114,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE OMSetDepthStencilState( - __in_opt ID3D11DepthStencilState *pDepthStencilState, - __in unsigned StencilRef) + __in_opt ID3D11DepthStencilState *pDepthStencilState, + __in unsigned StencilRef) { SYNCHRONIZED; if(pDepthStencilState != depth_stencil_state.p) @@ -1132,8 +1132,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl } virtual void STDMETHODCALLTYPE OMGetDepthStencilState( - __out_opt ID3D11DepthStencilState **ppDepthStencilState, - __out_opt unsigned *pStencilRef) + __out_opt ID3D11DepthStencilState **ppDepthStencilState, + __out_opt unsigned *pStencilRef) { SYNCHRONIZED; if(*ppDepthStencilState) @@ -1178,9 +1178,9 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl */ virtual void STDMETHODCALLTYPE OMSetRenderTargets( - __in_range(0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT) unsigned NumViews, - __in_ecount_opt(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews, - __in_opt ID3D11DepthStencilView *pDepthStencilView) + __in_range(0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT) unsigned NumViews, + __in_ecount_opt(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews, + __in_opt ID3D11DepthStencilView *pDepthStencilView) { SYNCHRONIZED; if(!ppRenderTargetViews) @@ -1211,9 +1211,9 @@ changed: } virtual void STDMETHODCALLTYPE OMGetRenderTargets( - __in_range(0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT) unsigned NumViews, - __out_ecount_opt(NumViews) ID3D11RenderTargetView **ppRenderTargetViews, - __out_opt ID3D11DepthStencilView **ppDepthStencilView) + __in_range(0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT) unsigned NumViews, + __out_ecount_opt(NumViews) ID3D11RenderTargetView **ppRenderTargetViews, + __out_opt ID3D11DepthStencilView **ppDepthStencilView) { SYNCHRONIZED; if(ppRenderTargetViews) @@ -1233,13 +1233,13 @@ changed: #if API >= 11 /* TODO: what is this supposed to do _exactly_? are we doing the right thing? */ virtual void STDMETHODCALLTYPE OMSetRenderTargetsAndUnorderedAccessViews( - __in unsigned NumRTVs, - __in_ecount_opt(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews, - __in_opt ID3D11DepthStencilView *pDepthStencilView, - __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1) unsigned UAVStartSlot, - __in unsigned NumUAVs, - __in_ecount_opt(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, - __in_ecount_opt(NumUAVs) const unsigned *pUAVInitialCounts) + __in unsigned NumRTVs, + __in_ecount_opt(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews, + __in_opt ID3D11DepthStencilView *pDepthStencilView, + __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1) unsigned UAVStartSlot, + __in unsigned NumUAVs, + __in_ecount_opt(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, + __in_ecount_opt(NumUAVs) const unsigned *pUAVInitialCounts) { SYNCHRONIZED; if(NumRTVs != D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL) @@ -1256,12 +1256,12 @@ changed: } virtual void STDMETHODCALLTYPE OMGetRenderTargetsAndUnorderedAccessViews( - __in_range(0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT) unsigned NumRTVs, - __out_ecount_opt(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews, - __out_opt ID3D11DepthStencilView **ppDepthStencilView, - __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1) unsigned UAVStartSlot, - __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot) unsigned NumUAVs, - __out_ecount_opt(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) + __in_range(0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT) unsigned NumRTVs, + __out_ecount_opt(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews, + __out_opt ID3D11DepthStencilView **ppDepthStencilView, + __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1) unsigned UAVStartSlot, + __in_range(0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot) unsigned NumUAVs, + __out_ecount_opt(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) { SYNCHRONIZED; if(ppRenderTargetViews) @@ -1276,9 +1276,9 @@ changed: #endif virtual void STDMETHODCALLTYPE SOSetTargets( - __in_range(0, D3D11_SO_BUFFER_SLOT_COUNT) unsigned NumBuffers, - __in_ecount_opt(NumBuffers) ID3D11Buffer *const *ppSOTargets, - __in_ecount_opt(NumBuffers) const unsigned *pOffsets) + __in_range(0, D3D11_SO_BUFFER_SLOT_COUNT) unsigned NumBuffers, + __in_ecount_opt(NumBuffers) ID3D11Buffer *const *ppSOTargets, + __in_ecount_opt(NumBuffers) const unsigned *pOffsets) { SYNCHRONIZED; unsigned i; @@ -1312,10 +1312,10 @@ changed: } virtual void STDMETHODCALLTYPE SOGetTargets( - __in_range(0, D3D11_SO_BUFFER_SLOT_COUNT) unsigned NumBuffers, - __out_ecount(NumBuffers) ID3D11Buffer **ppSOTargets + __in_range(0, D3D11_SO_BUFFER_SLOT_COUNT) unsigned NumBuffers, + __out_ecount(NumBuffers) ID3D11Buffer **ppSOTargets #if API < 11 - , __out_ecount(NumBuffers) UINT *pOffsets + , __out_ecount(NumBuffers) UINT *pOffsets #endif ) { @@ -1330,7 +1330,7 @@ changed: } virtual void STDMETHODCALLTYPE Begin( - __in ID3D11Asynchronous *pAsync) + __in ID3D11Asynchronous *pAsync) { SYNCHRONIZED; if(caps.queries) @@ -1338,7 +1338,7 @@ changed: } virtual void STDMETHODCALLTYPE End( - __in ID3D11Asynchronous *pAsync) + __in ID3D11Asynchronous *pAsync) { SYNCHRONIZED; if(caps.queries) @@ -1346,10 +1346,10 @@ changed: } virtual HRESULT STDMETHODCALLTYPE GetData( - __in ID3D11Asynchronous *pAsync, - __out_bcount_opt(DataSize) void *pData, - __in unsigned DataSize, - __in unsigned GetDataFlags) + __in ID3D11Asynchronous *pAsync, + __out_bcount_opt(DataSize) void *pData, + __in unsigned DataSize, + __in unsigned GetDataFlags) { SYNCHRONIZED; if(!caps.queries) @@ -1387,8 +1387,8 @@ changed: } virtual void STDMETHODCALLTYPE SetPredication( - __in_opt ID3D11Predicate *pPredicate, - __in BOOL PredicateValue) + __in_opt ID3D11Predicate *pPredicate, + __in BOOL PredicateValue) { SYNCHRONIZED; if(render_predicate.p != pPredicate || render_predicate_value != PredicateValue) @@ -1400,8 +1400,8 @@ changed: } virtual void STDMETHODCALLTYPE GetPredication( - __out_opt ID3D11Predicate **ppPredicate, - __out_opt BOOL *pPredicateValue) + __out_opt ID3D11Predicate **ppPredicate, + __out_opt BOOL *pPredicateValue) { SYNCHRONIZED; if(ppPredicate) @@ -1428,11 +1428,11 @@ changed: } virtual HRESULT STDMETHODCALLTYPE Map( - __in ID3D11Resource *pResource, - __in unsigned Subresource, - __in D3D11_MAP MapType, - __in unsigned MapFlags, - __out D3D11_MAPPED_SUBRESOURCE *pMappedResource) + __in ID3D11Resource *pResource, + __in unsigned Subresource, + __in D3D11_MAP MapType, + __in unsigned MapFlags, + __out D3D11_MAPPED_SUBRESOURCE *pMappedResource) { SYNCHRONIZED; GalliumD3D11Resource<>* resource = (GalliumD3D11Resource<>*)pResource; @@ -1472,8 +1472,8 @@ changed: } virtual void STDMETHODCALLTYPE Unmap( - __in ID3D11Resource *pResource, - __in unsigned Subresource) + __in ID3D11Resource *pResource, + __in unsigned Subresource) { SYNCHRONIZED; GalliumD3D11Resource<>* resource = (GalliumD3D11Resource<>*)pResource; @@ -1481,20 +1481,20 @@ changed: if(i != resource->transfers.end()) { pipe->transfer_unmap(pipe, i->second); - pipe->transfer_destroy(pipe, i->second); + pipe->transfer_destroy(pipe, i->second); resource->transfers.erase(i); } } virtual void STDMETHODCALLTYPE CopySubresourceRegion( - __in ID3D11Resource *pDstResource, - __in unsigned DstSubresource, - __in unsigned DstX, - __in unsigned DstY, - __in unsigned DstZ, - __in ID3D11Resource *pSrcResource, - __in unsigned SrcSubresource, - __in_opt const D3D11_BOX *pSrcBox) + __in ID3D11Resource *pDstResource, + __in unsigned DstSubresource, + __in unsigned DstX, + __in unsigned DstY, + __in unsigned DstZ, + __in ID3D11Resource *pSrcResource, + __in unsigned SrcSubresource, + __in_opt const D3D11_BOX *pSrcBox) { SYNCHRONIZED; GalliumD3D11Resource<>* dst = (GalliumD3D11Resource<>*)pDstResource; @@ -1512,8 +1512,8 @@ changed: } virtual void STDMETHODCALLTYPE CopyResource( - __in ID3D11Resource *pDstResource, - __in ID3D11Resource *pSrcResource) + __in ID3D11Resource *pDstResource, + __in ID3D11Resource *pSrcResource) { SYNCHRONIZED; GalliumD3D11Resource<>* dst = (GalliumD3D11Resource<>*)pDstResource; @@ -1540,12 +1540,12 @@ changed: } virtual void STDMETHODCALLTYPE UpdateSubresource( - __in ID3D11Resource *pDstResource, - __in unsigned DstSubresource, - __in_opt const D3D11_BOX *pDstBox, - __in const void *pSrcData, - __in unsigned SrcRowPitch, - __in unsigned SrcDepthPitch) + __in ID3D11Resource *pDstResource, + __in unsigned DstSubresource, + __in_opt const D3D11_BOX *pDstBox, + __in const void *pSrcData, + __in unsigned SrcRowPitch, + __in unsigned SrcDepthPitch) { SYNCHRONIZED; GalliumD3D11Resource<>* dst = (GalliumD3D11Resource<>*)pDstResource; @@ -1556,17 +1556,17 @@ changed: #if API >= 11 virtual void STDMETHODCALLTYPE CopyStructureCount( - __in ID3D11Buffer *pDstBuffer, - __in unsigned DstAlignedByteOffset, - __in ID3D11UnorderedAccessView *pSrcView) + __in ID3D11Buffer *pDstBuffer, + __in unsigned DstAlignedByteOffset, + __in ID3D11UnorderedAccessView *pSrcView) { SYNCHRONIZED; } #endif virtual void STDMETHODCALLTYPE ClearRenderTargetView( - __in ID3D11RenderTargetView *pRenderTargetView, - __in const float ColorRGBA[4]) + __in ID3D11RenderTargetView *pRenderTargetView, + __in const float ColorRGBA[4]) { SYNCHRONIZED; GalliumD3D11RenderTargetView* view = ((GalliumD3D11RenderTargetView*)pRenderTargetView); @@ -1574,10 +1574,10 @@ changed: } virtual void STDMETHODCALLTYPE ClearDepthStencilView( - __in ID3D11DepthStencilView *pDepthStencilView, - __in unsigned ClearFlags, - __in float Depth, - __in UINT8 Stencil) + __in ID3D11DepthStencilView *pDepthStencilView, + __in unsigned ClearFlags, + __in float Depth, + __in UINT8 Stencil) { SYNCHRONIZED; GalliumD3D11DepthStencilView* view = ((GalliumD3D11DepthStencilView*)pDepthStencilView); @@ -1591,15 +1591,15 @@ changed: #if API >= 11 virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewUint( - __in ID3D11UnorderedAccessView *pUnorderedAccessView, - __in const unsigned Values[ 4 ]) + __in ID3D11UnorderedAccessView *pUnorderedAccessView, + __in const unsigned Values[ 4 ]) { SYNCHRONIZED; } virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewFloat( - __in ID3D11UnorderedAccessView *pUnorderedAccessView, - __in const float Values[ 4 ]) + __in ID3D11UnorderedAccessView *pUnorderedAccessView, + __in const float Values[ 4 ]) { SYNCHRONIZED; } @@ -1631,7 +1631,7 @@ changed: } virtual void STDMETHODCALLTYPE GenerateMips( - __in ID3D11ShaderResourceView *pShaderResourceView) + __in ID3D11ShaderResourceView *pShaderResourceView) { SYNCHRONIZED; @@ -1675,7 +1675,7 @@ changed: #if API >= 11 /* TODO: hack SRVs or sampler states to handle this, or add to Gallium */ virtual void STDMETHODCALLTYPE SetResourceMinLOD( - __in ID3D11Resource *pResource, + __in ID3D11Resource *pResource, float MinLOD) { SYNCHRONIZED; @@ -1688,7 +1688,7 @@ changed: } virtual float STDMETHODCALLTYPE GetResourceMinLOD( - __in ID3D11Resource *pResource) + __in ID3D11Resource *pResource) { SYNCHRONIZED; GalliumD3D11Resource<>* resource = (GalliumD3D11Resource<>*)pResource; @@ -1697,11 +1697,11 @@ changed: #endif virtual void STDMETHODCALLTYPE ResolveSubresource( - __in ID3D11Resource *pDstResource, - __in unsigned DstSubresource, - __in ID3D11Resource *pSrcResource, - __in unsigned SrcSubresource, - __in DXGI_FORMAT Format) + __in ID3D11Resource *pDstResource, + __in unsigned DstSubresource, + __in ID3D11Resource *pSrcResource, + __in unsigned SrcSubresource, + __in DXGI_FORMAT Format) { SYNCHRONIZED; GalliumD3D11Resource<>* dst = (GalliumD3D11Resource<>*)pDstResource; @@ -1713,7 +1713,7 @@ changed: #if API >= 11 virtual void STDMETHODCALLTYPE ExecuteCommandList( - __in ID3D11CommandList *pCommandList, + __in ID3D11CommandList *pCommandList, BOOL RestoreContextState) { SYNCHRONIZED; @@ -1721,7 +1721,7 @@ changed: virtual HRESULT STDMETHODCALLTYPE FinishCommandList( BOOL RestoreDeferredContextState, - __out_opt ID3D11CommandList **ppCommandList) + __out_opt ID3D11CommandList **ppCommandList) { SYNCHRONIZED; return E_NOTIMPL; diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_misc.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_misc.h index f31b54ba8f..f5cfd0cfab 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_misc.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_misc.h @@ -1,12 +1,12 @@ #if API < 11 extern "C" HRESULT STDMETHODCALLTYPE D3D10CreateBlob( - __in SIZE_T NumBytes, - __out LPD3D10BLOB *ppBuffer + __in SIZE_T NumBytes, + __out LPD3D10BLOB *ppBuffer ); HRESULT STDMETHODCALLTYPE D3D10CreateBlob( - __in SIZE_T NumBytes, - __out LPD3D10BLOB *ppBuffer + __in SIZE_T NumBytes, + __out LPD3D10BLOB *ppBuffer ) { void* data = malloc(NumBytes); @@ -17,21 +17,21 @@ HRESULT STDMETHODCALLTYPE D3D10CreateBlob( } LPCSTR STDMETHODCALLTYPE D3D10GetPixelShaderProfile( - __in ID3D10Device *pDevice + __in ID3D10Device *pDevice ) { return "ps_4_0"; } LPCSTR STDMETHODCALLTYPE D3D10GetVertexShaderProfile( - __in ID3D10Device *pDevice + __in ID3D10Device *pDevice ) { return "vs_4_0"; } LPCSTR STDMETHODCALLTYPE D3D10GetGeometryShaderProfile( - __in ID3D10Device *pDevice + __in ID3D10Device *pDevice ) { return "gs_4_0"; @@ -46,10 +46,10 @@ static HRESULT dxbc_assemble_as_blob(struct dxbc_chunk_header** chunks, unsigned return S_OK; } -HRESULT D3D10GetInputSignatureBlob( - __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, - __out ID3D10Blob **ppSignatureBlob +HRESULT D3D10GetInputSignatureBlob( + __in const void *pShaderBytecode, + __in SIZE_T BytecodeLength, + __out ID3D10Blob **ppSignatureBlob ) { dxbc_chunk_signature* sig = dxbc_find_signature(pShaderBytecode, BytecodeLength, false); @@ -59,10 +59,10 @@ HRESULT D3D10GetInputSignatureBlob( return dxbc_assemble_as_blob((dxbc_chunk_header**)&sig, 1, ppSignatureBlob); } -HRESULT D3D10GetOutputSignatureBlob( - __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, - __out ID3D10Blob **ppSignatureBlob +HRESULT D3D10GetOutputSignatureBlob( + __in const void *pShaderBytecode, + __in SIZE_T BytecodeLength, + __out ID3D10Blob **ppSignatureBlob ) { dxbc_chunk_signature* sig = dxbc_find_signature(pShaderBytecode, BytecodeLength, true); @@ -72,10 +72,10 @@ HRESULT D3D10GetOutputSignatureBlob( return dxbc_assemble_as_blob((dxbc_chunk_header**)&sig, 1, ppSignatureBlob); } -HRESULT D3D10GetInputAndOutputSignatureBlob( - __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, - __out ID3D10Blob **ppSignatureBlob +HRESULT D3D10GetInputAndOutputSignatureBlob( + __in const void *pShaderBytecode, + __in SIZE_T BytecodeLength, + __out ID3D10Blob **ppSignatureBlob ) { dxbc_chunk_signature* sigs[2]; diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_objects.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_objects.h index b7542fd30e..0cf2cf3cf7 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_objects.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_objects.h @@ -71,8 +71,8 @@ struct GalliumD3D11DeviceChild : public GalliumPrivateDataComObjectAddRef(); *ppDevice = device; @@ -242,7 +242,7 @@ struct GalliumD3D11ResourceBase : public GalliumD3D11DeviceChild unsigned eviction_priority; virtual void STDMETHODCALLTYPE SetEvictionPriority( - __in unsigned EvictionPriority) + __in unsigned EvictionPriority) { eviction_priority = EvictionPriority; } @@ -257,7 +257,7 @@ template struct GalliumDXGIResource : public IDXGIResource { virtual HRESULT STDMETHODCALLTYPE SetEvictionPriority( - __in unsigned EvictionPriority) + __in unsigned EvictionPriority) { static_cast(this)->eviction_priority = EvictionPriority; return S_OK; @@ -265,13 +265,13 @@ struct GalliumDXGIResource : public IDXGIResource virtual HRESULT STDMETHODCALLTYPE GetEvictionPriority(unsigned* pEvictionPriority) { - *pEvictionPriority = static_cast(this)->eviction_priority; - return S_OK; + *pEvictionPriority = static_cast(this)->eviction_priority; + return S_OK; } virtual HRESULT STDMETHODCALLTYPE GetDevice( - __in REFIID riid, - __out void **ppParent) + __in REFIID riid, + __out void **ppParent) { if(!static_cast(this)->device) return E_NOINTERFACE; @@ -279,8 +279,8 @@ struct GalliumDXGIResource : public IDXGIResource } virtual HRESULT STDMETHODCALLTYPE GetParent( - __in REFIID riid, - __out void **ppParent) + __in REFIID riid, + __out void **ppParent) { if(!static_cast(this)->device) return E_NOINTERFACE; @@ -322,8 +322,8 @@ struct GalliumD3D11Resource } virtual HRESULT STDMETHODCALLTYPE GetUsage( - __out DXGI_USAGE *pUsage - ) + __out DXGI_USAGE *pUsage + ) { *pUsage = this->dxgi_usage; return S_OK; @@ -349,7 +349,7 @@ struct GalliumD3D11TypedResource : public GalliumD3D11Resource : GalliumD3D11Resource(device, resource, dxgi_usage), desc(desc) {} virtual void STDMETHODCALLTYPE GetType( - __out D3D11_RESOURCE_DIMENSION *pResourceDimension) + __out D3D11_RESOURCE_DIMENSION *pResourceDimension) { *pResourceDimension = Dim; } @@ -381,23 +381,23 @@ struct GalliumD3D10Buffer : public GalliumD3D10BufferBase device->UnbindBuffer(this); } - virtual HRESULT STDMETHODCALLTYPE Map( - __in D3D10_MAP MapType, - __in unsigned MapFlags, - __out void **ppData) - { - D3D10_MAPPED_SUBRESOURCE msr; - HRESULT hr = device->Map(this, 0, MapType, MapFlags, &msr); - if(!SUCCEEDED(hr)) - return hr; - *ppData = msr.pData; - return S_OK; - } - - virtual void STDMETHODCALLTYPE Unmap() - { - device->Unmap(this, 0); - } + virtual HRESULT STDMETHODCALLTYPE Map( + __in D3D10_MAP MapType, + __in unsigned MapFlags, + __out void **ppData) + { + D3D10_MAPPED_SUBRESOURCE msr; + HRESULT hr = device->Map(this, 0, MapType, MapFlags, &msr); + if(!SUCCEEDED(hr)) + return hr; + *ppData = msr.pData; + return S_OK; + } + + virtual void STDMETHODCALLTYPE Unmap() + { + device->Unmap(this, 0); + } }; struct GalliumD3D10Texture1D : public GalliumD3D10Texture1DBase @@ -407,25 +407,25 @@ struct GalliumD3D10Texture1D : public GalliumD3D10Texture1DBase {} virtual HRESULT STDMETHODCALLTYPE Map( - __in unsigned Subresource, - __in D3D10_MAP MapType, - __in unsigned MapFlags, - __out void **ppData) - { - D3D10_MAPPED_SUBRESOURCE msr; - HRESULT hr = device->Map(this, Subresource, MapType, MapFlags, &msr); - if(!SUCCEEDED(hr)) - return hr; - *ppData = msr.pData; - return S_OK; - } - - virtual void STDMETHODCALLTYPE Unmap( - __in unsigned Subresource - ) - { - device->Unmap(this, Subresource); - } + __in unsigned Subresource, + __in D3D10_MAP MapType, + __in unsigned MapFlags, + __out void **ppData) + { + D3D10_MAPPED_SUBRESOURCE msr; + HRESULT hr = device->Map(this, Subresource, MapType, MapFlags, &msr); + if(!SUCCEEDED(hr)) + return hr; + *ppData = msr.pData; + return S_OK; + } + + virtual void STDMETHODCALLTYPE Unmap( + __in unsigned Subresource + ) + { + device->Unmap(this, Subresource); + } }; struct GalliumD3D10Texture2D : public GalliumD3D10Texture2DBase @@ -436,26 +436,26 @@ struct GalliumD3D10Texture2D : public GalliumD3D10Texture2DBase {} virtual HRESULT STDMETHODCALLTYPE Map( - __in unsigned Subresource, - __in D3D10_MAP MapType, - __in unsigned MapFlags, - __out D3D10_MAPPED_TEXTURE2D *pMappedTex2D) - { - D3D10_MAPPED_SUBRESOURCE msr; - HRESULT hr = device->Map(this, Subresource, MapType, MapFlags, &msr); - if(!SUCCEEDED(hr)) - return hr; - pMappedTex2D->pData = msr.pData; - pMappedTex2D->RowPitch = msr.RowPitch; - return S_OK; - } - - virtual void STDMETHODCALLTYPE Unmap( - __in unsigned Subresource - ) - { - device->Unmap(this, Subresource); - } + __in unsigned Subresource, + __in D3D10_MAP MapType, + __in unsigned MapFlags, + __out D3D10_MAPPED_TEXTURE2D *pMappedTex2D) + { + D3D10_MAPPED_SUBRESOURCE msr; + HRESULT hr = device->Map(this, Subresource, MapType, MapFlags, &msr); + if(!SUCCEEDED(hr)) + return hr; + pMappedTex2D->pData = msr.pData; + pMappedTex2D->RowPitch = msr.RowPitch; + return S_OK; + } + + virtual void STDMETHODCALLTYPE Unmap( + __in unsigned Subresource + ) + { + device->Unmap(this, Subresource); + } }; @@ -466,27 +466,27 @@ struct GalliumD3D10Texture3D : public GalliumD3D10Texture3DBase {} virtual HRESULT STDMETHODCALLTYPE Map( - __in unsigned Subresource, - __in D3D10_MAP MapType, - __in unsigned MapFlags, - __out D3D10_MAPPED_TEXTURE3D *pMappedTex3D) - { - D3D10_MAPPED_SUBRESOURCE msr; - HRESULT hr = device->Map(this, Subresource, MapType, MapFlags, &msr); - if(!SUCCEEDED(hr)) - return hr; - pMappedTex3D->pData = msr.pData; - pMappedTex3D->RowPitch = msr.RowPitch; - pMappedTex3D->DepthPitch = msr.DepthPitch; - return S_OK; - } - - virtual void STDMETHODCALLTYPE Unmap( - __in unsigned Subresource - ) - { - device->Unmap(this, Subresource); - } + __in unsigned Subresource, + __in D3D10_MAP MapType, + __in unsigned MapFlags, + __out D3D10_MAPPED_TEXTURE3D *pMappedTex3D) + { + D3D10_MAPPED_SUBRESOURCE msr; + HRESULT hr = device->Map(this, Subresource, MapType, MapFlags, &msr); + if(!SUCCEEDED(hr)) + return hr; + pMappedTex3D->pData = msr.pData; + pMappedTex3D->RowPitch = msr.RowPitch; + pMappedTex3D->DepthPitch = msr.DepthPitch; + return S_OK; + } + + virtual void STDMETHODCALLTYPE Unmap( + __in unsigned Subresource + ) + { + device->Unmap(this, Subresource); + } }; #endif @@ -502,7 +502,7 @@ struct GalliumD3D11Surface : public GalliumMultiPrivateDataComObjectFormat = this->desc.Format; pDesc->Width = this->desc.Width; @@ -512,8 +512,8 @@ struct GalliumD3D11Surface : public GalliumMultiPrivateDataComObject } virtual HRESULT STDMETHODCALLTYPE GetData( - __out_bcount(DataSize) void *pData, - __in unsigned DataSize, - __in unsigned GetDataFlags) + __out_bcount(DataSize) void *pData, + __in unsigned DataSize, + __in unsigned GetDataFlags) { return this->device->GetData(this, pData, DataSize, GetDataFlags); } @@ -675,7 +675,7 @@ struct GalliumD3D11QueryOrPredicate : public GalliumD3D11Asynchronous {} virtual void STDMETHODCALLTYPE GetDesc( - __out D3D11_QUERY_DESC *pDesc) + __out D3D11_QUERY_DESC *pDesc) { *pDesc = desc; } @@ -708,7 +708,7 @@ struct GalliumD3D11Counter : public GalliumD3D11Asynchronous {} virtual void STDMETHODCALLTYPE GetDesc( - __out D3D11_COUNTER_DESC *pDesc) + __out D3D11_COUNTER_DESC *pDesc) { *pDesc = desc; } diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h index 0c8d3ed943..eea0e21f20 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h @@ -32,7 +32,7 @@ static unsigned caps_dx_9_1[] = { UTIL_CHECK_INT(MAX_RENDER_TARGETS, 1), UTIL_CHECK_INT(MAX_TEXTURE_2D_LEVELS, 12), /* 2048 */ UTIL_CHECK_INT(MAX_TEXTURE_3D_LEVELS, 8), /* 256 */ - UTIL_CHECK_INT(MAX_TEXTURE_CUBE_LEVELS, 10), /* 512 */ + UTIL_CHECK_INT(MAX_TEXTURE_CUBE_LEVELS, 10), /* 512 */ UTIL_CHECK_TERMINATE }; @@ -45,7 +45,7 @@ static unsigned caps_dx_9_2[] = { UTIL_CHECK_INT(MAX_RENDER_TARGETS, 1), UTIL_CHECK_INT(MAX_TEXTURE_2D_LEVELS, 12), /* 2048 */ UTIL_CHECK_INT(MAX_TEXTURE_3D_LEVELS, 9), /* 256 */ - UTIL_CHECK_INT(MAX_TEXTURE_CUBE_LEVELS, 10), /* 512 */ + UTIL_CHECK_INT(MAX_TEXTURE_CUBE_LEVELS, 10), /* 512 */ UTIL_CHECK_TERMINATE }; @@ -61,7 +61,7 @@ static unsigned caps_dx_9_3[] = { UTIL_CHECK_INT(MAX_RENDER_TARGETS, 4), UTIL_CHECK_INT(MAX_TEXTURE_2D_LEVELS, 13), /* 4096 */ UTIL_CHECK_INT(MAX_TEXTURE_3D_LEVELS, 9), /* 256 */ - UTIL_CHECK_INT(MAX_TEXTURE_CUBE_LEVELS, 10), /* 512 */ + UTIL_CHECK_INT(MAX_TEXTURE_CUBE_LEVELS, 10), /* 512 */ UTIL_CHECK_TERMINATE }; @@ -166,7 +166,7 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #if API >= 11 virtual void STDMETHODCALLTYPE GetImmediateContext( - __out ID3D11DeviceContext **ppImmediateContext) + __out ID3D11DeviceContext **ppImmediateContext) { immediate_context->AddRef(); *ppImmediateContext = immediate_context; @@ -185,21 +185,21 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CheckCounter( - __in const D3D11_COUNTER_DESC *pDesc, - __out D3D11_COUNTER_TYPE *pType, - __out unsigned *pActiveCounters, - __out_ecount_opt(*pNameLength) LPSTR szName, - __inout_opt unsigned *pNameLength, - __out_ecount_opt(*pUnitsLength) LPSTR szUnits, - __inout_opt unsigned *pUnitsLength, - __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, - __inout_opt unsigned *pDescriptionLength) + __in const D3D11_COUNTER_DESC *pDesc, + __out D3D11_COUNTER_TYPE *pType, + __out unsigned *pActiveCounters, + __out_ecount_opt(*pNameLength) LPSTR szName, + __inout_opt unsigned *pNameLength, + __out_ecount_opt(*pUnitsLength) LPSTR szUnits, + __inout_opt unsigned *pUnitsLength, + __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, + __inout_opt unsigned *pDescriptionLength) { return E_NOTIMPL; } virtual void STDMETHODCALLTYPE CheckCounterInfo( - __out D3D11_COUNTER_INFO *pCounterInfo) + __out D3D11_COUNTER_INFO *pCounterInfo) { /* none supported at the moment */ pCounterInfo->LastDeviceDependentCounter = (D3D11_COUNTER)0; @@ -210,7 +210,7 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #if API >= 11 virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport( D3D11_FEATURE Feature, - __out_bcount(FeatureSupportDataSize) void *pFeatureSupportData, + __out_bcount(FeatureSupportDataSize) void *pFeatureSupportData, unsigned FeatureSupportDataSize) { SYNCHRONIZED; @@ -360,13 +360,13 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #if API >= 11 virtual HRESULT STDMETHODCALLTYPE CreateBlendState( - __in const D3D11_BLEND_DESC *pBlendStateDesc, - __out_opt ID3D11BlendState **ppBlendState + __in const D3D11_BLEND_DESC *pBlendStateDesc, + __out_opt ID3D11BlendState **ppBlendState ) #else virtual HRESULT STDMETHODCALLTYPE CreateBlendState1( - __in const D3D10_BLEND_DESC1 *pBlendStateDesc, - __out_opt ID3D10BlendState1 **ppBlendState + __in const D3D10_BLEND_DESC1 *pBlendStateDesc, + __out_opt ID3D10BlendState1 **ppBlendState ) #endif { @@ -379,12 +379,12 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen assert(PIPE_MAX_COLOR_BUFS >= 8); for(unsigned i = 0; i < 8; ++i) { - if(!convert_blend_state( - state.rt[i], - pBlendStateDesc->RenderTarget[i], - pBlendStateDesc->RenderTarget[i].BlendEnable, - pBlendStateDesc->RenderTarget[i].RenderTargetWriteMask)) - return E_INVALIDARG; + if(!convert_blend_state( + state.rt[i], + pBlendStateDesc->RenderTarget[i], + pBlendStateDesc->RenderTarget[i].BlendEnable, + pBlendStateDesc->RenderTarget[i].RenderTargetWriteMask)) + return E_INVALIDARG; } if(!ppBlendState) @@ -400,8 +400,8 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #if API < 11 virtual HRESULT STDMETHODCALLTYPE CreateBlendState( - __in const D3D10_BLEND_DESC *pBlendStateDesc, - __out_opt ID3D10BlendState **ppBlendState + __in const D3D10_BLEND_DESC *pBlendStateDesc, + __out_opt ID3D10BlendState **ppBlendState ) { SYNCHRONIZED; @@ -439,8 +439,8 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #endif virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilState( - __in const D3D11_DEPTH_STENCIL_DESC *pDepthStencilStateDesc, - __out_opt ID3D11DepthStencilState **ppDepthStencilState + __in const D3D11_DEPTH_STENCIL_DESC *pDepthStencilStateDesc, + __out_opt ID3D11DepthStencilState **ppDepthStencilState ) { SYNCHRONIZED; @@ -477,8 +477,8 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState( - __in const D3D11_RASTERIZER_DESC *pRasterizerDesc, - __out_opt ID3D11RasterizerState **ppRasterizerState) + __in const D3D11_RASTERIZER_DESC *pRasterizerDesc, + __out_opt ID3D11RasterizerState **ppRasterizerState) { SYNCHRONIZED; @@ -487,13 +487,13 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen state.gl_rasterization_rules = 1; /* D3D10/11 use GL rules */ state.fill_front = state.fill_back = (pRasterizerDesc->FillMode == D3D11_FILL_WIREFRAME) ? PIPE_POLYGON_MODE_LINE : PIPE_POLYGON_MODE_FILL; if(pRasterizerDesc->CullMode == D3D11_CULL_FRONT) - state.cull_face = PIPE_FACE_FRONT; + state.cull_face = PIPE_FACE_FRONT; else if(pRasterizerDesc->CullMode == D3D11_CULL_BACK) - state.cull_face = PIPE_FACE_BACK; + state.cull_face = PIPE_FACE_BACK; else - state.cull_face = PIPE_FACE_NONE; + state.cull_face = PIPE_FACE_NONE; state.front_ccw = !!pRasterizerDesc->FrontCounterClockwise; - /* TODO: is this correct? */ + /* TODO: is this correct? */ /* TODO: we are ignoring DepthBiasClamp! */ state.offset_tri = state.offset_line = state.offset_point = pRasterizerDesc->SlopeScaledDepthBias || pRasterizerDesc->DepthBias; state.offset_scale = pRasterizerDesc->SlopeScaledDepthBias; @@ -517,8 +517,8 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreateSamplerState( - __in const D3D11_SAMPLER_DESC *pSamplerDesc, - __out_opt ID3D11SamplerState **ppSamplerState) + __in const D3D11_SAMPLER_DESC *pSamplerDesc, + __out_opt ID3D11SamplerState **ppSamplerState) { SYNCHRONIZED; @@ -555,11 +555,11 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreateInputLayout( - __in_ecount(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs, - __in_range(0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT) unsigned NumElements, - __in const void *pShaderBytecodeWithInputSignature, - __in SIZE_T BytecodeLength, - __out_opt ID3D11InputLayout **ppInputLayout) + __in_ecount(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs, + __in_range(0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT) unsigned NumElements, + __in const void *pShaderBytecodeWithInputSignature, + __in SIZE_T BytecodeLength, + __out_opt ID3D11InputLayout **ppInputLayout) { SYNCHRONIZED; @@ -738,9 +738,9 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreateTexture1D( - __in const D3D11_TEXTURE1D_DESC *pDesc, - __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, - __out_opt ID3D11Texture1D **ppTexture1D) + __in const D3D11_TEXTURE1D_DESC *pDesc, + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, + __out_opt ID3D11Texture1D **ppTexture1D) { SYNCHRONIZED; @@ -754,9 +754,9 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreateTexture2D( - __in const D3D11_TEXTURE2D_DESC *pDesc, - __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, - __out_opt ID3D11Texture2D **ppTexture2D) + __in const D3D11_TEXTURE2D_DESC *pDesc, + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, + __out_opt ID3D11Texture2D **ppTexture2D) { SYNCHRONIZED; @@ -773,9 +773,9 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreateTexture3D( - __in const D3D11_TEXTURE3D_DESC *pDesc, - __in_xcount_opt(pDesc->MipLevels) const D3D11_SUBRESOURCE_DATA *pInitialData, - __out_opt ID3D11Texture3D **ppTexture3D) + __in const D3D11_TEXTURE3D_DESC *pDesc, + __in_xcount_opt(pDesc->MipLevels) const D3D11_SUBRESOURCE_DATA *pInitialData, + __out_opt ID3D11Texture3D **ppTexture3D) { SYNCHRONIZED; @@ -789,9 +789,9 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreateBuffer( - __in const D3D11_BUFFER_DESC *pDesc, - __in_opt const D3D11_SUBRESOURCE_DATA *pInitialData, - __out_opt ID3D11Buffer **ppBuffer) + __in const D3D11_BUFFER_DESC *pDesc, + __in_opt const D3D11_SUBRESOURCE_DATA *pInitialData, + __out_opt ID3D11Buffer **ppBuffer) { SYNCHRONIZED; @@ -809,8 +809,8 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE OpenGalliumResource( - __in struct pipe_resource* resource, - __out IUnknown** dxgi_resource) + __in struct pipe_resource* resource, + __out IUnknown** dxgi_resource) { SYNCHRONIZED; @@ -845,11 +845,11 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreateSurface( - __in const DXGI_SURFACE_DESC *pDesc, + __in const DXGI_SURFACE_DESC *pDesc, unsigned NumSurfaces, DXGI_USAGE Usage, - __in_opt const DXGI_SHARED_RESOURCE *pSharedResource, - __out IDXGISurface **ppSurface) + __in_opt const DXGI_SHARED_RESOURCE *pSharedResource, + __out IDXGISurface **ppSurface) { SYNCHRONIZED; @@ -882,9 +882,9 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView( - __in ID3D11Resource *pResource, - __in_opt const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc, - __out_opt ID3D11ShaderResourceView **ppSRView) + __in ID3D11Resource *pResource, + __in_opt const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc, + __out_opt ID3D11ShaderResourceView **ppSRView) { #if API >= 11 D3D11_SHADER_RESOURCE_VIEW_DESC def_desc; @@ -898,9 +898,9 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView1( - __in ID3D11Resource *pResource, - __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc, - __out_opt ID3D10ShaderResourceView1 **ppSRView) + __in ID3D11Resource *pResource, + __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc, + __out_opt ID3D10ShaderResourceView1 **ppSRView) { D3D10_SHADER_RESOURCE_VIEW_DESC1 def_desc; #endif @@ -988,9 +988,9 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #if API >= 11 virtual HRESULT STDMETHODCALLTYPE CreateUnorderedAccessView( - __in ID3D11Resource *pResource, - __in_opt const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc, - __out_opt ID3D11UnorderedAccessView **ppUAView) + __in ID3D11Resource *pResource, + __in_opt const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc, + __out_opt ID3D11UnorderedAccessView **ppUAView) { SYNCHRONIZED; @@ -1001,9 +1001,9 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #endif virtual HRESULT STDMETHODCALLTYPE CreateRenderTargetView( - __in ID3D11Resource *pResource, - __in_opt const D3D11_RENDER_TARGET_VIEW_DESC *pDesc, - __out_opt ID3D11RenderTargetView **ppRTView) + __in ID3D11Resource *pResource, + __in_opt const D3D11_RENDER_TARGET_VIEW_DESC *pDesc, + __out_opt ID3D11RenderTargetView **ppRTView) { SYNCHRONIZED; @@ -1092,9 +1092,9 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilView( - __in ID3D11Resource *pResource, - __in_opt const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc, - __out_opt ID3D11DepthStencilView **ppDepthStencilView) + __in ID3D11Resource *pResource, + __in_opt const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc, + __out_opt ID3D11DepthStencilView **ppDepthStencilView) { SYNCHRONIZED; @@ -1168,7 +1168,7 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen GalliumD3D11Shader<>* create_stage_shader(unsigned type, const void *pShaderBytecode, SIZE_T BytecodeLength #if API >= 11 - , __in_opt ID3D11ClassLinkage *pClassLinkage + , __in_opt ID3D11ClassLinkage *pClassLinkage #endif ) { @@ -1221,21 +1221,21 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #if API >= 11 #define CREATE_SHADER_ARGS \ - __in const void *pShaderBytecode, \ - __in SIZE_T BytecodeLength, \ - __in_opt ID3D11ClassLinkage *pClassLinkage + __in const void *pShaderBytecode, \ + __in SIZE_T BytecodeLength, \ + __in_opt ID3D11ClassLinkage *pClassLinkage #define PASS_SHADER_ARGS pShaderBytecode, BytecodeLength, pClassLinkage #else #define CREATE_SHADER_ARGS \ - __in const void *pShaderBytecode, \ - __in SIZE_T BytecodeLength + __in const void *pShaderBytecode, \ + __in SIZE_T BytecodeLength #define PASS_SHADER_ARGS pShaderBytecode, BytecodeLength #endif #define IMPLEMENT_CREATE_SHADER(Stage, GALLIUM) \ virtual HRESULT STDMETHODCALLTYPE Create##Stage##Shader( \ CREATE_SHADER_ARGS, \ - __out_opt ID3D11##Stage##Shader **pp##Stage##Shader) \ + __out_opt ID3D11##Stage##Shader **pp##Stage##Shader) \ { \ SYNCHRONIZED; \ GalliumD3D11##Stage##Shader* shader = (GalliumD3D11##Stage##Shader*)create_stage_shader(PIPE_SHADER_##GALLIUM, PASS_SHADER_ARGS); \ @@ -1256,7 +1256,7 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #define IMPLEMENT_NOTIMPL_CREATE_SHADER(Stage) \ virtual HRESULT STDMETHODCALLTYPE Create##Stage##Shader( \ CREATE_SHADER_ARGS, \ - __out_opt ID3D11##Stage##Shader **pp##Stage##Shader) \ + __out_opt ID3D11##Stage##Shader **pp##Stage##Shader) \ { \ return E_NOTIMPL; \ } @@ -1271,19 +1271,19 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #endif virtual HRESULT STDMETHODCALLTYPE CreateGeometryShaderWithStreamOutput( - __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, - __in_ecount_opt(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration, - __in_range(0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT) unsigned NumEntries, + __in const void *pShaderBytecode, + __in SIZE_T BytecodeLength, + __in_ecount_opt(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration, + __in_range(0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT) unsigned NumEntries, #if API >= 11 - __in_ecount_opt(NumStrides) const unsigned *pBufferStrides, - __in_range(0, D3D11_SO_BUFFER_SLOT_COUNT) unsigned NumStrides, - __in unsigned RasterizedStream, - __in_opt ID3D11ClassLinkage *pClassLinkage, + __in_ecount_opt(NumStrides) const unsigned *pBufferStrides, + __in_range(0, D3D11_SO_BUFFER_SLOT_COUNT) unsigned NumStrides, + __in unsigned RasterizedStream, + __in_opt ID3D11ClassLinkage *pClassLinkage, #else - __in UINT OutputStreamStride, + __in UINT OutputStreamStride, #endif - __out_opt ID3D11GeometryShader **ppGeometryShader) + __out_opt ID3D11GeometryShader **ppGeometryShader) { SYNCHRONIZED; @@ -1297,7 +1297,7 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #if API >= 11 virtual HRESULT STDMETHODCALLTYPE CreateClassLinkage( - __out ID3D11ClassLinkage **ppLinkage) + __out ID3D11ClassLinkage **ppLinkage) { SYNCHRONIZED; @@ -1309,8 +1309,8 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #endif virtual HRESULT STDMETHODCALLTYPE CreateQuery( - __in const D3D11_QUERY_DESC *pQueryDesc, - __out_opt ID3D11Query **ppQuery) + __in const D3D11_QUERY_DESC *pQueryDesc, + __out_opt ID3D11Query **ppQuery) { SYNCHRONIZED; @@ -1332,8 +1332,8 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen } virtual HRESULT STDMETHODCALLTYPE CreatePredicate( - __in const D3D11_QUERY_DESC *pPredicateDesc, - __out_opt ID3D11Predicate **ppPredicate) + __in const D3D11_QUERY_DESC *pPredicateDesc, + __out_opt ID3D11Predicate **ppPredicate) { SYNCHRONIZED; @@ -1362,8 +1362,8 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen virtual HRESULT STDMETHODCALLTYPE CreateCounter( - __in const D3D11_COUNTER_DESC *pCounterDesc, - __out_opt ID3D11Counter **ppCounter) + __in const D3D11_COUNTER_DESC *pCounterDesc, + __out_opt ID3D11Counter **ppCounter) { SYNCHRONIZED; @@ -1375,7 +1375,7 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #if API >= 11 virtual HRESULT STDMETHODCALLTYPE CreateDeferredContext( unsigned ContextFlags, - __out_opt ID3D11DeviceContext **ppDeferredContext) + __out_opt ID3D11DeviceContext **ppDeferredContext) { SYNCHRONIZED; @@ -1387,9 +1387,9 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen #endif virtual HRESULT STDMETHODCALLTYPE OpenSharedResource( - __in HANDLE hResource, - __in REFIID ReturnedInterface, - __out_opt void **ppResource) + __in HANDLE hResource, + __in REFIID ReturnedInterface, + __out_opt void **ppResource) { SYNCHRONIZED; @@ -1414,14 +1414,14 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen * Probably nothing uses these, assuming it has ever been implemented anywhere. */ void STDMETHODCALLTYPE SetTextFilterSize( - __in UINT Width, - __in UINT Height + __in UINT Width, + __in UINT Height ) {} virtual void STDMETHODCALLTYPE GetTextFilterSize( - __in UINT *Width, - __in UINT *Height + __in UINT *Width, + __in UINT *Height ) {} #endif diff --git a/src/gallium/state_trackers/d3d1x/gd3d1x/d3d_enums.cpp b/src/gallium/state_trackers/d3d1x/gd3d1x/d3d_enums.cpp index 7932e438c9..37113a6ec9 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d1x/d3d_enums.cpp +++ b/src/gallium/state_trackers/d3d1x/gd3d1x/d3d_enums.cpp @@ -41,7 +41,7 @@ unsigned d3d11_to_pipe_blend[D3D11_BLEND_COUNT] = PIPE_BLENDFACTOR_INV_DST_COLOR, PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE, 0, /* absent in D3D11 */ - 0, /* absent in D3D11 */ + 0, /* absent in D3D11 */ PIPE_BLENDFACTOR_CONST_COLOR, PIPE_BLENDFACTOR_INV_CONST_COLOR, PIPE_BLENDFACTOR_SRC1_COLOR, diff --git a/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp b/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp index 995059e15b..4b43a3325c 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp +++ b/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp @@ -220,7 +220,7 @@ struct sm4_to_tgsi_converter #define OP1(n) OP1_(n, n) #define OP2(n) OP2_(n, n) #define OP3(n) OP3_(n, n) -#define OP_CF(d, g) case SM4_OPCODE_##d: ureg_##g(ureg, &label); label_to_sm4_insn_num.push_back(std::make_pair(label, program.cf_insn_linked[insn_num])); break; +#define OP_CF(d, g) case SM4_OPCODE_##d: ureg_##g(ureg, &label); label_to_sm4_insn_num.push_back(std::make_pair(label, program.cf_insn_linked[insn_num])); break; void translate_insns(unsigned begin, unsigned end) { diff --git a/src/gallium/state_trackers/d3d1x/gd3dapi/galliumcom.idl b/src/gallium/state_trackers/d3d1x/gd3dapi/galliumcom.idl index c42e10cb66..96faf1c070 100644 --- a/src/gallium/state_trackers/d3d1x/gd3dapi/galliumcom.idl +++ b/src/gallium/state_trackers/d3d1x/gd3dapi/galliumcom.idl @@ -42,7 +42,7 @@ interface IGalliumDevice : IUnknown { // turn Gallium resource into API resource HRESULT OpenGalliumResource( - [in] struct pipe_resource* resource, + [in] struct pipe_resource* resource, [out] IUnknown** api_resource ); diff --git a/src/gallium/state_trackers/d3d1x/gd3dapi/galliumdxgi.idl b/src/gallium/state_trackers/d3d1x/gd3dapi/galliumdxgi.idl index e6f5147209..92fda3385b 100644 --- a/src/gallium/state_trackers/d3d1x/gd3dapi/galliumdxgi.idl +++ b/src/gallium/state_trackers/d3d1x/gd3dapi/galliumdxgi.idl @@ -90,7 +90,7 @@ interface IGalliumDXGIBackend : IUnknown * EndPresent is still called even if you return 0 in window. */ void* BeginPresent( - [in] HWND hwnd, + [in] HWND hwnd, [out] void** window, [out] RECT* rect, [out] struct _RGNDATA** rgndata, @@ -98,7 +98,7 @@ interface IGalliumDXGIBackend : IUnknown ); void EndPresent( - [in] HWND hwnd, + [in] HWND hwnd, [out] void* present_cookie ); } diff --git a/src/gallium/state_trackers/d3d1x/progs/d3d10app/d3d10x11main.cpp b/src/gallium/state_trackers/d3d1x/progs/d3d10app/d3d10x11main.cpp index 0fcef0d7b6..a8f24ae303 100755 --- a/src/gallium/state_trackers/d3d1x/progs/d3d10app/d3d10x11main.cpp +++ b/src/gallium/state_trackers/d3d1x/progs/d3d10app/d3d10x11main.cpp @@ -86,7 +86,7 @@ int main(int argc, char** argv) HRESULT hr; if(0) { - hr = D3D10CreateDeviceAndSwapChain( + hr = D3D10CreateDeviceAndSwapChain( NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, @@ -98,7 +98,7 @@ int main(int argc, char** argv) } else { - hr = D3D10CreateDeviceAndSwapChain1( + hr = D3D10CreateDeviceAndSwapChain1( NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, diff --git a/src/gallium/state_trackers/d3d1x/progs/d3d10tri/d3d10tri.cpp b/src/gallium/state_trackers/d3d1x/progs/d3d10tri/d3d10tri.cpp index 4e92f0a544..06ad811dec 100755 --- a/src/gallium/state_trackers/d3d1x/progs/d3d10tri/d3d10tri.cpp +++ b/src/gallium/state_trackers/d3d1x/progs/d3d10tri/d3d10tri.cpp @@ -29,24 +29,24 @@ #include "d3d10tri.hlsl.vs.h" struct vertex { - float position[4]; - float color[4]; + float position[4]; + float color[4]; }; static struct vertex vertices[3] = { - { - { 0.0f, 0.9f, 0.5f, 1.0f }, - { 1.0f, 0.0f, 0.0f, 1.0f } - }, - { - { 0.9f, -0.9f, 0.5f, 1.0f }, - { 0.0f, 0.0f, 1.0f, 1.0f } - }, - { - { -0.9f, -0.9f, 0.5f, 1.0f }, - { 0.0f, 1.0f, 0.0f, 1.0f } - }, + { + { 0.0f, 0.9f, 0.5f, 1.0f }, + { 1.0f, 0.0f, 0.0f, 1.0f } + }, + { + { 0.9f, -0.9f, 0.5f, 1.0f }, + { 0.0f, 0.0f, 1.0f, 1.0f } + }, + { + { -0.9f, -0.9f, 0.5f, 1.0f }, + { 0.0f, 1.0f, 0.0f, 1.0f } + }, }; struct d3d10tri : public d3d10_application diff --git a/src/gallium/state_trackers/d3d1x/progs/d3d11app/d3d11u.h b/src/gallium/state_trackers/d3d1x/progs/d3d11app/d3d11u.h index 3b0644a573..e67fa09606 100755 --- a/src/gallium/state_trackers/d3d1x/progs/d3d11app/d3d11u.h +++ b/src/gallium/state_trackers/d3d1x/progs/d3d11app/d3d11u.h @@ -104,7 +104,7 @@ struct mesh this->vertex_size = vertex_size; index_offset = vertex_size * num_vertices; - D3D11_BUFFER_DESC bufferd; + D3D11_BUFFER_DESC bufferd; memset(&bufferd, 0, sizeof(bufferd)); bufferd.Usage = D3D11_USAGE_IMMUTABLE; bufferd.BindFlags = D3D11_BIND_VERTEX_BUFFER; diff --git a/src/gallium/state_trackers/d3d1x/progs/d3d11app/d3d11x11main.cpp b/src/gallium/state_trackers/d3d1x/progs/d3d11app/d3d11x11main.cpp index 7055da941b..8eb51d3638 100755 --- a/src/gallium/state_trackers/d3d1x/progs/d3d11app/d3d11x11main.cpp +++ b/src/gallium/state_trackers/d3d1x/progs/d3d11app/d3d11x11main.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) D3D_FEATURE_LEVEL feature_level = D3D_FEATURE_LEVEL_10_0; - HRESULT hr =D3D11CreateDeviceAndSwapChain( + HRESULT hr =D3D11CreateDeviceAndSwapChain( NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, diff --git a/src/gallium/state_trackers/d3d1x/progs/d3d11gears/d3d11gears.cpp b/src/gallium/state_trackers/d3d1x/progs/d3d11gears/d3d11gears.cpp index 32a63ae6dd..de9946c67e 100755 --- a/src/gallium/state_trackers/d3d1x/progs/d3d11gears/d3d11gears.cpp +++ b/src/gallium/state_trackers/d3d1x/progs/d3d11gears/d3d11gears.cpp @@ -1,6 +1,6 @@ /* -* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. -* Copyright (C) 2009-2010 Luca Barbieri All Rights Reserved. +* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. +* Copyright (C) 2009-2010 Luca Barbieri All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -14,7 +14,7 @@ * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -518,7 +518,7 @@ struct d3d11gears : public d3d11_application gears[2].mesh = build_gear(dev, triangles / 4, 1.3f, 2.0f, 0.5f, 10, 0.7f); gears[0].x = -3.0f; - gears[0].y = -2.0f; + gears[0].y = -2.0f; gears[0].wmul = 1.0f; gears[0].t0 = 0.0 * M_PI / 180.0f; diff --git a/src/gallium/state_trackers/d3d1x/progs/d3d11tri/d3d11tri.cpp b/src/gallium/state_trackers/d3d1x/progs/d3d11tri/d3d11tri.cpp index 5622074e19..30c2ffa5cc 100755 --- a/src/gallium/state_trackers/d3d1x/progs/d3d11tri/d3d11tri.cpp +++ b/src/gallium/state_trackers/d3d1x/progs/d3d11tri/d3d11tri.cpp @@ -29,24 +29,24 @@ #include "d3d11tri.hlsl.vs.h" struct vertex { - float position[4]; - float color[4]; + float position[4]; + float color[4]; }; static struct vertex vertices[3] = { - { - { 0.0f, 0.9f, 0.5f, 1.0f }, - { 1.0f, 0.0f, 0.0f, 1.0f } - }, - { - { 0.9f, -0.9f, 0.5f, 1.0f }, - { 0.0f, 0.0f, 1.0f, 1.0f } - }, - { - { -0.9f, -0.9f, 0.5f, 1.0f }, - { 0.0f, 1.0f, 0.0f, 1.0f } - }, + { + { 0.0f, 0.9f, 0.5f, 1.0f }, + { 1.0f, 0.0f, 0.0f, 1.0f } + }, + { + { 0.9f, -0.9f, 0.5f, 1.0f }, + { 0.0f, 0.0f, 1.0f, 1.0f } + }, + { + { -0.9f, -0.9f, 0.5f, 1.0f }, + { 0.0f, 1.0f, 0.0f, 1.0f } + }, }; struct d3d11tri : public d3d11_application -- cgit v1.2.3