summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/d3d1x/d3d1xstutil
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-09-21 02:39:52 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-09-21 15:44:41 +0200
commit70fed0b0ec8a3ec4f6b9b47f1fe98cc54c6037f0 (patch)
tree915bd721659a1a3eaf7bb2705c371cbef4bd9917 /src/gallium/state_trackers/d3d1x/d3d1xstutil
parent2ec86793bd43fe15d8f79d04e32d6c524e8ad844 (diff)
d3d1x: add blob and signature extraction APIs
NOTE: untested, needs a testing tool!
Diffstat (limited to 'src/gallium/state_trackers/d3d1x/d3d1xstutil')
-rw-r--r--src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h34
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_ */