diff options
Diffstat (limited to 'src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h')
-rw-r--r-- | src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h b/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h index a9260acdba..47bf842b7b 100644 --- a/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h +++ b/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h @@ -59,6 +59,7 @@ namespace std { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } #include "galliumdxgi.h" +#include <d3dcommon.h> extern "C" { @@ -1035,4 +1036,37 @@ struct GalliumDXGIDevice : public GalliumMultiPrivateDataComObject<Base, IDXGIDe } }; +COM_INTERFACE(ID3D10Blob, IUnknown); + +/* NOTE: ID3DBlob implementations may come from a Microsoft native DLL + * (e.g. d3dcompiler), or perhaps even from the application itself. + * + * Hence, never try to access the data/size members directly, which is why they are private. + * In internal code, use std::pair<void*, size_t> instead of this class. + */ +class GalliumD3DBlob : public GalliumComObject<ID3DBlob> +{ + void* data; + size_t size; + + GalliumD3DBlob(void* data, size_t size) + : data(data), size(size) + {} + + ~GalliumD3DBlob() + { + free(data); + } +public: + virtual LPVOID STDMETHODCALLTYPE GetBufferPointer() + { + return data; + } + + virtual SIZE_T STDMETHODCALLTYPE GetBufferSize() + { + return size; + } +}; + #endif /* D3D1XSTUTIL_H_ */ |