From cc2ea9e08ce968b39731e6fa0d08ffdbe02a775f Mon Sep 17 00:00:00 2001 From: Jason Green Date: Tue, 9 May 2006 22:31:09 -0400 Subject: [PATCH] wined3d: Place # of textures, addresses, & temps used inside the baseShader struct to prepare for GenerateShader merge. --- dlls/wined3d/baseshader.c | 8 +++++--- dlls/wined3d/pixelshader.c | 5 ++++- dlls/wined3d/vertexshader.c | 5 ++++- dlls/wined3d/wined3d_private.h | 6 +++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c index b0653361143..2b28cdb6354 100644 --- a/dlls/wined3d/baseshader.c +++ b/dlls/wined3d/baseshader.c @@ -96,9 +96,11 @@ const SHADER_OPCODE* shader_get_opcode( void shader_get_registers_used( IWineD3DBaseShader *iface, - CONST DWORD* pToken, - DWORD* tempsUsed, - DWORD* texUsed) { + CONST DWORD* pToken) { + + IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; + DWORD* tempsUsed = &This->baseShader.temps_used; + DWORD* texUsed = &This->baseShader.textures_used; if (pToken == NULL) return; diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c index a93178a154e..22691b06df2 100644 --- a/dlls/wined3d/pixelshader.c +++ b/dlls/wined3d/pixelshader.c @@ -1337,7 +1337,10 @@ inline static VOID IWineD3DPixelShaderImpl_GenerateProgramArbHW(IWineD3DPixelSha This->constants[i] = 0; /* First pass: figure out which temporary and texture registers are used */ - shader_get_registers_used((IWineD3DBaseShader*) This, pToken, &tempsUsed, &texUsed); + shader_get_registers_used((IWineD3DBaseShader*) This, pToken); + texUsed = This->baseShader.textures_used; + tempsUsed = This->baseShader.temps_used; + TRACE("Texture registers used: %#lx, Temp registers used %#lx\n", texUsed, tempsUsed); /* TODO: check register usage against GL/Directx limits, and fail if they're exceeded */ diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c index 8a67a1a4e55..a0550958371 100644 --- a/dlls/wined3d/vertexshader.c +++ b/dlls/wined3d/vertexshader.c @@ -1153,7 +1153,10 @@ inline static VOID IWineD3DVertexShaderImpl_GenerateProgramArbHW(IWineD3DVertexS buffer.lineNo = 0; /* First pass: figure out which temporary and texture registers are used */ - shader_get_registers_used((IWineD3DBaseShader*) This, pToken, &tempsUsed, &addressUsed); + shader_get_registers_used((IWineD3DBaseShader*) This, pToken); + addressUsed = This->baseShader.textures_used; + tempsUsed = This->baseShader.temps_used; + TRACE("Address registers used: %#lx, Temp registers used %#lx\n", addressUsed, tempsUsed); /* TODO: check register usage against GL/Directx limits, and fail if they're exceeded diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 31a8b83d4ea..ab36d829efb 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1260,6 +1260,8 @@ typedef struct IWineD3DBaseShaderClass { DWORD version; DWORD hex_version; + DWORD temps_used; + DWORD textures_used; SHADER_LIMITS limits; SHADER_PARSE_STATE parse_state; CONST SHADER_OPCODE *shader_ins; @@ -1279,9 +1281,7 @@ typedef struct IWineD3DBaseShaderImpl { extern void shader_get_registers_used( IWineD3DBaseShader *iface, - CONST DWORD* pToken, - DWORD* tempsUsed, - DWORD* texUsed); + CONST DWORD* pToken); extern void shader_program_dump_decl_usage( DWORD dcl,