Commit cbc86300 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d8: Make the shader handle table a bit more generic.

parent 954c3e22
...@@ -35,9 +35,6 @@ ...@@ -35,9 +35,6 @@
#include "d3d8.h" #include "d3d8.h"
#include "wine/wined3d.h" #include "wine/wined3d.h"
/* Device caps */
#define INITIAL_SHADER_HANDLE_TABLE_SIZE 64
/* CreateVertexShader can return > 0xFFFF */ /* CreateVertexShader can return > 0xFFFF */
#define VS_HIGHESTFIXEDFXF 0xF0000000 #define VS_HIGHESTFIXEDFXF 0xF0000000
...@@ -166,7 +163,16 @@ extern const IWineD3DDeviceParentVtbl d3d8_wined3d_device_parent_vtbl; ...@@ -166,7 +163,16 @@ extern const IWineD3DDeviceParentVtbl d3d8_wined3d_device_parent_vtbl;
* IDirect3DDevice8 implementation structure * IDirect3DDevice8 implementation structure
*/ */
typedef void * shader_handle; #define D3D8_INITIAL_HANDLE_TABLE_SIZE 64
#define D3D8_INVALID_HANDLE ~0U
struct d3d8_handle_table
{
void **entries;
void **free_entries;
UINT table_size;
UINT entry_count;
};
struct FvfToDecl struct FvfToDecl
{ {
...@@ -182,10 +188,7 @@ struct IDirect3DDevice8Impl ...@@ -182,10 +188,7 @@ struct IDirect3DDevice8Impl
LONG ref; LONG ref;
/* But what about baseVertexIndex in state blocks? hmm... it may be a better idea to pass this to wined3d */ /* But what about baseVertexIndex in state blocks? hmm... it may be a better idea to pass this to wined3d */
IWineD3DDevice *WineD3DDevice; IWineD3DDevice *WineD3DDevice;
DWORD shader_handle_table_size; struct d3d8_handle_table handle_table;
DWORD allocated_shader_handles;
shader_handle *shader_handles;
shader_handle *free_shader_handles;
/* FVF management */ /* FVF management */
struct FvfToDecl *decls; struct FvfToDecl *decls;
......
...@@ -323,8 +323,9 @@ static HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapte ...@@ -323,8 +323,9 @@ static HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapte
object->lpVtbl = &Direct3DDevice8_Vtbl; object->lpVtbl = &Direct3DDevice8_Vtbl;
object->device_parent_vtbl = &d3d8_wined3d_device_parent_vtbl; object->device_parent_vtbl = &d3d8_wined3d_device_parent_vtbl;
object->ref = 1; object->ref = 1;
object->shader_handles = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, INITIAL_SHADER_HANDLE_TABLE_SIZE * sizeof(shader_handle)); object->handle_table.entries = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
object->shader_handle_table_size = INITIAL_SHADER_HANDLE_TABLE_SIZE; D3D8_INITIAL_HANDLE_TABLE_SIZE * sizeof(*object->handle_table.entries));
object->handle_table.table_size = D3D8_INITIAL_HANDLE_TABLE_SIZE;
*ppReturnedDeviceInterface = (IDirect3DDevice8 *)object; *ppReturnedDeviceInterface = (IDirect3DDevice8 *)object;
/* Allocate an associated WineD3DDevice object */ /* Allocate an associated WineD3DDevice object */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment