Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d511f18f
Commit
d511f18f
authored
Aug 15, 2010
by
Rico Schüller
Committed by
Alexandre Julliard
Aug 17, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Implement D3DCreateBlob().
parent
09b347ae
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
207 additions
and
1 deletion
+207
-1
Makefile.in
dlls/d3dcompiler_43/Makefile.in
+2
-0
blob.c
dlls/d3dcompiler_43/blob.c
+117
-0
d3dcompiler_43.spec
dlls/d3dcompiler_43/d3dcompiler_43.spec
+1
-1
d3dcompiler_43_main.c
dlls/d3dcompiler_43/d3dcompiler_43_main.c
+37
-0
d3dcompiler_private.h
dlls/d3dcompiler_43/d3dcompiler_private.h
+50
-0
No files found.
dlls/d3dcompiler_43/Makefile.in
View file @
d511f18f
...
...
@@ -4,8 +4,10 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
d3dcompiler_43.dll
IMPORTLIB
=
d3dcompiler
IMPORTS
=
dxguid uuid
C_SRCS
=
\
blob.c
\
d3dcompiler_43_main.c
RC_SRCS
=
version.rc
...
...
dlls/d3dcompiler_43/blob.c
0 → 100644
View file @
d511f18f
/*
* Direct3D blob file
*
* Copyright 2010 Rico Schüller
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include "config.h"
#include "wine/port.h"
#include "d3dcompiler_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dcompiler
);
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
d3dcompiler_blob_QueryInterface
(
ID3DBlob
*
iface
,
REFIID
riid
,
void
**
object
)
{
TRACE
(
"iface %p, riid %s, object %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D10Blob
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IUnknown_AddRef
(
iface
);
*
object
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE
\n
"
,
debugstr_guid
(
riid
));
*
object
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
STDMETHODCALLTYPE
d3dcompiler_blob_AddRef
(
ID3DBlob
*
iface
)
{
struct
d3dcompiler_blob
*
blob
=
(
struct
d3dcompiler_blob
*
)
iface
;
ULONG
refcount
=
InterlockedIncrement
(
&
blob
->
refcount
);
TRACE
(
"%p increasing refcount to %u
\n
"
,
blob
,
refcount
);
return
refcount
;
}
static
ULONG
STDMETHODCALLTYPE
d3dcompiler_blob_Release
(
ID3DBlob
*
iface
)
{
struct
d3dcompiler_blob
*
blob
=
(
struct
d3dcompiler_blob
*
)
iface
;
ULONG
refcount
=
InterlockedDecrement
(
&
blob
->
refcount
);
TRACE
(
"%p decreasing refcount to %u
\n
"
,
blob
,
refcount
);
if
(
!
refcount
)
{
HeapFree
(
GetProcessHeap
(),
0
,
blob
->
data
);
HeapFree
(
GetProcessHeap
(),
0
,
blob
);
}
return
refcount
;
}
/* ID3DBlob methods */
static
void
*
STDMETHODCALLTYPE
d3dcompiler_blob_GetBufferPointer
(
ID3DBlob
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
NULL
;
}
static
SIZE_T
STDMETHODCALLTYPE
d3dcompiler_blob_GetBufferSize
(
ID3DBlob
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
0
;
}
const
struct
ID3D10BlobVtbl
d3dcompiler_blob_vtbl
=
{
/* IUnknown methods */
d3dcompiler_blob_QueryInterface
,
d3dcompiler_blob_AddRef
,
d3dcompiler_blob_Release
,
/* ID3DBlob methods */
d3dcompiler_blob_GetBufferPointer
,
d3dcompiler_blob_GetBufferSize
,
};
HRESULT
d3dcompiler_blob_init
(
struct
d3dcompiler_blob
*
blob
,
SIZE_T
data_size
)
{
blob
->
vtbl
=
&
d3dcompiler_blob_vtbl
;
blob
->
refcount
=
1
;
blob
->
size
=
data_size
;
blob
->
data
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
data_size
);
if
(
!
blob
->
data
)
{
ERR
(
"Failed to allocate D3D blob data memory
\n
"
);
return
E_OUTOFMEMORY
;
}
return
S_OK
;
}
dlls/d3dcompiler_43/d3dcompiler_43.spec
View file @
d511f18f
...
...
@@ -2,7 +2,7 @@
@ stub DebugSetMute
@ stub D3DCompile
@ stub D3DCompressShaders
@ st
ub D3DCreateBlob
@ st
dcall D3DCreateBlob(long ptr)
@ stub D3DDecompressShaders
@ stub D3DDisassemble10Effect
@ stub D3DDisassemble
...
...
dlls/d3dcompiler_43/d3dcompiler_43_main.c
View file @
d511f18f
...
...
@@ -27,6 +27,8 @@
#include "winbase.h"
#include "wine/debug.h"
#include "d3dcompiler_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dcompiler
);
BOOL
WINAPI
DllMain
(
HINSTANCE
inst
,
DWORD
reason
,
LPVOID
reserved
)
...
...
@@ -43,3 +45,38 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
}
return
TRUE
;
}
HRESULT
WINAPI
D3DCreateBlob
(
SIZE_T
data_size
,
ID3DBlob
**
blob
)
{
struct
d3dcompiler_blob
*
object
;
HRESULT
hr
;
TRACE
(
"data_size %lu, blob %p
\n
"
,
data_size
,
blob
);
if
(
!
blob
)
{
WARN
(
"Invalid blob specified.
\n
"
);
return
D3DERR_INVALIDCALL
;
}
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate D3D blob object memory
\n
"
);
return
E_OUTOFMEMORY
;
}
hr
=
d3dcompiler_blob_init
(
object
,
data_size
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize blob, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
*
blob
=
(
ID3DBlob
*
)
object
;
TRACE
(
"Created ID3DBlob %p
\n
"
,
object
);
return
S_OK
;
}
dlls/d3dcompiler_43/d3dcompiler_private.h
0 → 100644
View file @
d511f18f
/*
* Copyright 2010 Rico Schüller
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_D3DCOMPILER_PRIVATE_H
#define __WINE_D3DCOMPILER_PRIVATE_H
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "d3dcompiler.h"
/*
* This doesn't belong here, but for some functions it is possible to return that value,
* see http://msdn.microsoft.com/en-us/library/bb205278%28v=VS.85%29.aspx
* The original definition is in D3DX10core.h.
*/
#define D3DERR_INVALIDCALL 0x8876086c
/* ID3DBlob */
struct
d3dcompiler_blob
{
const
struct
ID3D10BlobVtbl
*
vtbl
;
LONG
refcount
;
SIZE_T
size
;
void
*
data
;
};
HRESULT
d3dcompiler_blob_init
(
struct
d3dcompiler_blob
*
blob
,
SIZE_T
data_size
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_D3DCOMPILER_PRIVATE_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment