Module: wine
Branch: refs/heads/master
Commit: 7f9e61f7d2bc54731f755d10c9cc91cd7d8b6b08
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=7f9e61f7d2bc54731f755d1…
Author: H. Verbeet <hverbeet(a)gmail.com>
Date: Tue Jun 27 23:44:26 2006 +0200
wined3d: Use register combiners for texture stage operations.
Make wined3d use register combiners for texture stage operations. In
order to do that the texture unit index needs to be separated from the
texture stage index. For cards that don't support the
NV_register_combiners extension nothing should change.
---
dlls/wined3d/device.c | 29 +++--
dlls/wined3d/directx.c | 4 +
dlls/wined3d/drawprim.c | 220 ++++++++++++++++++++++----------------
dlls/wined3d/stateblock.c | 59 +++++-----
include/wine/wined3d_interface.h | 4 -
5 files changed, 179 insertions(+), 137 deletions(-)
Diff: http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=7f9e61f7d2bc54731f7…
Module: wine
Branch: refs/heads/master
Commit: f3a2a9f30aa5e860eabb6a3df6e5d9f40359bb31
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=f3a2a9f30aa5e860eabb6a3…
Author: H. Verbeet <hverbeet(a)gmail.com>
Date: Tue Jun 27 23:42:35 2006 +0200
wined3d: Add code for using register combiners for texture stage operations.
On nVidia cards the value of GL_MAX_TEXTURE_UNITS is generally not
larger than 4. In Direct3D that would correspond to
MaxSimultaneousTextures in the caps, rather than MaxTextureBlendStages
(which can be much larger) to which it currently corresponds in
wined3d. Using register combiners we can get around that limitation
and get up to GL_MAX_GENERAL_COMBINERS_NV (typically 8) texture
stages. This patch adds code for doing the texture operations with
register combiners instead of ARB_texture_env_combine or
NV_texture_env_combine4, but doesn't make use of that code yet. That's
what the next patch will do.
---
dlls/wined3d/utils.c | 357 ++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/wined3d_private.h | 1
2 files changed, 358 insertions(+), 0 deletions(-)
Diff: http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=f3a2a9f30aa5e860eab…
Module: wine
Branch: refs/heads/master
Commit: ac98d566acc20b0334d3deacd7c95869336f4d53
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=ac98d566acc20b0334d3dea…
Author: H. Verbeet <hverbeet(a)gmail.com>
Date: Tue Jun 27 23:41:27 2006 +0200
wined3d: Fix uploading of textures for shaders.
The code for uploading / binding textures for use with pixel shaders
is slightly different from the one for uploading / binding textures
for use with the fixed function pipeline. It would be possible to keep
the code in a single function with a couple of conditionals, but in
combination with the changes needed for register combiners that would
become quite messy.
---
dlls/wined3d/drawprim.c | 47 +++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 675813f..157ec0f 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -2076,6 +2076,46 @@ void inline drawPrimitiveTraceDataLocati
}
+static void drawPrimitiveUploadTexturesPS(IWineD3DDeviceImpl* This) {
+ INT i;
+
+ for (i = 0; i < GL_LIMITS(samplers); ++i) {
+ /* Pixel shader support should imply multitexture support. */
+ if (GL_SUPPORT(ARB_MULTITEXTURE)) {
+ GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + i));
+ checkGLcall("glActiveTextureARB");
+ } else if (i) {
+ WARN("Program using multiple concurrent textures which this opengl implementation doesn't support\n");
+ }
+
+ if (!This->stateBlock->textures[i]) continue;
+
+ /* Enable the correct target. Is this required for GLSL? For ARB_fragment_program it isn't, afaik. */
+ glDisable(GL_TEXTURE_1D);
+ This->stateBlock->textureDimensions[i] = IWineD3DBaseTexture_GetTextureDimensions(This->stateBlock->textures[i]);
+ switch(This->stateBlock->textureDimensions[i]) {
+ case GL_TEXTURE_2D:
+ glDisable(GL_TEXTURE_3D);
+ glDisable(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
+ case GL_TEXTURE_3D:
+ glDisable(GL_TEXTURE_CUBE_MAP_ARB);
+ glDisable(GL_TEXTURE_2D);
+ break;
+ case GLTEXTURECUBEMAP:
+ glDisable(GL_TEXTURE_2D);
+ glDisable(GL_TEXTURE_3D);
+ break;
+ }
+ glEnable(This->stateBlock->textureDimensions[i]);
+
+ /* Upload texture, apply states */
+ IWineD3DBaseTexture_PreLoad((IWineD3DBaseTexture *) This->stateBlock->textures[i]);
+ IWineD3DDevice_SetupTextureStates((IWineD3DDevice *)This, i, REAPPLY_ALPHAOP);
+ IWineD3DBaseTexture_ApplyStateChanges(This->stateBlock->textures[i], This->stateBlock->textureState[i], This->stateBlock->samplerState[i]);
+ }
+}
+
/* uploads textures and setup texture states ready for rendering */
void inline drawPrimitiveUploadTextures(IWineD3DDeviceImpl* This) {
@@ -2282,8 +2322,11 @@ void drawPrimitive(IWineD3DDevice *iface
/* Now initialize the materials state */
init_materials(iface, (dataLocations->u.s.diffuse.lpData != NULL || dataLocations->u.s.diffuse.VBO != 0));
- drawPrimitiveUploadTextures(This);
-
+ if (usePixelShaderFunction) {
+ drawPrimitiveUploadTexturesPS(This);
+ } else {
+ drawPrimitiveUploadTextures(This);
+ }
{
GLenum glPrimType;
Module: wine
Branch: refs/heads/master
Commit: a54e36adfebd721c1f5c823b2edf784f1af1d9c2
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=a54e36adfebd721c1f5c823…
Author: H. Verbeet <hverbeet(a)gmail.com>
Date: Tue Jun 27 23:40:42 2006 +0200
wined3d: Texture limits fixes.
GL_LIMITS(textures) is currently used for both the number of texture
stages and the maximum number of simultaneous textures. In the current
code that's the same, but in a later patch that will be separated,
since a texture stage doesn't have to reference an actual
texture. Also, shaders can access a larger number of samplers than the
number of texture units the fixed function pipeline can access.
---
dlls/wined3d/device.c | 32 +++++++++++++++--------------
dlls/wined3d/directx.c | 10 ++++++---
dlls/wined3d/drawprim.c | 6 +++--
dlls/wined3d/stateblock.c | 44 ++++++++++++++++++----------------------
dlls/wined3d/wined3d_private.h | 4 ++--
include/wine/wined3d_gl.h | 2 ++
6 files changed, 50 insertions(+), 48 deletions(-)
Diff: http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=a54e36adfebd721c1f5…