#include <iostream>
#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')
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;
};
};
-union sm4_token_instruction_extended
+union sm4_token_instruction_extended
{
struct
{
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);
for(std::set<int>::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);
}
* with are unsafe regarding vtable layout.
* In particular, consider the case where we try to delete GalliumComObject<ID3D11Texture2D>
* with a pointer to GalliumComObject<ID3D11Resource>.
- * Since we think that this is a GalliumComObject<ID3D11Resource>, we'll look for the
+ * Since we think that this is a GalliumComObject<ID3D11Resource>, 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!
*
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)
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)
}
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<mutex_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<mutex_t> lock(private_data_mutex);
- std::pair<void*, unsigned>& 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<mutex_t> lock(private_data_mutex);
- std::pair<void*, unsigned>& 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<mutex_t> lock(private_data_mutex);
+ std::pair<void*, unsigned>& 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<mutex_t> lock(private_data_mutex);
+ std::pair<void*, unsigned>& v = private_data_map[guid];
if(v.first)
{
if(v.second == ~0u)
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<typename BaseClass, typename SecondaryInterface>
{
// we could avoid this duplication, but the increased complexity to do so isn't worth it
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 BaseClass::get_private_data(guid, pDataSize, pData);
- }
-
- virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
- __in REFGUID guid,
- __in UINT DataSize,
- __in_bcount_opt( DataSize ) const void *pData)
- {
- return BaseClass::set_private_data(guid, DataSize, pData);
- }
-
- virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
- __in REFGUID guid,
- __in_opt const IUnknown *pData)
- {
- return BaseClass::set_private_data_interface(guid, pData);
- }
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
+ __in REFGUID guid,
+ __in UINT DataSize,
+ __in_bcount_opt( DataSize ) const void *pData)
+ {
+ return BaseClass::set_private_data(guid, DataSize, pData);
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
+ __in REFGUID guid,
+ __in_opt const IUnknown *pData)
+ {
+ return BaseClass::set_private_data_interface(guid, pData);
+ }
};
#define DXGI_FORMAT_COUNT 100
adapter = p_adapter;
}
- virtual HRESULT STDMETHODCALLTYPE GetParent(
- __in REFIID riid,
- __out void **ppParent)
- {
- return adapter.p->QueryInterface(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)
}
virtual HRESULT STDMETHODCALLTYPE GetGPUThreadPriority(
- __out INT *pPriority)
+ __out INT *pPriority)
{
*pPriority = priority;
return S_OK;
return S_OK;
}
- virtual HRESULT STDMETHODCALLTYPE SetMaximumFrameLatency(
- UINT MaxLatency)
- {
- max_latency = MaxLatency;
- return S_OK;
- }
+ virtual HRESULT STDMETHODCALLTYPE SetMaximumFrameLatency(
+ UINT MaxLatency)
+ {
+ max_latency = MaxLatency;
+ return S_OK;
+ }
};
COM_INTERFACE(ID3D10Blob, IUnknown);
{
D3D10_FEATURE_LEVEL_10_0 = 0xa000,
D3D10_FEATURE_LEVEL_10_1 = 0xa100,
- D3D10_FEATURE_LEVEL_9_1 = 0x9100,
- D3D10_FEATURE_LEVEL_9_2 = 0x9200,
- D3D10_FEATURE_LEVEL_9_3 = 0x9300
+ D3D10_FEATURE_LEVEL_9_1 = 0x9100,
+ D3D10_FEATURE_LEVEL_9_2 = 0x9200,
+ D3D10_FEATURE_LEVEL_9_3 = 0x9300
} D3D10_FEATURE_LEVEL1;
typedef struct D3D10_RENDER_TARGET_BLEND_DESC1
interface ID3D10Device1 : ID3D10Device
{
HRESULT CreateShaderResourceView1(
- [in] ID3D10Resource *pResource,
- [in] const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc,
+ [in] ID3D10Resource *pResource,
+ [in] const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc,
[out,optional] ID3D10ShaderResourceView1 **ppSRView
);
-
- HRESULT CreateBlendState1(
- [in] const D3D10_BLEND_DESC1 *pBlendStateDesc,
+
+ HRESULT CreateBlendState1(
+ [in] const D3D10_BLEND_DESC1 *pBlendStateDesc,
[out, optional] ID3D10BlendState1 **ppBlendState
);
- D3D10_FEATURE_LEVEL1 GetFeatureLevel();
+ D3D10_FEATURE_LEVEL1 GetFeatureLevel();
};
//cpp_quote("#include \"d3d10_1shader.h\"")
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
#endif
typedef enum D3D10_DRIVER_TYPE {
- D3D10_DRIVER_TYPE_HARDWARE = 0,
- D3D10_DRIVER_TYPE_REFERENCE = 1,
- D3D10_DRIVER_TYPE_NULL = 2,
- D3D10_DRIVER_TYPE_SOFTWARE = 3,
- D3D10_DRIVER_TYPE_WARP = 5, // added by Luca Barbieri in Sep 2010
+ D3D10_DRIVER_TYPE_HARDWARE = 0,
+ D3D10_DRIVER_TYPE_REFERENCE = 1,
+ D3D10_DRIVER_TYPE_NULL = 2,
+ D3D10_DRIVER_TYPE_SOFTWARE = 3,
+ D3D10_DRIVER_TYPE_WARP = 5, // added by Luca Barbieri in Sep 2010
} D3D10_DRIVER_TYPE;
HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
- HMODULE swrast, UINT flags, UINT sdk_version, ID3D10Device **device);
+ HMODULE swrast, UINT flags, UINT sdk_version, ID3D10Device **device);
HRESULT WINAPI D3D10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
- HMODULE swrast, UINT flags, UINT sdk_version, DXGI_SWAP_CHAIN_DESC *swapchain_desc,
- IDXGISwapChain **swapchain, ID3D10Device **device);
+ HMODULE swrast, UINT flags, UINT sdk_version, DXGI_SWAP_CHAIN_DESC *swapchain_desc,
+ IDXGISwapChain **swapchain, ID3D10Device **device);
#ifdef __cplusplus
}
);
ID3D10ShaderReflectionType* GetMemberTypeByIndex(
- [in] UINT Index
+ [in] UINT Index
);
ID3D10ShaderReflectionType* GetMemberTypeByName(
- [in] LPCSTR Name
+ [in] LPCSTR Name
);
LPCSTR GetMemberTypeName(
- [in] UINT Index
+ [in] UINT Index
);
};
);
ID3D10ShaderReflectionVariable* GetVariableByIndex(
- [in] UINT Index
+ [in] UINT Index
);
ID3D10ShaderReflectionVariable* GetVariableByName(
- [in] LPCSTR Name
+ [in] LPCSTR Name
);
};
);
ID3D10ShaderReflectionConstantBuffer* GetConstantBufferByIndex(
- [in] UINT Index
+ [in] UINT Index
);
ID3D10ShaderReflectionConstantBuffer* GetConstantBufferByName(
- [in] LPCSTR Name
+ [in] LPCSTR Name
);
HRESULT GetResourceBindingDesc(
- [in] UINT ResourceIndex,
+ [in] UINT ResourceIndex,
[out] D3D10_SHADER_INPUT_BIND_DESC *pDesc
);
HRESULT GetInputParameterDesc(
- [in] UINT ParameterIndex,
+ [in] UINT ParameterIndex,
[out] D3D10_SIGNATURE_PARAMETER_DESC *pDesc
);
HRESULT GetOutputParameterDesc
(
- [in] UINT ParameterIndex,
+ [in] UINT ParameterIndex,
[out] D3D10_SIGNATURE_PARAMETER_DESC *pDesc
);
};
HRESULT D3D10CompileShader(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, const D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs);
+ LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs);
HRESULT D3D10DisassembleShader(const void *pShader, SIZE_T BytecodeLength, BOOL EnableColorCode, LPCSTR pComments, ID3D10Blob** ppDisassembly);
LPCSTR D3D10GetPixelShaderProfile(ID3D10Device *pDevice);
LPCSTR D3D10GetVertexShaderProfile(ID3D10Device *pDevice);
LPCSTR D3D10GetGeometryShaderProfile(ID3D10Device *pDevice);
HRESULT D3D10ReflectShader(const void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10ShaderReflection **ppReflector);
HRESULT D3D10PreprocessShader(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, const D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs);
+ LPD3D10INCLUDE pInclude, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs);
HRESULT D3D10GetInputSignatureBlob(const void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
HRESULT D3D10GetOutputSignatureBlob(const void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
HRESULT D3D10GetInputAndOutputSignatureBlob(const void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
);
HRESULT GetPrivateData(
- [in] REFGUID guid,
+ [in] REFGUID guid,
[in, out] UINT *pDataSize,
[out] void *pData
);
HRESULT SetPrivateData(
- [in] REFGUID guid,
- [in] UINT DataSize,
- [in] const void *pData
+ [in] REFGUID guid,
+ [in] UINT DataSize,
+ [in] const void *pData
);
HRESULT SetPrivateDataInterface(
- [in] REFGUID guid,
- [in] const IUnknown *pData
+ [in] REFGUID guid,
+ [in] const IUnknown *pData
);
};
);
void SetEvictionPriority(
- [in] UINT EvictionPriority
+ [in] UINT EvictionPriority
);
UINT GetEvictionPriority(
interface ID3D11ClassLinkage : ID3D11DeviceChild
{
HRESULT GetClassInstance(
- [in] LPCSTR pClassInstanceName,
- [in] UINT InstanceIndex,
+ [in] LPCSTR pClassInstanceName,
+ [in] UINT InstanceIndex,
[out] ID3D11ClassInstance **ppInstance
);
HRESULT CreateClassInstance(
- [in] LPCSTR pClassTypeName,
- [in] UINT ConstantBufferOffset,
- [in] UINT ConstantVectorOffset,
- [in] UINT TextureOffset,
- [in] UINT SamplerOffset,
+ [in] LPCSTR pClassTypeName,
+ [in] UINT ConstantBufferOffset,
+ [in] UINT ConstantVectorOffset,
+ [in] UINT TextureOffset,
+ [in] UINT SamplerOffset,
[out] ID3D11ClassInstance **ppInstance
);
};
interface ID3D11Device : IUnknown
{
HRESULT CreateBuffer(
- [in] const D3D11_BUFFER_DESC *pDesc,
- [in] const D3D11_SUBRESOURCE_DATA *pInitialData,
+ [in] const D3D11_BUFFER_DESC *pDesc,
+ [in] const D3D11_SUBRESOURCE_DATA *pInitialData,
[out] ID3D11Buffer **ppBuffer
);
HRESULT CreateTexture1D(
- [in] const D3D11_TEXTURE1D_DESC *pDesc,
- [in] const D3D11_SUBRESOURCE_DATA *pInitialData,
+ [in] const D3D11_TEXTURE1D_DESC *pDesc,
+ [in] const D3D11_SUBRESOURCE_DATA *pInitialData,
[out] ID3D11Texture1D **ppTexture1D
);
HRESULT CreateTexture2D(
- [in] const D3D11_TEXTURE2D_DESC *pDesc,
- [in] const D3D11_SUBRESOURCE_DATA *pInitialData,
+ [in] const D3D11_TEXTURE2D_DESC *pDesc,
+ [in] const D3D11_SUBRESOURCE_DATA *pInitialData,
[out] ID3D11Texture2D **ppTexture2D
);
HRESULT CreateTexture3D(
- [in] const D3D11_TEXTURE3D_DESC *pDesc,
- [in] const D3D11_SUBRESOURCE_DATA *pInitialData,
+ [in] const D3D11_TEXTURE3D_DESC *pDesc,
+ [in] const D3D11_SUBRESOURCE_DATA *pInitialData,
[out] ID3D11Texture3D **ppTexture3D
);
HRESULT CreateShaderResourceView(
- [in] ID3D11Resource *pResource,
- [in] const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ [in] ID3D11Resource *pResource,
+ [in] const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
[out] ID3D11ShaderResourceView **ppSRView
);
HRESULT CreateUnorderedAccessView(
- [in] ID3D11Resource *pResource,
- [in] const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ [in] ID3D11Resource *pResource,
+ [in] const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
[out] ID3D11UnorderedAccessView **ppUAView
);
HRESULT CreateRenderTargetView(
- [in] ID3D11Resource *pResource,
- [in] const D3D11_RENDER_TARGET_VIEW_DESC *pDesc,
+ [in] ID3D11Resource *pResource,
+ [in] const D3D11_RENDER_TARGET_VIEW_DESC *pDesc,
[out] ID3D11RenderTargetView **ppRTView
);
HRESULT CreateDepthStencilView(
- [in] ID3D11Resource *pResource,
- [in] const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ [in] ID3D11Resource *pResource,
+ [in] const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc,
[out] ID3D11DepthStencilView **ppDepthStencilView
);
HRESULT CreateInputLayout(
- [in] const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs,
- [in] UINT NumElements,
- [in] const void *pShaderBytecodeWithInputSignature,
- [in] SIZE_T BytecodeLength,
+ [in] const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs,
+ [in] UINT NumElements,
+ [in] const void *pShaderBytecodeWithInputSignature,
+ [in] SIZE_T BytecodeLength,
[out] ID3D11InputLayout **ppInputLayout
);
HRESULT CreateVertexShader(
- [in] const void *pShaderBytecode,
- [in] SIZE_T BytecodeLength,
- [in] ID3D11ClassLinkage *pClassLinkage,
+ [in] const void *pShaderBytecode,
+ [in] SIZE_T BytecodeLength,
+ [in] ID3D11ClassLinkage *pClassLinkage,
[out] ID3D11VertexShader **ppVertexShader
);
HRESULT CreateGeometryShader(
- [in] const void *pShaderBytecode,
- [in] SIZE_T BytecodeLength,
- [in] ID3D11ClassLinkage *pClassLinkage,
+ [in] const void *pShaderBytecode,
+ [in] SIZE_T BytecodeLength,
+ [in] ID3D11ClassLinkage *pClassLinkage,
[out] ID3D11GeometryShader **ppGeometryShader
);
HRESULT CreateGeometryShaderWithStreamOutput(
- [in] const void *pShaderBytecode,
- [in] SIZE_T BytecodeLength,
- [in] const D3D11_SO_DECLARATION_ENTRY *pSODeclaration,
- [in] UINT NumEntries,
- [in] const UINT *pBufferStrides,
- [in] UINT NumStrides,
- [in] UINT RasterizedStream,
- [in] ID3D11ClassLinkage *pClassLinkage,
+ [in] const void *pShaderBytecode,
+ [in] SIZE_T BytecodeLength,
+ [in] const D3D11_SO_DECLARATION_ENTRY *pSODeclaration,
+ [in] UINT NumEntries,
+ [in] const UINT *pBufferStrides,
+ [in] UINT NumStrides,
+ [in] UINT RasterizedStream,
+ [in] ID3D11ClassLinkage *pClassLinkage,
[out] ID3D11GeometryShader **ppGeometryShader
);
HRESULT CreatePixelShader(
- [in] const void *pShaderBytecode,
- [in] SIZE_T BytecodeLength,
- [in] ID3D11ClassLinkage *pClassLinkage,
+ [in] const void *pShaderBytecode,
+ [in] SIZE_T BytecodeLength,
+ [in] ID3D11ClassLinkage *pClassLinkage,
[out] ID3D11PixelShader **ppPixelShader
);
HRESULT CreateHullShader(
- [in] const void *pShaderBytecode,
- [in] SIZE_T BytecodeLength,
- [in] ID3D11ClassLinkage *pClassLinkage,
+ [in] const void *pShaderBytecode,
+ [in] SIZE_T BytecodeLength,
+ [in] ID3D11ClassLinkage *pClassLinkage,
[out] ID3D11HullShader **ppHullShader
);
HRESULT CreateDomainShader(
- [in] const void *pShaderBytecode,
- [in] SIZE_T BytecodeLength,
- [in] ID3D11ClassLinkage *pClassLinkage,
+ [in] const void *pShaderBytecode,
+ [in] SIZE_T BytecodeLength,
+ [in] ID3D11ClassLinkage *pClassLinkage,
[out] ID3D11DomainShader **ppDomainShader
);
HRESULT CreateComputeShader(
- [in] const void *pShaderBytecode,
- [in] SIZE_T BytecodeLength,
- [in] ID3D11ClassLinkage *pClassLinkage,
+ [in] const void *pShaderBytecode,
+ [in] SIZE_T BytecodeLength,
+ [in] ID3D11ClassLinkage *pClassLinkage,
[out] ID3D11ComputeShader **ppComputeShader
);
);
HRESULT CreateBlendState(
- [in] const D3D11_BLEND_DESC *pBlendStateDesc,
+ [in] const D3D11_BLEND_DESC *pBlendStateDesc,
[out] ID3D11BlendState **ppBlendState
);
HRESULT CreateDepthStencilState(
- [in] const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+ [in] const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc,
[out] ID3D11DepthStencilState **ppDepthStencilState
);
HRESULT CreateRasterizerState(
- [in] const D3D11_RASTERIZER_DESC *pRasterizerDesc,
+ [in] const D3D11_RASTERIZER_DESC *pRasterizerDesc,
[out] ID3D11RasterizerState **ppRasterizerState
);
HRESULT CreateSamplerState(
- [in] const D3D11_SAMPLER_DESC *pSamplerDesc,
+ [in] const D3D11_SAMPLER_DESC *pSamplerDesc,
[out] ID3D11SamplerState **ppSamplerState
);
HRESULT CreateQuery(
- [in] const D3D11_QUERY_DESC *pQueryDesc,
+ [in] const D3D11_QUERY_DESC *pQueryDesc,
[out] ID3D11Query **ppQuery
);
HRESULT CreatePredicate(
- [in] const D3D11_QUERY_DESC *pPredicateDesc,
+ [in] const D3D11_QUERY_DESC *pPredicateDesc,
[out] ID3D11Predicate **ppPredicate
);
HRESULT CreateCounter(
- [in] const D3D11_COUNTER_DESC *pCounterDesc,
+ [in] const D3D11_COUNTER_DESC *pCounterDesc,
[out] ID3D11Counter **ppCounter
);
HRESULT CreateDeferredContext(
- [in] UINT ContextFlags,
+ [in] UINT ContextFlags,
[out] ID3D11DeviceContext **ppDeferredContext
);
HRESULT OpenSharedResource(
- [in] HANDLE hResource,
- [in] REFIID ReturnedInterface,
+ [in] HANDLE hResource,
+ [in] REFIID ReturnedInterface,
[out] void **ppResource
);
HRESULT CheckFormatSupport(
- [in] DXGI_FORMAT Format,
+ [in] DXGI_FORMAT Format,
[out] UINT *pFormatSupport
);
HRESULT CheckMultisampleQualityLevels(
- [in] DXGI_FORMAT Format,
- [in] UINT SampleCount,
+ [in] DXGI_FORMAT Format,
+ [in] UINT SampleCount,
[out] UINT *pNumQualityLevels
);
);
HRESULT CheckCounter(
- [in] const D3D11_COUNTER_DESC *pDesc,
+ [in] const D3D11_COUNTER_DESC *pDesc,
[out] D3D11_COUNTER_TYPE *pType,
[out] UINT *pActiveCounters,
[out] LPSTR szName,
);
HRESULT CheckFeatureSupport(
- [in] D3D11_FEATURE Feature,
+ [in] D3D11_FEATURE Feature,
[out] void *pFeatureSupportData,
- [in] UINT FeatureSupportDataSize
+ [in] UINT FeatureSupportDataSize
);
HRESULT GetPrivateData(
- [in] REFGUID guid,
+ [in] REFGUID guid,
[in, out] UINT *pDataSize,
[out] void *pData
);
HRESULT SetPrivateData(
- [in] REFGUID guid,
- [in] UINT DataSize,
- [in] const void *pData
+ [in] REFGUID guid,
+ [in] UINT DataSize,
+ [in] const void *pData
);
HRESULT SetPrivateDataInterface(
- [in] REFGUID guid,
- [in] const IUnknown *pData
+ [in] REFGUID guid,
+ [in] const IUnknown *pData
);
D3D_FEATURE_LEVEL GetFeatureLevel();
);
HRESULT SetExceptionMode(
- [in] UINT RaiseFlags
+ [in] UINT RaiseFlags
);
UINT GetExceptionMode();
interface ID3D11DeviceContext : ID3D11DeviceChild
{
void VSSetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
- [in] ID3D11Buffer *const *ppConstantBuffers
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
+ [in] ID3D11Buffer *const *ppConstantBuffers
);
void PSSetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
- [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
+ [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
);
void PSSetShader(
- [in] ID3D11PixelShader *pPixelShader,
- [in] ID3D11ClassInstance *const *ppClassInstances,
- [in] UINT NumClassInstances
+ [in] ID3D11PixelShader *pPixelShader,
+ [in] ID3D11ClassInstance *const *ppClassInstances,
+ [in] UINT NumClassInstances
);
void PSSetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
- [in] ID3D11SamplerState *const *ppSamplers
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
+ [in] ID3D11SamplerState *const *ppSamplers
);
void VSSetShader(
- [in] ID3D11VertexShader *pVertexShader,
- [in] ID3D11ClassInstance *const *ppClassInstances,
- [in] UINT NumClassInstances
+ [in] ID3D11VertexShader *pVertexShader,
+ [in] ID3D11ClassInstance *const *ppClassInstances,
+ [in] UINT NumClassInstances
);
void DrawIndexed(
- [in] UINT IndexCount,
- [in] UINT StartIndexLocation,
- [in] INT BaseVertexLocation
+ [in] UINT IndexCount,
+ [in] UINT StartIndexLocation,
+ [in] INT BaseVertexLocation
);
void Draw(
- [in] UINT VertexCount,
- [in] UINT StartVertexLocation
+ [in] UINT VertexCount,
+ [in] UINT StartVertexLocation
);
HRESULT Map(
- [in] ID3D11Resource *pResource,
- [in] UINT Subresource,
- [in] D3D11_MAP MapType,
- [in] UINT MapFlags,
+ [in] ID3D11Resource *pResource,
+ [in] UINT Subresource,
+ [in] D3D11_MAP MapType,
+ [in] UINT MapFlags,
[out] D3D11_MAPPED_SUBRESOURCE *pMappedResource
);
void Unmap(
- [in] ID3D11Resource *pResource,
- [in] UINT Subresource
+ [in] ID3D11Resource *pResource,
+ [in] UINT Subresource
);
void PSSetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
- [in] ID3D11Buffer *const *ppConstantBuffers
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
+ [in] ID3D11Buffer *const *ppConstantBuffers
);
void IASetInputLayout(
- [in] ID3D11InputLayout *pInputLayout
+ [in] ID3D11InputLayout *pInputLayout
);
void IASetVertexBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
- [in] ID3D11Buffer *const *ppVertexBuffers,
- [in] const UINT *pStrides,
- [in] const UINT *pOffsets
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
+ [in] ID3D11Buffer *const *ppVertexBuffers,
+ [in] const UINT *pStrides,
+ [in] const UINT *pOffsets
);
void IASetIndexBuffer(
- [in] ID3D11Buffer *pIndexBuffer,
- [in] DXGI_FORMAT Format,
- [in] UINT Offset
+ [in] ID3D11Buffer *pIndexBuffer,
+ [in] DXGI_FORMAT Format,
+ [in] UINT Offset
);
void DrawIndexedInstanced(
- [in] UINT IndexCountPerInstance,
- [in] UINT InstanceCount,
- [in] UINT StartIndexLocation,
- [in] INT BaseVertexLocation,
- [in] UINT StartInstanceLocation
+ [in] UINT IndexCountPerInstance,
+ [in] UINT InstanceCount,
+ [in] UINT StartIndexLocation,
+ [in] INT BaseVertexLocation,
+ [in] UINT StartInstanceLocation
);
void DrawInstanced(
- [in] UINT VertexCountPerInstance,
- [in] UINT InstanceCount,
- [in] UINT StartVertexLocation,
- [in] UINT StartInstanceLocation
+ [in] UINT VertexCountPerInstance,
+ [in] UINT InstanceCount,
+ [in] UINT StartVertexLocation,
+ [in] UINT StartInstanceLocation
);
void GSSetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
- [in] ID3D11Buffer *const *ppConstantBuffers
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
+ [in] ID3D11Buffer *const *ppConstantBuffers
);
void GSSetShader(
- [in] ID3D11GeometryShader *pShader,
- [in] ID3D11ClassInstance *const *ppClassInstances,
- [in] UINT NumClassInstances
+ [in] ID3D11GeometryShader *pShader,
+ [in] ID3D11ClassInstance *const *ppClassInstances,
+ [in] UINT NumClassInstances
);
void IASetPrimitiveTopology(
- [in] D3D11_PRIMITIVE_TOPOLOGY Topology
+ [in] D3D11_PRIMITIVE_TOPOLOGY Topology
);
void VSSetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
- [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
+ [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
);
void VSSetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
- [in] ID3D11SamplerState *const *ppSamplers
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
+ [in] ID3D11SamplerState *const *ppSamplers
);
void Begin(
- [in] ID3D11Asynchronous *pAsync
+ [in] ID3D11Asynchronous *pAsync
);
void End(
- [in] ID3D11Asynchronous *pAsync
+ [in] ID3D11Asynchronous *pAsync
);
HRESULT GetData(
- [in] ID3D11Asynchronous *pAsync,
+ [in] ID3D11Asynchronous *pAsync,
[out] void *pData,
- [in] UINT DataSize,
- [in] UINT GetDataFlags
+ [in] UINT DataSize,
+ [in] UINT GetDataFlags
);
void SetPredication(
- [in] ID3D11Predicate *pPredicate,
- [in] BOOL PredicateValue
+ [in] ID3D11Predicate *pPredicate,
+ [in] BOOL PredicateValue
);
void GSSetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
- [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
+ [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
);
void GSSetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
- [in] ID3D11SamplerState *const *ppSamplers
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
+ [in] ID3D11SamplerState *const *ppSamplers
);
void OMSetRenderTargets(
- [in] UINT NumViews,
- [in] ID3D11RenderTargetView *const *ppRenderTargetViews,
- [in] ID3D11DepthStencilView *pDepthStencilView
+ [in] UINT NumViews,
+ [in] ID3D11RenderTargetView *const *ppRenderTargetViews,
+ [in] ID3D11DepthStencilView *pDepthStencilView
);
void OMSetRenderTargetsAndUnorderedAccessViews(
- [in] UINT NumRTVs,
- [in] ID3D11RenderTargetView *const *ppRenderTargetViews,
- [in] ID3D11DepthStencilView *pDepthStencilView,
- [in] UINT UAVStartSlot,
- [in] UINT NumUAVs,
- [in] ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
- [in] const UINT *pUAVInitialCounts
+ [in] UINT NumRTVs,
+ [in] ID3D11RenderTargetView *const *ppRenderTargetViews,
+ [in] ID3D11DepthStencilView *pDepthStencilView,
+ [in] UINT UAVStartSlot,
+ [in] UINT NumUAVs,
+ [in] ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ [in] const UINT *pUAVInitialCounts
);
void OMSetBlendState(
- [in] ID3D11BlendState *pBlendState,
- [in] const FLOAT BlendFactor[ 4 ],
- [in] UINT SampleMask
+ [in] ID3D11BlendState *pBlendState,
+ [in] const FLOAT BlendFactor[ 4 ],
+ [in] UINT SampleMask
);
void OMSetDepthStencilState(
- [in] ID3D11DepthStencilState *pDepthStencilState,
- [in] UINT StencilRef
+ [in] ID3D11DepthStencilState *pDepthStencilState,
+ [in] UINT StencilRef
);
void SOSetTargets(
- [in] UINT NumBuffers,
- [in] ID3D11Buffer *const *ppSOTargets,
- [in] const UINT *pOffsets
+ [in] UINT NumBuffers,
+ [in] ID3D11Buffer *const *ppSOTargets,
+ [in] const UINT *pOffsets
);
void DrawAuto(
);
void DrawIndexedInstancedIndirect(
- [in] ID3D11Buffer *pBufferForArgs,
- [in] UINT AlignedByteOffsetForArgs
+ [in] ID3D11Buffer *pBufferForArgs,
+ [in] UINT AlignedByteOffsetForArgs
);
void DrawInstancedIndirect(
- [in] ID3D11Buffer *pBufferForArgs,
- [in] UINT AlignedByteOffsetForArgs
+ [in] ID3D11Buffer *pBufferForArgs,
+ [in] UINT AlignedByteOffsetForArgs
);
void Dispatch(
- [in] UINT ThreadGroupCountX,
- [in] UINT ThreadGroupCountY,
- [in] UINT ThreadGroupCountZ
+ [in] UINT ThreadGroupCountX,
+ [in] UINT ThreadGroupCountY,
+ [in] UINT ThreadGroupCountZ
);
void DispatchIndirect(
- [in] ID3D11Buffer *pBufferForArgs,
- [in] UINT AlignedByteOffsetForArgs
+ [in] ID3D11Buffer *pBufferForArgs,
+ [in] UINT AlignedByteOffsetForArgs
);
void RSSetState(
- [in] ID3D11RasterizerState *pRasterizerState
+ [in] ID3D11RasterizerState *pRasterizerState
);
void RSSetViewports(
- [in] UINT NumViewports,
- [in] const D3D11_VIEWPORT *pViewports
+ [in] UINT NumViewports,
+ [in] const D3D11_VIEWPORT *pViewports
);
void RSSetScissorRects(
- [in] UINT NumRects,
- [in] const D3D11_RECT *pRects
+ [in] UINT NumRects,
+ [in] const D3D11_RECT *pRects
);
void CopySubresourceRegion(
- [in] ID3D11Resource *pDstResource,
- [in] UINT DstSubresource,
- [in] UINT DstX,
- [in] UINT DstY,
- [in] UINT DstZ,
- [in] ID3D11Resource *pSrcResource,
- [in] UINT SrcSubresource,
- [in] const D3D11_BOX *pSrcBox
+ [in] ID3D11Resource *pDstResource,
+ [in] UINT DstSubresource,
+ [in] UINT DstX,
+ [in] UINT DstY,
+ [in] UINT DstZ,
+ [in] ID3D11Resource *pSrcResource,
+ [in] UINT SrcSubresource,
+ [in] const D3D11_BOX *pSrcBox
);
void CopyResource(
- [in] ID3D11Resource *pDstResource,
- [in] ID3D11Resource *pSrcResource
+ [in] ID3D11Resource *pDstResource,
+ [in] ID3D11Resource *pSrcResource
);
void UpdateSubresource(
- [in] ID3D11Resource *pDstResource,
- [in] UINT DstSubresource,
- [in] const D3D11_BOX *pDstBox,
- [in] const void *pSrcData,
- [in] UINT SrcRowPitch,
- [in] UINT SrcDepthPitch
+ [in] ID3D11Resource *pDstResource,
+ [in] UINT DstSubresource,
+ [in] const D3D11_BOX *pDstBox,
+ [in] const void *pSrcData,
+ [in] UINT SrcRowPitch,
+ [in] UINT SrcDepthPitch
);
void CopyStructureCount(
- [in] ID3D11Buffer *pDstBuffer,
- [in] UINT DstAlignedByteOffset,
- [in] ID3D11UnorderedAccessView *pSrcView
+ [in] ID3D11Buffer *pDstBuffer,
+ [in] UINT DstAlignedByteOffset,
+ [in] ID3D11UnorderedAccessView *pSrcView
);
void ClearRenderTargetView(
- [in] ID3D11RenderTargetView *pRenderTargetView,
- [in] const FLOAT ColorRGBA[ 4 ]
+ [in] ID3D11RenderTargetView *pRenderTargetView,
+ [in] const FLOAT ColorRGBA[ 4 ]
);
void ClearUnorderedAccessViewUint(
- [in] ID3D11UnorderedAccessView *pUnorderedAccessView,
- [in] const UINT Values[ 4 ]
+ [in] ID3D11UnorderedAccessView *pUnorderedAccessView,
+ [in] const UINT Values[ 4 ]
);
void ClearUnorderedAccessViewFloat(
- [in] ID3D11UnorderedAccessView *pUnorderedAccessView,
- [in] const FLOAT Values[ 4 ]
+ [in] ID3D11UnorderedAccessView *pUnorderedAccessView,
+ [in] const FLOAT Values[ 4 ]
);
void ClearDepthStencilView(
- [in] ID3D11DepthStencilView *pDepthStencilView,
- [in] UINT ClearFlags,
- [in] FLOAT Depth,
- [in] UINT8 Stencil
+ [in] ID3D11DepthStencilView *pDepthStencilView,
+ [in] UINT ClearFlags,
+ [in] FLOAT Depth,
+ [in] UINT8 Stencil
);
void GenerateMips(
- [in] ID3D11ShaderResourceView *pShaderResourceView
+ [in] ID3D11ShaderResourceView *pShaderResourceView
);
void SetResourceMinLOD(
- [in] ID3D11Resource *pResource,
- [in] FLOAT MinLOD
+ [in] ID3D11Resource *pResource,
+ [in] FLOAT MinLOD
);
FLOAT GetResourceMinLOD(
- [in] ID3D11Resource *pResource
+ [in] ID3D11Resource *pResource
);
void ResolveSubresource(
- [in] ID3D11Resource *pDstResource,
- [in] UINT DstSubresource,
- [in] ID3D11Resource *pSrcResource,
- [in] UINT SrcSubresource,
- [in] DXGI_FORMAT Format
+ [in] ID3D11Resource *pDstResource,
+ [in] UINT DstSubresource,
+ [in] ID3D11Resource *pSrcResource,
+ [in] UINT SrcSubresource,
+ [in] DXGI_FORMAT Format
);
void ExecuteCommandList(
- [in] ID3D11CommandList *pCommandList,
- [in] BOOL RestoreContextState
+ [in] ID3D11CommandList *pCommandList,
+ [in] BOOL RestoreContextState
);
void HSSetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
- [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
+ [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
);
void HSSetShader(
- [in] ID3D11HullShader *pHullShader,
- [in] ID3D11ClassInstance *const *ppClassInstances,
- [in] UINT NumClassInstances
+ [in] ID3D11HullShader *pHullShader,
+ [in] ID3D11ClassInstance *const *ppClassInstances,
+ [in] UINT NumClassInstances
);
void HSSetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
- [in] ID3D11SamplerState *const *ppSamplers
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
+ [in] ID3D11SamplerState *const *ppSamplers
);
void HSSetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
- [in] ID3D11Buffer *const *ppConstantBuffers
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
+ [in] ID3D11Buffer *const *ppConstantBuffers
);
void DSSetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
- [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
+ [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
);
void DSSetShader(
- [in] ID3D11DomainShader *pDomainShader,
- [in] ID3D11ClassInstance *const *ppClassInstances,
- [in] UINT NumClassInstances
+ [in] ID3D11DomainShader *pDomainShader,
+ [in] ID3D11ClassInstance *const *ppClassInstances,
+ [in] UINT NumClassInstances
);
void DSSetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
- [in] ID3D11SamplerState *const *ppSamplers
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
+ [in] ID3D11SamplerState *const *ppSamplers
);
void DSSetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
- [in] ID3D11Buffer *const *ppConstantBuffers
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
+ [in] ID3D11Buffer *const *ppConstantBuffers
);
void CSSetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
- [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
+ [in] ID3D11ShaderResourceView *const *ppShaderResourceViews
);
void CSSetUnorderedAccessViews(
- [in] UINT StartSlot,
- [in] UINT NumUAVs,
- [in] ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
- [in] const UINT *pUAVInitialCounts
+ [in] UINT StartSlot,
+ [in] UINT NumUAVs,
+ [in] ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ [in] const UINT *pUAVInitialCounts
);
void CSSetShader(
- [in] ID3D11ComputeShader *pComputeShader,
- [in] ID3D11ClassInstance *const *ppClassInstances,
- [in] UINT NumClassInstances
+ [in] ID3D11ComputeShader *pComputeShader,
+ [in] ID3D11ClassInstance *const *ppClassInstances,
+ [in] UINT NumClassInstances
);
void CSSetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
- [in] ID3D11SamplerState *const *ppSamplers
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
+ [in] ID3D11SamplerState *const *ppSamplers
);
void CSSetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
- [in] ID3D11Buffer *const *ppConstantBuffers
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
+ [in] ID3D11Buffer *const *ppConstantBuffers
);
void VSGetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
[out] ID3D11Buffer **ppConstantBuffers
);
void PSGetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
[out] ID3D11ShaderResourceView **ppShaderResourceViews
);
);
void PSGetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
[out] ID3D11SamplerState **ppSamplers
);
);
void PSGetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
[out] ID3D11Buffer **ppConstantBuffers
);
);
void IAGetVertexBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
[out] ID3D11Buffer **ppVertexBuffers,
[out] UINT *pStrides,
[out] UINT *pOffsets
);
void GSGetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
[out] ID3D11Buffer **ppConstantBuffers
);
);
void VSGetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
[out] ID3D11ShaderResourceView **ppShaderResourceViews
);
void VSGetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
[out] ID3D11SamplerState **ppSamplers
);
);
void GSGetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
[out] ID3D11ShaderResourceView **ppShaderResourceViews
);
void GSGetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
[out] ID3D11SamplerState **ppSamplers
);
void OMGetRenderTargets(
- [in] UINT NumViews,
+ [in] UINT NumViews,
[out] ID3D11RenderTargetView **ppRenderTargetViews,
[out] ID3D11DepthStencilView **ppDepthStencilView
);
void OMGetRenderTargetsAndUnorderedAccessViews(
- [in] UINT NumRTVs,
+ [in] UINT NumRTVs,
[out] ID3D11RenderTargetView **ppRenderTargetViews,
[out] ID3D11DepthStencilView **ppDepthStencilView,
- [in] UINT UAVStartSlot,
- [in] UINT NumUAVs,
+ [in] UINT UAVStartSlot,
+ [in] UINT NumUAVs,
[out] ID3D11UnorderedAccessView **ppUnorderedAccessViews
);
);
void SOGetTargets(
- [in] UINT NumBuffers,
+ [in] UINT NumBuffers,
[out] ID3D11Buffer **ppSOTargets
);
);
void HSGetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
[out] ID3D11ShaderResourceView **ppShaderResourceViews
);
);
void HSGetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
[out] ID3D11SamplerState **ppSamplers
);
void HSGetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
[out] ID3D11Buffer **ppConstantBuffers
);
void DSGetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
[out] ID3D11ShaderResourceView **ppShaderResourceViews
);
);
void DSGetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
[out] ID3D11SamplerState **ppSamplers
);
void DSGetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
[out] ID3D11Buffer **ppConstantBuffers
);
void CSGetShaderResources(
- [in] UINT StartSlot,
- [in] UINT NumViews,
+ [in] UINT StartSlot,
+ [in] UINT NumViews,
[out] ID3D11ShaderResourceView **ppShaderResourceViews
);
void CSGetUnorderedAccessViews(
- [in] UINT StartSlot,
- [in] UINT NumUAVs,
+ [in] UINT StartSlot,
+ [in] UINT NumUAVs,
[out] ID3D11UnorderedAccessView **ppUnorderedAccessViews
);
);
void CSGetSamplers(
- [in] UINT StartSlot,
- [in] UINT NumSamplers,
+ [in] UINT StartSlot,
+ [in] UINT NumSamplers,
[out] ID3D11SamplerState **ppSamplers
);
void CSGetConstantBuffers(
- [in] UINT StartSlot,
- [in] UINT NumBuffers,
+ [in] UINT StartSlot,
+ [in] UINT NumBuffers,
[out] ID3D11Buffer **ppConstantBuffers
);
UINT GetContextFlags();
HRESULT FinishCommandList(
- [in] BOOL RestoreDeferredContextState,
+ [in] BOOL RestoreDeferredContextState,
[out] ID3D11CommandList **ppCommandList
);
};
);
ID3D11ShaderReflectionType* GetMemberTypeByIndex(
- [in] UINT Index
+ [in] UINT Index
);
ID3D11ShaderReflectionType* GetMemberTypeByName(
- [in] LPCSTR Name
+ [in] LPCSTR Name
);
LPCSTR GetMemberTypeName(
- [in] UINT Index
+ [in] UINT Index
);
HRESULT IsEqual(
- [in] ID3D11ShaderReflectionType* pType
+ [in] ID3D11ShaderReflectionType* pType
);
ID3D11ShaderReflectionType* GetSubType();
ID3D11ShaderReflectionType* GetBaseClass();
UINT GetNumInterfaces();
ID3D11ShaderReflectionType* GetInterfaceByIndex(
- [in] UINT uIndex
+ [in] UINT uIndex
);
HRESULT IsOfType(
- [in] ID3D11ShaderReflectionType* pType
+ [in] ID3D11ShaderReflectionType* pType
);
HRESULT ImplementsInterface(
- [in] ID3D11ShaderReflectionType* pBase
+ [in] ID3D11ShaderReflectionType* pBase
);
};
ID3D11ShaderReflectionConstantBuffer* GetBuffer();
UINT GetInterfaceSlot(
- [in] UINT uArrayIndex
+ [in] UINT uArrayIndex
);
};
);
ID3D11ShaderReflectionVariable* GetVariableByIndex(
- [in] UINT Index
+ [in] UINT Index
);
ID3D11ShaderReflectionVariable* GetVariableByName(
- [in] LPCSTR Name
+ [in] LPCSTR Name
);
};
);
ID3D11ShaderReflectionConstantBuffer* GetConstantBufferByIndex(
- [in] UINT Index
+ [in] UINT Index
);
ID3D11ShaderReflectionConstantBuffer* GetConstantBufferByName(
- [in] LPCSTR Name
+ [in] LPCSTR Name
);
HRESULT GetResourceBindingDesc(
- [in] UINT ResourceIndex,
+ [in] UINT ResourceIndex,
[out] D3D11_SHADER_INPUT_BIND_DESC *pDesc
);
HRESULT GetInputParameterDesc(
- [in] UINT ParameterIndex,
+ [in] UINT ParameterIndex,
[out] D3D11_SIGNATURE_PARAMETER_DESC *pDesc
);
HRESULT GetOutputParameterDesc
(
- [in] UINT ParameterIndex,
+ [in] UINT ParameterIndex,
[out] D3D11_SIGNATURE_PARAMETER_DESC *pDesc
);
HRESULT GetPatchConstantParameterDesc(
- [in] UINT ParameterIndex,
+ [in] UINT ParameterIndex,
[out] D3D11_SIGNATURE_PARAMETER_DESC *pDesc
);
ID3D11ShaderReflectionVariable* GetVariableByName(
- [in] LPCSTR Name
+ [in] LPCSTR Name
);
HRESULT GetResourceBindingDescByName(
- [in] LPCSTR Name,
+ [in] LPCSTR Name,
[out] D3D11_SHADER_INPUT_BIND_DESC *pDesc
);
interface ID3DInclude : IUnknown
{
HRESULT Open(
- [in] D3D_INCLUDE_TYPE IncludeType,
- [in] LPCSTR pFileName,
- [in] LPCVOID pParentData,
+ [in] D3D_INCLUDE_TYPE IncludeType,
+ [in] LPCSTR pFileName,
+ [in] LPCVOID pParentData,
[out] LPCVOID *ppData,
- [in] UINT *pBytes
+ [in] UINT *pBytes
);
HRESULT Close(
- [in] LPCVOID pData
+ [in] LPCVOID pData
);
};
D3D_SVF_FORCE_DWORD = 0x7fffffff
} D3D_SHADER_VARIABLE_FLAGS;
-typedef enum _D3D_SHADER_VARIABLE_TYPE
+typedef enum _D3D_SHADER_VARIABLE_TYPE
{
D3D_SVT_VOID = 0,
D3D_SVT_BOOL,
D3D_SVT_FORCE_DWORD = 0x7fffffff
} D3D_SHADER_VARIABLE_TYPE;
-typedef enum _D3D_SHADER_INPUT_FLAGS
+typedef enum _D3D_SHADER_INPUT_FLAGS
{
D3D_SIF_USERPACKED = 1,
D3D_SIF_COMPARISON_SAMPLER = 2,
D3D10_SIF_TEXTURE_COMPONENTS = 12,
D3D_SIF_FORCE_DWORD = 0x7fffffff
- } D3D_SHADER_INPUT_FLAGS;
+ } D3D_SHADER_INPUT_FLAGS;
typedef enum _D3D_SHADER_INPUT_TYPE
{
D3D11_SIT_UAV_APPEND_STRUCTURED,
D3D11_SIT_UAV_CONSUME_STRUCTURED,
D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER,
- } D3D_SHADER_INPUT_TYPE;
+ } D3D_SHADER_INPUT_TYPE;
-typedef enum _D3D_SHADER_CBUFFER_FLAGS
+typedef enum _D3D_SHADER_CBUFFER_FLAGS
{
D3D_CBF_USERPACKED = 1,
D3D_CBF_FORCE_DWORD = 0x7fffffff
} D3D_SHADER_CBUFFER_FLAGS;
-typedef enum _D3D_CBUFFER_TYPE
+typedef enum _D3D_CBUFFER_TYPE
{
D3D_CT_CBUFFER = 0,
D3D_CT_TBUFFER,
D3D11_RETURN_TYPE_CONTINUED,
} D3D_RESOURCE_RETURN_TYPE;
-typedef enum D3D_REGISTER_COMPONENT_TYPE
+typedef enum D3D_REGISTER_COMPONENT_TYPE
{
D3D_REGISTER_COMPONENT_UNKNOWN = 0,
D3D_REGISTER_COMPONENT_UINT32,
D3D10_REGISTER_COMPONENT_FLOAT32,
} D3D_REGISTER_COMPONENT_TYPE;
-typedef enum D3D_TESSELLATOR_DOMAIN
+typedef enum D3D_TESSELLATOR_DOMAIN
{
D3D_TESSELLATOR_DOMAIN_UNDEFINED = 0,
D3D_TESSELLATOR_DOMAIN_ISOLINE,
D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN,
} D3D_TESSELLATOR_PARTITIONING;
-typedef enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE
+typedef enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE
{
D3D_TESSELLATOR_OUTPUT_UNDEFINED = 0,
D3D_TESSELLATOR_OUTPUT_POINT,
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
const UINT _FACDXGI = 0x87a;
-cpp_quote("#define MAKE_DXGI_STATUS(x) MAKE_HRESULT(0, _FACDXGI, x)")
-cpp_quote("#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1)")
-cpp_quote("#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2)")
-cpp_quote("#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4)")
-cpp_quote("#define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5)")
-cpp_quote("#define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6)")
-cpp_quote("#define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7)")
-cpp_quote("#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8)")
-
-cpp_quote("#define MAKE_DXGI_HRESULT(x) MAKE_HRESULT(1, _FACDXGI, x)")
-cpp_quote("#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)")
-cpp_quote("#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2)")
-cpp_quote("#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3)")
-cpp_quote("#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4)")
-cpp_quote("#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5)")
-cpp_quote("#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6)")
-cpp_quote("#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7)")
-cpp_quote("#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10)")
-cpp_quote("#define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11)")
-cpp_quote("#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12)")
-cpp_quote("#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32)")
-cpp_quote("#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33)")
-cpp_quote("#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34)")
+cpp_quote("#define MAKE_DXGI_STATUS(x) MAKE_HRESULT(0, _FACDXGI, x)")
+cpp_quote("#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1)")
+cpp_quote("#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2)")
+cpp_quote("#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4)")
+cpp_quote("#define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5)")
+cpp_quote("#define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6)")
+cpp_quote("#define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7)")
+cpp_quote("#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8)")
+
+cpp_quote("#define MAKE_DXGI_HRESULT(x) MAKE_HRESULT(1, _FACDXGI, x)")
+cpp_quote("#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)")
+cpp_quote("#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2)")
+cpp_quote("#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3)")
+cpp_quote("#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4)")
+cpp_quote("#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5)")
+cpp_quote("#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6)")
+cpp_quote("#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7)")
+cpp_quote("#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10)")
+cpp_quote("#define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11)")
+cpp_quote("#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12)")
+cpp_quote("#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32)")
+cpp_quote("#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33)")
+cpp_quote("#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34)")
cpp_quote("#if 0")
typedef HANDLE HMONITOR;
typedef struct _LUID {
- DWORD LowPart;
- LONG HighPart;
+ DWORD LowPart;
+ LONG HighPart;
} LUID, *PLUID;
cpp_quote("#endif")
typedef UINT DXGI_USAGE;
-const DXGI_USAGE DXGI_USAGE_SHADER_INPUT = 0x10L;
-const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20L;
-const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L;
-const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L;
-const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L;
+const DXGI_USAGE DXGI_USAGE_SHADER_INPUT = 0x10L;
+const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20L;
+const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L;
+const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L;
+const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L;
typedef enum DXGI_SWAP_EFFECT {
- DXGI_SWAP_EFFECT_DISCARD = 0,
- DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
+ DXGI_SWAP_EFFECT_DISCARD = 0,
+ DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
} DXGI_SWAP_EFFECT;
typedef enum DXGI_RESIDENCY {
- DXGI_RESIDENCY_FULLY_RESIDENT = 1,
- DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
- DXGI_RESIDENCY_EVICTED_TO_DISK = 3,
+ DXGI_RESIDENCY_FULLY_RESIDENT = 1,
+ DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
+ DXGI_RESIDENCY_EVICTED_TO_DISK = 3,
} DXGI_RESIDENCY;
typedef struct DXGI_SURFACE_DESC {
- UINT Width;
- UINT Height;
- DXGI_FORMAT Format;
- DXGI_SAMPLE_DESC SampleDesc;
+ UINT Width;
+ UINT Height;
+ DXGI_FORMAT Format;
+ DXGI_SAMPLE_DESC SampleDesc;
} DXGI_SURFACE_DESC;
typedef struct DXGI_MAPPED_RECT {
- INT Pitch;
- BYTE *pBits;
+ INT Pitch;
+ BYTE *pBits;
} DXGI_MAPPED_RECT;
typedef struct DXGI_OUTPUT_DESC {
- WCHAR DeviceName[32];
- RECT DesktopCoordinates;
- BOOL AttachedToDesktop;
- DXGI_MODE_ROTATION Rotation;
- HMONITOR Monitor;
+ WCHAR DeviceName[32];
+ RECT DesktopCoordinates;
+ BOOL AttachedToDesktop;
+ DXGI_MODE_ROTATION Rotation;
+ HMONITOR Monitor;
} DXGI_OUTPUT_DESC;
typedef struct DXGI_FRAME_STATISTICS {
- UINT PresentCount;
- UINT PresentRefreshCount;
- UINT SyncRefreshCount;
- LARGE_INTEGER SyncQPCTime;
- LARGE_INTEGER SyncGPUTime;
+ UINT PresentCount;
+ UINT PresentRefreshCount;
+ UINT SyncRefreshCount;
+ LARGE_INTEGER SyncQPCTime;
+ LARGE_INTEGER SyncGPUTime;
} DXGI_FRAME_STATISTICS;
typedef struct DXGI_ADAPTER_DESC {
- WCHAR Description[128];
- UINT VendorId;
- UINT DeviceId;
- UINT SubSysId;
- UINT Revision;
- SIZE_T DedicatedVideoMemory;
- SIZE_T DedicatedSystemMemory;
- SIZE_T SharedSystemMemory;
- LUID AdapterLuid;
+ WCHAR Description[128];
+ UINT VendorId;
+ UINT DeviceId;
+ UINT SubSysId;
+ UINT Revision;
+ SIZE_T DedicatedVideoMemory;
+ SIZE_T DedicatedSystemMemory;
+ SIZE_T SharedSystemMemory;
+ LUID AdapterLuid;
} DXGI_ADAPTER_DESC;
typedef struct DXGI_SWAP_CHAIN_DESC {
- DXGI_MODE_DESC BufferDesc;
- DXGI_SAMPLE_DESC SampleDesc;
- DXGI_USAGE BufferUsage;
- UINT BufferCount;
- HWND OutputWindow;
- BOOL Windowed;
- DXGI_SWAP_EFFECT SwapEffect;
- UINT Flags;
+ DXGI_MODE_DESC BufferDesc;
+ DXGI_SAMPLE_DESC SampleDesc;
+ DXGI_USAGE BufferUsage;
+ UINT BufferCount;
+ HWND OutputWindow;
+ BOOL Windowed;
+ DXGI_SWAP_EFFECT SwapEffect;
+ UINT Flags;
} DXGI_SWAP_CHAIN_DESC;
typedef struct DXGI_SHARED_RESOURCE {
- HANDLE Handle;
+ HANDLE Handle;
} DXGI_SHARED_RESOURCE;
[
- object,
- local,
- uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
+ object,
+ local,
+ uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
]
interface IDXGIObject : IUnknown
{
- HRESULT SetPrivateData(
- [in] REFGUID guid,
- [in] UINT data_size,
- [in] const void *data
- );
- HRESULT SetPrivateDataInterface(
- [in] REFGUID guid,
- [in] const IUnknown *object
- );
- HRESULT GetPrivateData(
- [in] REFGUID guid,
- [in, out] UINT *data_size,
- [out] void *data
- );
- HRESULT GetParent(
- [in] REFIID riid,
- [out] void **parent
- );
+ HRESULT SetPrivateData(
+ [in] REFGUID guid,
+ [in] UINT data_size,
+ [in] const void *data
+ );
+ HRESULT SetPrivateDataInterface(
+ [in] REFGUID guid,
+ [in] const IUnknown *object
+ );
+ HRESULT GetPrivateData(
+ [in] REFGUID guid,
+ [in, out] UINT *data_size,
+ [out] void *data
+ );
+ HRESULT GetParent(
+ [in] REFIID riid,
+ [out] void **parent
+ );
}
[
- object,
- local,
- uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
+ object,
+ local,
+ uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
]
interface IDXGIDeviceSubObject : IDXGIObject
{
- HRESULT GetDevice(
- [in] REFIID riid,
- [out] void **device
- );
+ HRESULT GetDevice(
+ [in] REFIID riid,
+ [out] void **device
+ );
}
[
- object,
- local,
- uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
+ object,
+ local,
+ uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
]
interface IDXGISurface : IDXGIDeviceSubObject
{
- HRESULT GetDesc(
- [out] DXGI_SURFACE_DESC *desc
- );
- HRESULT Map(
- [out] DXGI_MAPPED_RECT *mapped_rect,
- [in] UINT flags
- );
- HRESULT Unmap(
- );
+ HRESULT GetDesc(
+ [out] DXGI_SURFACE_DESC *desc
+ );
+ HRESULT Map(
+ [out] DXGI_MAPPED_RECT *mapped_rect,
+ [in] UINT flags
+ );
+ HRESULT Unmap(
+ );
}
[
- object,
- local,
- uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
+ object,
+ local,
+ uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
]
interface IDXGIOutput : IDXGIObject
{
- HRESULT GetDesc(
- [out] DXGI_OUTPUT_DESC *desc
- );
- HRESULT GetDisplayModeList(
- [in] DXGI_FORMAT format,
- [in] UINT flags,
- [in, out] UINT *mode_count,
- [out] DXGI_MODE_DESC *desc
- );
- HRESULT FindClosestMatchingMode(
- [in] const DXGI_MODE_DESC *mode,
- [out] DXGI_MODE_DESC *closest_match,
- [in] IUnknown *device
- );
- HRESULT WaitForVBlank(
- );
- HRESULT TakeOwnership(
- [in] IUnknown *device,
- [in] BOOL exclusive
- );
- void ReleaseOwnership(
- );
- HRESULT GetGammaControlCapabilities(
- [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
- );
- HRESULT SetGammaControl(
- [in] const DXGI_GAMMA_CONTROL *gamma_control
- );
- HRESULT GetGammaControl(
- [out] DXGI_GAMMA_CONTROL *gamma_control
- );
- HRESULT SetDisplaySurface(
- [in] IDXGISurface *surface
- );
- HRESULT GetDisplaySurfaceData(
- [in] IDXGISurface *surface
- );
- HRESULT GetFrameStatistics(
- [out] DXGI_FRAME_STATISTICS *stats
- );
+ HRESULT GetDesc(
+ [out] DXGI_OUTPUT_DESC *desc
+ );
+ HRESULT GetDisplayModeList(
+ [in] DXGI_FORMAT format,
+ [in] UINT flags,
+ [in, out] UINT *mode_count,
+ [out] DXGI_MODE_DESC *desc
+ );
+ HRESULT FindClosestMatchingMode(
+ [in] const DXGI_MODE_DESC *mode,
+ [out] DXGI_MODE_DESC *closest_match,
+ [in] IUnknown *device
+ );
+ HRESULT WaitForVBlank(
+ );
+ HRESULT TakeOwnership(
+ [in] IUnknown *device,
+ [in] BOOL exclusive
+ );
+ void ReleaseOwnership(
+ );
+ HRESULT GetGammaControlCapabilities(
+ [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
+ );
+ HRESULT SetGammaControl(
+ [in] const DXGI_GAMMA_CONTROL *gamma_control
+ );
+ HRESULT GetGammaControl(
+ [out] DXGI_GAMMA_CONTROL *gamma_control
+ );
+ HRESULT SetDisplaySurface(
+ [in] IDXGISurface *surface
+ );
+ HRESULT GetDisplaySurfaceData(
+ [in] IDXGISurface *surface
+ );
+ HRESULT GetFrameStatistics(
+ [out] DXGI_FRAME_STATISTICS *stats
+ );
}
[
- object,
- local,
- uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
+ object,
+ local,
+ uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
]
interface IDXGIAdapter : IDXGIObject
{
- HRESULT EnumOutputs(
- [in] UINT output_idx,
- [in, out] IDXGIOutput **output
- );
- HRESULT GetDesc(
- [out] DXGI_ADAPTER_DESC *desc
- );
- HRESULT CheckInterfaceSupport(
- [in] REFGUID guid,
- [out] LARGE_INTEGER *umd_version
- );
+ HRESULT EnumOutputs(
+ [in] UINT output_idx,
+ [in, out] IDXGIOutput **output
+ );
+ HRESULT GetDesc(
+ [out] DXGI_ADAPTER_DESC *desc
+ );
+ HRESULT CheckInterfaceSupport(
+ [in] REFGUID guid,
+ [out] LARGE_INTEGER *umd_version
+ );
}
[
- object,
- local,
- uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
+ object,
+ local,
+ uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
]
interface IDXGISwapChain : IDXGIDeviceSubObject
{
- HRESULT Present(
- [in] UINT sync_interval,
- [in] UINT flags
- );
- HRESULT GetBuffer(
- [in] UINT buffer_idx,
- [in] REFIID riid,
- [in, out] void **surface
- );
- HRESULT SetFullscreenState(
- [in] BOOL fullscreen,
- [in] IDXGIOutput *target
- );
- HRESULT GetFullscreenState(
- [out] BOOL *fullscreen,
- [out] IDXGIOutput **target
- );
- HRESULT GetDesc(
- [out] DXGI_SWAP_CHAIN_DESC *desc
- );
- HRESULT ResizeBuffers(
- [in] UINT buffer_count,
- [in] UINT width,
- [in] UINT height,
- [in] DXGI_FORMAT format,
- [in] UINT flags
- );
- HRESULT ResizeTarget(
- [in] const DXGI_MODE_DESC *target_mode_desc
- );
- HRESULT GetContainingOutput(
- [out] IDXGIOutput **output
- );
- HRESULT GetFrameStatistics(
- [out] DXGI_FRAME_STATISTICS *stats
- );
- HRESULT GetLastPresentCount(
- [out] UINT *last_present_count
- );
+ HRESULT Present(
+ [in] UINT sync_interval,
+ [in] UINT flags
+ );
+ HRESULT GetBuffer(
+ [in] UINT buffer_idx,
+ [in] REFIID riid,
+ [in, out] void **surface
+ );
+ HRESULT SetFullscreenState(
+ [in] BOOL fullscreen,
+ [in] IDXGIOutput *target
+ );
+ HRESULT GetFullscreenState(
+ [out] BOOL *fullscreen,
+ [out] IDXGIOutput **target
+ );
+ HRESULT GetDesc(
+ [out] DXGI_SWAP_CHAIN_DESC *desc
+ );
+ HRESULT ResizeBuffers(
+ [in] UINT buffer_count,
+ [in] UINT width,
+ [in] UINT height,
+ [in] DXGI_FORMAT format,
+ [in] UINT flags
+ );
+ HRESULT ResizeTarget(
+ [in] const DXGI_MODE_DESC *target_mode_desc
+ );
+ HRESULT GetContainingOutput(
+ [out] IDXGIOutput **output
+ );
+ HRESULT GetFrameStatistics(
+ [out] DXGI_FRAME_STATISTICS *stats
+ );
+ HRESULT GetLastPresentCount(
+ [out] UINT *last_present_count
+ );
}
[
- object,
- local,
- uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
+ object,
+ local,
+ uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
]
interface IDXGIFactory : IDXGIObject
{
- HRESULT EnumAdapters(
- [in] UINT adapter_idx,
- [out] IDXGIAdapter **adapter
- );
- HRESULT MakeWindowAssociation(
- [in] HWND window,
- [in] UINT flags
- );
- HRESULT GetWindowAssociation(
- [in] HWND *window
- );
- HRESULT CreateSwapChain(
- [in] IUnknown *device,
- [in] DXGI_SWAP_CHAIN_DESC *desc,
- [out] IDXGISwapChain **swapchain
- );
- HRESULT CreateSoftwareAdapter(
- [in] HMODULE swrast,
- [out] IDXGIAdapter **adapter
- );
+ HRESULT EnumAdapters(
+ [in] UINT adapter_idx,
+ [out] IDXGIAdapter **adapter
+ );
+ HRESULT MakeWindowAssociation(
+ [in] HWND window,
+ [in] UINT flags
+ );
+ HRESULT GetWindowAssociation(
+ [in] HWND *window
+ );
+ HRESULT CreateSwapChain(
+ [in] IUnknown *device,
+ [in] DXGI_SWAP_CHAIN_DESC *desc,
+ [out] IDXGISwapChain **swapchain
+ );
+ HRESULT CreateSoftwareAdapter(
+ [in] HMODULE swrast,
+ [out] IDXGIAdapter **adapter
+ );
}
[local] HRESULT CreateDXGIFactory(REFIID riid, void **factory);
[
- object,
- local,
- uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
+ object,
+ local,
+ uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
]
interface IDXGIDevice : IDXGIObject
{
- HRESULT GetAdapter(
- [out] IDXGIAdapter **adapter
- );
- HRESULT CreateSurface(
- [in] const DXGI_SURFACE_DESC *desc,
- [in] UINT surface_count,
- [in] DXGI_USAGE usage,
- [in] const DXGI_SHARED_RESOURCE *shared_resource,
- [out] IDXGISurface **surface
- );
- HRESULT QueryResourceResidency(
- [in] IUnknown *const *resources,
- [out] DXGI_RESIDENCY *residency,
- [in] UINT resource_count
- );
- HRESULT SetGPUThreadPriority(
- [in] INT priority
- );
- HRESULT GetGPUThreadPriority(
- [out] INT *priority
- );
+ HRESULT GetAdapter(
+ [out] IDXGIAdapter **adapter
+ );
+ HRESULT CreateSurface(
+ [in] const DXGI_SURFACE_DESC *desc,
+ [in] UINT surface_count,
+ [in] DXGI_USAGE usage,
+ [in] const DXGI_SHARED_RESOURCE *shared_resource,
+ [out] IDXGISurface **surface
+ );
+ HRESULT QueryResourceResidency(
+ [in] IUnknown *const *resources,
+ [out] DXGI_RESIDENCY *residency,
+ [in] UINT resource_count
+ );
+ HRESULT SetGPUThreadPriority(
+ [in] INT priority
+ );
+ HRESULT GetGPUThreadPriority(
+ [out] INT *priority
+ );
}
);
HRESULT SetEvictionPriority(
- [in] UINT EvictionPriority
+ [in] UINT EvictionPriority
);
HRESULT GetEvictionPriority(
interface IDXGISurface1 : IDXGISurface
{
HRESULT GetDC(
- [in] BOOL Discard,
+ [in] BOOL Discard,
[out] HDC *phdc
);
- HRESULT ReleaseDC(
+ HRESULT ReleaseDC(
[in, optional] RECT *pDirtyRect
);
};
interface IDXGIFactory1 : IDXGIFactory
{
HRESULT EnumAdapters1(
- [in] UINT Adapter,
+ [in] UINT Adapter,
[out] IDXGIAdapter1 **ppAdapter
);
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
import "dxgiformat.idl";
typedef struct DXGI_SAMPLE_DESC {
- UINT Count;
- UINT Quality;
+ UINT Count;
+ UINT Quality;
} DXGI_SAMPLE_DESC;
typedef enum DXGI_MODE_ROTATION {
- DXGI_MODE_ROTATION_UNSPECIFIED = 0,
- DXGI_MODE_ROTATION_IDENTITY = 1,
- DXGI_MODE_ROTATION_ROTATE90 = 2,
- DXGI_MODE_ROTATION_ROTATE180 = 3,
- DXGI_MODE_ROTATION_ROTATE270 = 4,
+ DXGI_MODE_ROTATION_UNSPECIFIED = 0,
+ DXGI_MODE_ROTATION_IDENTITY = 1,
+ DXGI_MODE_ROTATION_ROTATE90 = 2,
+ DXGI_MODE_ROTATION_ROTATE180 = 3,
+ DXGI_MODE_ROTATION_ROTATE270 = 4,
} DXGI_MODE_ROTATION;
typedef enum DXGI_MODE_SCANLINE_ORDER {
- DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
- DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1,
- DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2,
- DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3,
+ DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
+ DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1,
+ DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2,
+ DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3,
} DXGI_MODE_SCANLINE_ORDER;
typedef enum DXGI_MODE_SCALING {
- DXGI_MODE_SCALING_UNSPECIFIED = 0,
- DXGI_MODE_SCALING_CENTERED = 1,
- DXGI_MODE_SCALING_STRETCHED = 2,
+ DXGI_MODE_SCALING_UNSPECIFIED = 0,
+ DXGI_MODE_SCALING_CENTERED = 1,
+ DXGI_MODE_SCALING_STRETCHED = 2,
} DXGI_MODE_SCALING;
typedef struct DXGI_RATIONAL {
- UINT Numerator;
- UINT Denominator;
+ UINT Numerator;
+ UINT Denominator;
} DXGI_RATIONAL;
typedef struct DXGI_MODE_DESC {
- UINT Width;
- UINT Height;
- DXGI_RATIONAL RefreshRate;
- DXGI_FORMAT Format;
- DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
- DXGI_MODE_SCALING Scaling;
+ UINT Width;
+ UINT Height;
+ DXGI_RATIONAL RefreshRate;
+ DXGI_FORMAT Format;
+ DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
+ DXGI_MODE_SCALING Scaling;
} DXGI_MODE_DESC;
typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES {
- BOOL ScaleAndOffsetSupported;
- float MaxConvertedValue;
- float MinConvertedValue;
- UINT NumGammaControlPoints;
- float ControlPointPositions[1025];
+ BOOL ScaleAndOffsetSupported;
+ float MaxConvertedValue;
+ float MinConvertedValue;
+ UINT NumGammaControlPoints;
+ float ControlPointPositions[1025];
} DXGI_GAMMA_CONTROL_CAPABILITIES;
typedef struct DXGI_RGB {
- float Red;
- float Green;
- float Blue;
+ float Red;
+ float Green;
+ float Blue;
} DXGI_RGB;
typedef struct DXGI_GAMMA_CONTROL {
- DXGI_RGB Scale;
- DXGI_RGB Offset;
- DXGI_RGB GammaCurve[1025];
+ DXGI_RGB Scale;
+ DXGI_RGB Offset;
+ DXGI_RGB GammaCurve[1025];
} DXGI_GAMMA_CONTROL;
- Align multiline statements with an additional extra tab before each continuation line
- Keep in mind that people can program with proportional fonts: hence, don't attempt to align anything not at the start of the line, since it's impossible
- In general, there should never be two consecutive spaces in the source code
-- As a special exception, [in] and __in annotations are followed by two spaces to align them with [out] and __out if displayed with a fixed size font. This may be revisited.
- There is no strict limit on line length, but try to not make lines too long, and insert a line break where it looks good
* Language/platform features
/*
* Mesa 3-D graphics library
- * Version: 7.9
+ * Version: 7.9
*
* Copyright (C) 2010 LunarG Inc.
*
*
* 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
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
*
* Authors:
- * Chia-I Wu <olv@lunarg.com>
+ * Chia-I Wu <olv@lunarg.com>
*/
#include "dxgi_private.h"
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;
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;
}
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)
struct GalliumDXGIFactory : public GalliumDXGIObject<IDXGIFactory1, IUnknown>
{
- HWND associated_window;
+ HWND associated_window;
const struct native_platform* platform;
void* display;
ComPtr<IGalliumDXGIBackend> backend;
GalliumDXGIFactory(const struct native_platform* platform, void* display, IGalliumDXGIBackend* p_backend)
: GalliumDXGIObject<IDXGIFactory1, IUnknown>((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<IDXGIAdapter1, GalliumDXGIFactory>,
- IGalliumAdapter>
+ GalliumDXGIObject<IDXGIAdapter1, GalliumDXGIFactory>,
+ IGalliumAdapter>
{
struct native_display* display;
const struct native_config** configs;
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;
}
virtual HRESULT STDMETHODCALLTYPE GetDesc(
- __out DXGI_OUTPUT_DESC *pDesc)
+ __out DXGI_OUTPUT_DESC *pDesc)
{
*pDesc = desc;
return S_OK;
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?
}
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;
}
virtual HRESULT STDMETHODCALLTYPE TakeOwnership(
- __in IUnknown *pDevice,
+ __in IUnknown *pDevice,
BOOL Exclusive)
{
return S_OK;
}
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;
}
virtual HRESULT STDMETHODCALLTYPE GetGammaControl(
- __out DXGI_GAMMA_CONTROL *pArray)
+ __out DXGI_GAMMA_CONTROL *pArray)
{
if(gamma)
*pArray = *gamma;
}
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
* 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.
*
* 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.
*
if(desc.SwapEffect == DXGI_SWAP_EFFECT_SEQUENTIAL && desc.BufferCount != 1)
{
- std::cerr << "Gallium DXGI: if DXGI_SWAP_EFFECT_SEQUENTIAL is specified, only BufferCount == 1 is implemented, but " << desc.BufferCount << " was specified: ignoring this" << std::endl;
+ std::cerr << "Gallium DXGI: if DXGI_SWAP_EFFECT_SEQUENTIAL is specified, only BufferCount == 1 is implemented, but " << desc.BufferCount << " was specified: ignoring this" << std::endl;
// change the returned desc, so that the application might perhaps notice what we did and react well
desc.BufferCount = 1;
}
pipe->destroy(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<IDXGISurface> new_buffer0;
DXGI_USAGE usage = DXGI_USAGE_BACK_BUFFER | DXGI_USAGE_RENDER_TARGET_OUTPUT;
if(desc.SwapEffect == DXGI_SWAP_EFFECT_DISCARD)
templat.format = gallium_buffer0->format;
gallium_buffer0_view = pipe->create_sampler_view(pipe, gallium_buffer0, &templat);
return S_OK;
- }
+ }
bool validate()
{
}
virtual HRESULT STDMETHODCALLTYPE GetBuffer(
- UINT Buffer,
- __in REFIID riid,
- __out void **ppSurface)
+ UINT Buffer,
+ __in REFIID riid,
+ __out void **ppSurface)
{
if(Buffer > 0)
{
/* TODO: implement somehow */
virtual HRESULT STDMETHODCALLTYPE SetFullscreenState(
BOOL Fullscreen,
- __in_opt IDXGIOutput *pTarget)
+ __in_opt IDXGIOutput *pTarget)
{
fullscreen = Fullscreen;
target = pTarget;
}
virtual HRESULT STDMETHODCALLTYPE GetFullscreenState(
- __out BOOL *pFullscreen,
- __out IDXGIOutput **ppTarget)
+ __out BOOL *pFullscreen,
+ __out IDXGIOutput **ppTarget)
{
if(pFullscreen)
*pFullscreen = fullscreen;
}
virtual HRESULT STDMETHODCALLTYPE GetDesc(
- __out DXGI_SWAP_CHAIN_DESC *pDesc)
+ __out DXGI_SWAP_CHAIN_DESC *pDesc)
{
*pDesc = desc;
return S_OK;
}
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
}
virtual HRESULT STDMETHODCALLTYPE GetLastPresentCount(
- __out UINT *pLastPresentCount)
+ __out UINT *pLastPresentCount)
{
*pLastPresentCount = present_count;
return S_OK;
}
/* 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;
return hres;
}
- HRESULT STDMETHODCALLTYPE CreateDXGIFactory(
- __in REFIID riid,
- __out void **ppFactory
+ HRESULT STDMETHODCALLTYPE CreateDXGIFactory(
+ __in REFIID riid,
+ __out void **ppFactory
)
{
return CreateDXGIFactory1(riid, ppFactory);
#include <pipe/p_screen.h>
#include <pipe/p_context.h>
-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
)
{
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,
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
)
{
#include <pipe/p_screen.h>
#include <pipe/p_context.h>
-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;
#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
}
#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
#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<D3D11_STAGE_##XS>((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<D3D11_STAGE_##XS>(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<D3D11_STAGE_##XS>(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<D3D11_STAGE_##XS>(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) \
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)
}
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)
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
}
virtual void STDMETHODCALLTYPE IASetInputLayout(
- __in_opt ID3D11InputLayout *pInputLayout)
+ __in_opt ID3D11InputLayout *pInputLayout)
{
SYNCHRONIZED;
if(pInputLayout != input_layout.p)
}
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;
}
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)
}
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)
}
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)
}
virtual void STDMETHODCALLTYPE IASetPrimitiveTopology(
- __in D3D11_PRIMITIVE_TOPOLOGY Topology)
+ __in D3D11_PRIMITIVE_TOPOLOGY Topology)
{
SYNCHRONIZED;
if(primitive_topology != Topology)
}
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)
}
virtual void STDMETHODCALLTYPE Draw(
- __in unsigned VertexCount,
- __in unsigned StartVertexLocation)
+ __in unsigned VertexCount,
+ __in unsigned StartVertexLocation)
{
SYNCHRONIZED;
if(update_flags)
}
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)
}
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)
}
virtual void STDMETHODCALLTYPE DrawIndexedInstancedIndirect(
- __in ID3D11Buffer *pBufferForArgs,
- __in unsigned AlignedByteOffsetForArgs)
+ __in ID3D11Buffer *pBufferForArgs,
+ __in unsigned AlignedByteOffsetForArgs)
{
SYNCHRONIZED;
if(update_flags)
}
virtual void STDMETHODCALLTYPE DrawInstancedIndirect(
- __in ID3D11Buffer *pBufferForArgs,
- __in unsigned AlignedByteOffsetForArgs)
+ __in ID3D11Buffer *pBufferForArgs,
+ __in unsigned AlignedByteOffsetForArgs)
{
SYNCHRONIZED;
if(update_flags)
#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;
}
virtual void STDMETHODCALLTYPE DispatchIndirect(
- __in ID3D11Buffer *pBufferForArgs,
- __in unsigned AlignedByteOffsetForArgs)
+ __in ID3D11Buffer *pBufferForArgs,
+ __in unsigned AlignedByteOffsetForArgs)
{
// uncomment this when this is implemented
// SYNCHRONIZED;
}
virtual void STDMETHODCALLTYPE RSSetState(
- __in_opt ID3D11RasterizerState *pRasterizerState)
+ __in_opt ID3D11RasterizerState *pRasterizerState)
{
SYNCHRONIZED;
if(pRasterizerState != rasterizer_state.p)
}
virtual void STDMETHODCALLTYPE RSGetState(
- __out ID3D11RasterizerState **ppRasterizerState)
+ __out ID3D11RasterizerState **ppRasterizerState)
{
SYNCHRONIZED;
*ppRasterizerState = rasterizer_state.ref();
}
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)
}
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)
}
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)
}
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)
}
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};
}
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)
}
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)
}
virtual void STDMETHODCALLTYPE OMGetDepthStencilState(
- __out_opt ID3D11DepthStencilState **ppDepthStencilState,
- __out_opt unsigned *pStencilRef)
+ __out_opt ID3D11DepthStencilState **ppDepthStencilState,
+ __out_opt unsigned *pStencilRef)
{
SYNCHRONIZED;
if(*ppDepthStencilState)
*/
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)
}
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)
#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)
}
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)
#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;
}
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
)
{
}
virtual void STDMETHODCALLTYPE Begin(
- __in ID3D11Asynchronous *pAsync)
+ __in ID3D11Asynchronous *pAsync)
{
SYNCHRONIZED;
if(caps.queries)
}
virtual void STDMETHODCALLTYPE End(
- __in ID3D11Asynchronous *pAsync)
+ __in ID3D11Asynchronous *pAsync)
{
SYNCHRONIZED;
if(caps.queries)
}
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)
}
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)
}
virtual void STDMETHODCALLTYPE GetPredication(
- __out_opt ID3D11Predicate **ppPredicate,
- __out_opt BOOL *pPredicateValue)
+ __out_opt ID3D11Predicate **ppPredicate,
+ __out_opt BOOL *pPredicateValue)
{
SYNCHRONIZED;
if(ppPredicate)
}
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;
}
virtual void STDMETHODCALLTYPE Unmap(
- __in ID3D11Resource *pResource,
- __in unsigned Subresource)
+ __in ID3D11Resource *pResource,
+ __in unsigned Subresource)
{
SYNCHRONIZED;
GalliumD3D11Resource<>* resource = (GalliumD3D11Resource<>*)pResource;
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;
}
virtual void STDMETHODCALLTYPE CopyResource(
- __in ID3D11Resource *pDstResource,
- __in ID3D11Resource *pSrcResource)
+ __in ID3D11Resource *pDstResource,
+ __in ID3D11Resource *pSrcResource)
{
SYNCHRONIZED;
GalliumD3D11Resource<>* dst = (GalliumD3D11Resource<>*)pDstResource;
}
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;
#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);
}
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);
#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;
}
}
virtual void STDMETHODCALLTYPE GenerateMips(
- __in ID3D11ShaderResourceView *pShaderResourceView)
+ __in ID3D11ShaderResourceView *pShaderResourceView)
{
SYNCHRONIZED;
#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;
}
virtual float STDMETHODCALLTYPE GetResourceMinLOD(
- __in ID3D11Resource *pResource)
+ __in ID3D11Resource *pResource)
{
SYNCHRONIZED;
GalliumD3D11Resource<>* resource = (GalliumD3D11Resource<>*)pResource;
#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;
#if API >= 11
virtual void STDMETHODCALLTYPE ExecuteCommandList(
- __in ID3D11CommandList *pCommandList,
+ __in ID3D11CommandList *pCommandList,
BOOL RestoreContextState)
{
SYNCHRONIZED;
virtual HRESULT STDMETHODCALLTYPE FinishCommandList(
BOOL RestoreDeferredContextState,
- __out_opt ID3D11CommandList **ppCommandList)
+ __out_opt ID3D11CommandList **ppCommandList)
{
SYNCHRONIZED;
return E_NOTIMPL;
#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);
}
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";
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);
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);
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];
}
virtual void STDMETHODCALLTYPE GetDevice(
- __out ID3D11Device **ppDevice
- )
+ __out ID3D11Device **ppDevice
+ )
{
device->AddRef();
*ppDevice = device;
unsigned eviction_priority;
virtual void STDMETHODCALLTYPE SetEvictionPriority(
- __in unsigned EvictionPriority)
+ __in unsigned EvictionPriority)
{
eviction_priority = EvictionPriority;
}
struct GalliumDXGIResource : public IDXGIResource
{
virtual HRESULT STDMETHODCALLTYPE SetEvictionPriority(
- __in unsigned EvictionPriority)
+ __in unsigned EvictionPriority)
{
static_cast<Real*>(this)->eviction_priority = EvictionPriority;
return S_OK;
virtual HRESULT STDMETHODCALLTYPE GetEvictionPriority(unsigned* pEvictionPriority)
{
- *pEvictionPriority = static_cast<Real*>(this)->eviction_priority;
- return S_OK;
+ *pEvictionPriority = static_cast<Real*>(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<Real*>(this)->device)
return E_NOINTERFACE;
}
virtual HRESULT STDMETHODCALLTYPE GetParent(
- __in REFIID riid,
- __out void **ppParent)
+ __in REFIID riid,
+ __out void **ppParent)
{
if(!static_cast<Real*>(this)->device)
return E_NOINTERFACE;
}
virtual HRESULT STDMETHODCALLTYPE GetUsage(
- __out DXGI_USAGE *pUsage
- )
+ __out DXGI_USAGE *pUsage
+ )
{
*pUsage = this->dxgi_usage;
return S_OK;
: GalliumD3D11Resource<Base>(device, resource, dxgi_usage), desc(desc)
{}
virtual void STDMETHODCALLTYPE GetType(
- __out D3D11_RESOURCE_DIMENSION *pResourceDimension)
+ __out D3D11_RESOURCE_DIMENSION *pResourceDimension)
{
*pResourceDimension = Dim;
}
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
{}
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
{}
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);
+ }
};
{}
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
}
virtual HRESULT STDMETHODCALLTYPE GetDesc(
- __out DXGI_SURFACE_DESC *pDesc)
+ __out DXGI_SURFACE_DESC *pDesc)
{
pDesc->Format = this->desc.Format;
pDesc->Width = this->desc.Width;
}
virtual HRESULT STDMETHODCALLTYPE GetParent(
- __in REFIID riid,
- __out void **ppParent)
+ __in REFIID riid,
+ __out void **ppParent)
{
if(!device)
return E_NOINTERFACE;
/* TODO: somehow implement these */
virtual HRESULT STDMETHODCALLTYPE GetDC(
BOOL Discard,
- __out HDC *phdc)
+ __out HDC *phdc)
{
*phdc = 0;
return E_NOTIMPL;
}
virtual HRESULT STDMETHODCALLTYPE ReleaseDC(
- __in_opt RECT *pDirtyRect)
+ __in_opt RECT *pDirtyRect)
{
return E_NOTIMPL;
}
virtual HRESULT STDMETHODCALLTYPE Map(
- __out DXGI_MAPPED_RECT *pLockedRect,
+ __out DXGI_MAPPED_RECT *pLockedRect,
unsigned MapFlags)
{
D3D11_MAP d3d_map;
}
virtual HRESULT STDMETHODCALLTYPE GetDevice(
- __in REFIID riid,
- __out void **ppParent)
+ __in REFIID riid,
+ __out void **ppParent)
{
if(!device)
return E_NOINTERFACE;
}
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);
}
{}
virtual void STDMETHODCALLTYPE GetDesc(
- __out D3D11_QUERY_DESC *pDesc)
+ __out D3D11_QUERY_DESC *pDesc)
{
*pDesc = desc;
}
{}
virtual void STDMETHODCALLTYPE GetDesc(
- __out D3D11_COUNTER_DESC *pDesc)
+ __out D3D11_COUNTER_DESC *pDesc)
{
*pDesc = desc;
}
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
};
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
};
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
};
#if API >= 11
virtual void STDMETHODCALLTYPE GetImmediateContext(
- __out ID3D11DeviceContext **ppImmediateContext)
+ __out ID3D11DeviceContext **ppImmediateContext)
{
immediate_context->AddRef();
*ppImmediateContext = immediate_context;
}
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;
#if API >= 11
virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport(
D3D11_FEATURE Feature,
- __out_bcount(FeatureSupportDataSize) void *pFeatureSupportData,
+ __out_bcount(FeatureSupportDataSize) void *pFeatureSupportData,
unsigned FeatureSupportDataSize)
{
SYNCHRONIZED;
#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
{
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)
#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;
#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;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
virtual HRESULT STDMETHODCALLTYPE OpenGalliumResource(
- __in struct pipe_resource* resource,
- __out IUnknown** dxgi_resource)
+ __in struct pipe_resource* resource,
+ __out IUnknown** dxgi_resource)
{
SYNCHRONIZED;
}
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;
}
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;
}
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
#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;
#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;
}
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;
GalliumD3D11Shader<>* create_stage_shader(unsigned type, const void *pShaderBytecode, SIZE_T BytecodeLength
#if API >= 11
- , __in_opt ID3D11ClassLinkage *pClassLinkage
+ , __in_opt ID3D11ClassLinkage *pClassLinkage
#endif
)
{
#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); \
#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; \
}
#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;
#if API >= 11
virtual HRESULT STDMETHODCALLTYPE CreateClassLinkage(
- __out ID3D11ClassLinkage **ppLinkage)
+ __out ID3D11ClassLinkage **ppLinkage)
{
SYNCHRONIZED;
#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;
}
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;
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;
#if API >= 11
virtual HRESULT STDMETHODCALLTYPE CreateDeferredContext(
unsigned ContextFlags,
- __out_opt ID3D11DeviceContext **ppDeferredContext)
+ __out_opt ID3D11DeviceContext **ppDeferredContext)
{
SYNCHRONIZED;
#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;
* 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
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,
#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)
{
{
// turn Gallium resource into API resource
HRESULT OpenGalliumResource(
- [in] struct pipe_resource* resource,
+ [in] struct pipe_resource* resource,
[out] IUnknown** api_resource
);
* 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,
);
void EndPresent(
- [in] HWND hwnd,
+ [in] HWND hwnd,
[out] void* present_cookie
);
}
HRESULT hr;\r
if(0)\r
{\r
- hr = D3D10CreateDeviceAndSwapChain(\r
+ hr = D3D10CreateDeviceAndSwapChain(\r
NULL,\r
D3D10_DRIVER_TYPE_HARDWARE,\r
NULL,\r
}\r
else\r
{\r
- hr = D3D10CreateDeviceAndSwapChain1(\r
+ hr = D3D10CreateDeviceAndSwapChain1(\r
NULL,\r
D3D10_DRIVER_TYPE_HARDWARE,\r
NULL,\r
#include "d3d10tri.hlsl.vs.h"\r
\r
struct vertex {\r
- float position[4];\r
- float color[4];\r
+ float position[4];\r
+ float color[4];\r
};\r
\r
static struct vertex vertices[3] =\r
{\r
- {\r
- { 0.0f, 0.9f, 0.5f, 1.0f },\r
- { 1.0f, 0.0f, 0.0f, 1.0f }\r
- },\r
- {\r
- { 0.9f, -0.9f, 0.5f, 1.0f },\r
- { 0.0f, 0.0f, 1.0f, 1.0f }\r
- },\r
- {\r
- { -0.9f, -0.9f, 0.5f, 1.0f },\r
- { 0.0f, 1.0f, 0.0f, 1.0f }\r
- },\r
+ {\r
+ { 0.0f, 0.9f, 0.5f, 1.0f },\r
+ { 1.0f, 0.0f, 0.0f, 1.0f }\r
+ },\r
+ {\r
+ { 0.9f, -0.9f, 0.5f, 1.0f },\r
+ { 0.0f, 0.0f, 1.0f, 1.0f }\r
+ },\r
+ {\r
+ { -0.9f, -0.9f, 0.5f, 1.0f },\r
+ { 0.0f, 1.0f, 0.0f, 1.0f }\r
+ },\r
};\r
\r
struct d3d10tri : public d3d10_application\r
this->vertex_size = vertex_size;\r
index_offset = vertex_size * num_vertices;\r
\r
- D3D11_BUFFER_DESC bufferd;\r
+ D3D11_BUFFER_DESC bufferd;\r
memset(&bufferd, 0, sizeof(bufferd));\r
bufferd.Usage = D3D11_USAGE_IMMUTABLE;\r
bufferd.BindFlags = D3D11_BIND_VERTEX_BUFFER;\r
\r
D3D_FEATURE_LEVEL feature_level = D3D_FEATURE_LEVEL_10_0;\r
\r
- HRESULT hr =D3D11CreateDeviceAndSwapChain(\r
+ HRESULT hr =D3D11CreateDeviceAndSwapChain(\r
NULL,\r
D3D_DRIVER_TYPE_HARDWARE,\r
NULL,\r
/*\r
-* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.\r
-* Copyright (C) 2009-2010 Luca Barbieri All Rights Reserved.\r
+* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.\r
+* Copyright (C) 2009-2010 Luca Barbieri All Rights Reserved.\r
*\r
* Permission is hereby granted, free of charge, to any person obtaining a\r
* copy of this software and associated documentation files (the "Software"),\r
*\r
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
gears[2].mesh = build_gear(dev, triangles / 4, 1.3f, 2.0f, 0.5f, 10, 0.7f);\r
\r
gears[0].x = -3.0f;\r
- gears[0].y = -2.0f;\r
+ gears[0].y = -2.0f;\r
gears[0].wmul = 1.0f;\r
gears[0].t0 = 0.0 * M_PI / 180.0f;\r
\r
#include "d3d11tri.hlsl.vs.h"\r
\r
struct vertex {\r
- float position[4];\r
- float color[4];\r
+ float position[4];\r
+ float color[4];\r
};\r
\r
static struct vertex vertices[3] =\r
{\r
- {\r
- { 0.0f, 0.9f, 0.5f, 1.0f },\r
- { 1.0f, 0.0f, 0.0f, 1.0f }\r
- },\r
- {\r
- { 0.9f, -0.9f, 0.5f, 1.0f },\r
- { 0.0f, 0.0f, 1.0f, 1.0f }\r
- },\r
- {\r
- { -0.9f, -0.9f, 0.5f, 1.0f },\r
- { 0.0f, 1.0f, 0.0f, 1.0f }\r
- },\r
+ {\r
+ { 0.0f, 0.9f, 0.5f, 1.0f },\r
+ { 1.0f, 0.0f, 0.0f, 1.0f }\r
+ },\r
+ {\r
+ { 0.9f, -0.9f, 0.5f, 1.0f },\r
+ { 0.0f, 0.0f, 1.0f, 1.0f }\r
+ },\r
+ {\r
+ { -0.9f, -0.9f, 0.5f, 1.0f },\r
+ { 0.0f, 1.0f, 0.0f, 1.0f }\r
+ },\r
};\r
\r
struct d3d11tri : public d3d11_application\r