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
70ed814b
Commit
70ed814b
authored
Dec 12, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the textureDimensions field in the state block.
parent
f36c377d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
117 additions
and
95 deletions
+117
-95
device.c
dlls/wined3d/device.c
+5
-9
nvidia_texture_shader.c
dlls/wined3d/nvidia_texture_shader.c
+1
-1
state.c
dlls/wined3d/state.c
+78
-58
stateblock.c
dlls/wined3d/stateblock.c
+0
-2
utils.c
dlls/wined3d/utils.c
+33
-24
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-1
No files found.
dlls/wined3d/device.c
View file @
70ed814b
...
@@ -2064,7 +2064,6 @@ static void create_dummy_textures(IWineD3DDeviceImpl *This) {
...
@@ -2064,7 +2064,6 @@ static void create_dummy_textures(IWineD3DDeviceImpl *This) {
/* Generate a dummy 2d texture (not using 1d because they cause many
/* Generate a dummy 2d texture (not using 1d because they cause many
* DRI drivers fall back to sw) */
* DRI drivers fall back to sw) */
This
->
stateBlock
->
textureDimensions
[
i
]
=
GL_TEXTURE_2D
;
glBindTexture
(
GL_TEXTURE_2D
,
This
->
dummyTextureName
[
i
]);
glBindTexture
(
GL_TEXTURE_2D
,
This
->
dummyTextureName
[
i
]);
checkGLcall
(
"glBindTexture"
);
checkGLcall
(
"glBindTexture"
);
...
@@ -4673,14 +4672,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface, DWORD
...
@@ -4673,14 +4672,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface, DWORD
oldTexture
=
This
->
updateStateBlock
->
textures
[
Stage
];
oldTexture
=
This
->
updateStateBlock
->
textures
[
Stage
];
if
(
pTexture
!=
NULL
)
{
/* SetTexture isn't allowed on textures in WINED3DPOOL_SCRATCH */
/* SetTexture isn't allowed on textures in WINED3DPOOL_SCRATCH;
if
(
pTexture
&&
((
IWineD3DTextureImpl
*
)
pTexture
)
->
resource
.
pool
==
WINED3DPOOL_SCRATCH
)
*/
{
if
(((
IWineD3DTextureImpl
*
)
pTexture
)
->
resource
.
pool
==
WINED3DPOOL_SCRATCH
)
{
WARN
(
"(%p) Attempt to set scratch texture rejected
\n
"
,
pTexture
);
WARN
(
"(%p) Attempt to set scratch texture rejected
\n
"
,
pTexture
);
return
WINED3DERR_INVALIDCALL
;
return
WINED3DERR_INVALIDCALL
;
}
This
->
stateBlock
->
textureDimensions
[
Stage
]
=
IWineD3DBaseTexture_GetTextureDimensions
(
pTexture
);
}
}
TRACE
(
"GL_LIMITS %d
\n
"
,
GL_LIMITS
(
sampler_stages
));
TRACE
(
"GL_LIMITS %d
\n
"
,
GL_LIMITS
(
sampler_stages
));
...
...
dlls/wined3d/nvidia_texture_shader.c
View file @
70ed814b
...
@@ -41,7 +41,7 @@ static void nvts_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateb
...
@@ -41,7 +41,7 @@ static void nvts_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateb
}
}
if
(
stateblock
->
textures
[
stage
])
{
if
(
stateblock
->
textures
[
stage
])
{
switch
(
stateblock
->
textureDimensions
[
stage
]
)
{
switch
(
IWineD3DBaseTexture_GetTextureDimensions
(
stateblock
->
textures
[
stage
])
)
{
case
GL_TEXTURE_2D
:
case
GL_TEXTURE_2D
:
glTexEnvi
(
GL_TEXTURE_SHADER_NV
,
GL_SHADER_OPERATION_NV
,
bumpmap
?
GL_OFFSET_TEXTURE_2D_NV
:
GL_TEXTURE_2D
);
glTexEnvi
(
GL_TEXTURE_SHADER_NV
,
GL_SHADER_OPERATION_NV
,
bumpmap
?
GL_OFFSET_TEXTURE_2D_NV
:
GL_TEXTURE_2D
);
checkGLcall
(
"glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, ...)"
);
checkGLcall
(
"glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, ...)"
);
...
...
dlls/wined3d/state.c
View file @
70ed814b
This diff is collapsed.
Click to expand it.
dlls/wined3d/stateblock.c
View file @
70ed814b
...
@@ -203,7 +203,6 @@ void stateblock_copy(
...
@@ -203,7 +203,6 @@ void stateblock_copy(
memcpy
(
Dest
->
clipplane
,
This
->
clipplane
,
sizeof
(
double
)
*
MAX_CLIPPLANES
*
4
);
memcpy
(
Dest
->
clipplane
,
This
->
clipplane
,
sizeof
(
double
)
*
MAX_CLIPPLANES
*
4
);
memcpy
(
Dest
->
renderState
,
This
->
renderState
,
sizeof
(
DWORD
)
*
(
WINEHIGHEST_RENDER_STATE
+
1
));
memcpy
(
Dest
->
renderState
,
This
->
renderState
,
sizeof
(
DWORD
)
*
(
WINEHIGHEST_RENDER_STATE
+
1
));
memcpy
(
Dest
->
textures
,
This
->
textures
,
sizeof
(
IWineD3DBaseTexture
*
)
*
MAX_COMBINED_SAMPLERS
);
memcpy
(
Dest
->
textures
,
This
->
textures
,
sizeof
(
IWineD3DBaseTexture
*
)
*
MAX_COMBINED_SAMPLERS
);
memcpy
(
Dest
->
textureDimensions
,
This
->
textureDimensions
,
sizeof
(
int
)
*
MAX_COMBINED_SAMPLERS
);
memcpy
(
Dest
->
textureState
,
This
->
textureState
,
sizeof
(
DWORD
)
*
MAX_TEXTURES
*
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
));
memcpy
(
Dest
->
textureState
,
This
->
textureState
,
sizeof
(
DWORD
)
*
MAX_TEXTURES
*
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
));
memcpy
(
Dest
->
samplerState
,
This
->
samplerState
,
sizeof
(
DWORD
)
*
MAX_COMBINED_SAMPLERS
*
(
WINED3D_HIGHEST_SAMPLER_STATE
+
1
));
memcpy
(
Dest
->
samplerState
,
This
->
samplerState
,
sizeof
(
DWORD
)
*
MAX_COMBINED_SAMPLERS
*
(
WINED3D_HIGHEST_SAMPLER_STATE
+
1
));
...
@@ -613,7 +612,6 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
...
@@ -613,7 +612,6 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
memcpy
(
This
->
pixelShaderConstantF
,
targetStateBlock
->
pixelShaderConstantF
,
sizeof
(
float
)
*
GL_LIMITS
(
pshader_constantsF
)
*
4
);
memcpy
(
This
->
pixelShaderConstantF
,
targetStateBlock
->
pixelShaderConstantF
,
sizeof
(
float
)
*
GL_LIMITS
(
pshader_constantsF
)
*
4
);
memcpy
(
This
->
renderState
,
targetStateBlock
->
renderState
,
sizeof
(
This
->
renderState
));
memcpy
(
This
->
renderState
,
targetStateBlock
->
renderState
,
sizeof
(
This
->
renderState
));
memcpy
(
This
->
textures
,
targetStateBlock
->
textures
,
sizeof
(
This
->
textures
));
memcpy
(
This
->
textures
,
targetStateBlock
->
textures
,
sizeof
(
This
->
textures
));
memcpy
(
This
->
textureDimensions
,
targetStateBlock
->
textureDimensions
,
sizeof
(
This
->
textureDimensions
));
memcpy
(
This
->
textureState
,
targetStateBlock
->
textureState
,
sizeof
(
This
->
textureState
));
memcpy
(
This
->
textureState
,
targetStateBlock
->
textureState
,
sizeof
(
This
->
textureState
));
memcpy
(
This
->
samplerState
,
targetStateBlock
->
samplerState
,
sizeof
(
This
->
samplerState
));
memcpy
(
This
->
samplerState
,
targetStateBlock
->
samplerState
,
sizeof
(
This
->
samplerState
));
This
->
scissorRect
=
targetStateBlock
->
scissorRect
;
This
->
scissorRect
=
targetStateBlock
->
scissorRect
;
...
...
dlls/wined3d/utils.c
View file @
70ed814b
...
@@ -1931,7 +1931,7 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting
...
@@ -1931,7 +1931,7 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting
if
(
ignore_textype
)
{
if
(
ignore_textype
)
{
settings
->
op
[
i
].
tex_type
=
tex_1d
;
settings
->
op
[
i
].
tex_type
=
tex_1d
;
}
else
{
}
else
{
switch
(
stateblock
->
textureDimensions
[
i
]
)
{
switch
(
IWineD3DBaseTexture_GetTextureDimensions
((
IWineD3DBaseTexture
*
)
texture
)
)
{
case
GL_TEXTURE_1D
:
case
GL_TEXTURE_1D
:
settings
->
op
[
i
].
tex_type
=
tex_1d
;
settings
->
op
[
i
].
tex_type
=
tex_1d
;
break
;
break
;
...
@@ -1983,32 +1983,41 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting
...
@@ -1983,32 +1983,41 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting
aarg0
=
(
args
[
aop
]
&
ARG0
)
?
stateblock
->
textureState
[
i
][
WINED3DTSS_ALPHAARG0
]
:
ARG_UNUSED
;
aarg0
=
(
args
[
aop
]
&
ARG0
)
?
stateblock
->
textureState
[
i
][
WINED3DTSS_ALPHAARG0
]
:
ARG_UNUSED
;
}
}
if
(
i
==
0
&&
stateblock
->
textures
[
0
]
&&
if
(
i
==
0
&&
stateblock
->
textures
[
0
]
&&
stateblock
->
renderState
[
WINED3DRS_COLORKEYENABLE
])
stateblock
->
renderState
[
WINED3DRS_COLORKEYENABLE
]
&&
{
(
stateblock
->
textureDimensions
[
0
]
==
GL_TEXTURE_2D
||
UINT
texture_dimensions
=
IWineD3DBaseTexture_GetTextureDimensions
(
stateblock
->
textures
[
0
]);
stateblock
->
textureDimensions
[
0
]
==
GL_TEXTURE_RECTANGLE_ARB
))
{
IWineD3DSurfaceImpl
*
surf
=
(
IWineD3DSurfaceImpl
*
)
((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
0
])
->
surfaces
[
0
];
if
(
surf
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
&&
if
(
texture_dimensions
==
GL_TEXTURE_2D
||
texture_dimensions
==
GL_TEXTURE_RECTANGLE_ARB
)
getFormatDescEntry
(
surf
->
resource
.
format
,
NULL
,
NULL
)
->
alphaMask
==
0x00000000
)
{
{
IWineD3DSurfaceImpl
*
surf
;
surf
=
(
IWineD3DSurfaceImpl
*
)
((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
0
])
->
surfaces
[
0
];
if
(
aop
==
WINED3DTOP_DISABLE
)
{
if
(
surf
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
aarg1
=
WINED3DTA_TEXTURE
;
&&
getFormatDescEntry
(
surf
->
resource
.
format
,
NULL
,
NULL
)
->
alphaMask
==
0x00000000
)
aop
=
WINED3DTOP_SELECTARG1
;
{
}
if
(
aop
==
WINED3DTOP_DISABLE
)
else
if
(
aop
==
WINED3DTOP_SELECTARG1
&&
aarg1
!=
WINED3DTA_TEXTURE
)
{
{
if
(
stateblock
->
renderState
[
WINED3DRS_ALPHABLENDENABLE
])
{
aarg1
=
WINED3DTA_TEXTURE
;
aarg2
=
WINED3DTA_TEXTURE
;
aop
=
WINED3DTOP_SELECTARG1
;
aop
=
WINED3DTOP_MODULATE
;
}
}
else
aarg1
=
WINED3DTA_TEXTURE
;
else
if
(
aop
==
WINED3DTOP_SELECTARG1
&&
aarg1
!=
WINED3DTA_TEXTURE
)
}
{
else
if
(
aop
==
WINED3DTOP_SELECTARG2
&&
aarg2
!=
WINED3DTA_TEXTURE
)
{
if
(
stateblock
->
renderState
[
WINED3DRS_ALPHABLENDENABLE
])
if
(
stateblock
->
renderState
[
WINED3DRS_ALPHABLENDENABLE
])
{
{
aarg1
=
WINED3DTA_TEXTURE
;
aarg2
=
WINED3DTA_TEXTURE
;
aop
=
WINED3DTOP_MODULATE
;
aop
=
WINED3DTOP_MODULATE
;
}
else
aarg1
=
WINED3DTA_TEXTURE
;
}
else
if
(
aop
==
WINED3DTOP_SELECTARG2
&&
aarg2
!=
WINED3DTA_TEXTURE
)
{
if
(
stateblock
->
renderState
[
WINED3DRS_ALPHABLENDENABLE
])
{
aarg1
=
WINED3DTA_TEXTURE
;
aop
=
WINED3DTOP_MODULATE
;
}
else
aarg2
=
WINED3DTA_TEXTURE
;
}
}
else
aarg2
=
WINED3DTA_TEXTURE
;
}
}
}
}
}
}
...
@@ -2115,7 +2124,7 @@ void add_ffp_frag_shader(struct hash_table_t *shaders, struct ffp_frag_desc *des
...
@@ -2115,7 +2124,7 @@ void add_ffp_frag_shader(struct hash_table_t *shaders, struct ffp_frag_desc *des
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
void
texture_activate_dimensions
(
DWORD
stage
,
IWineD3DStateBlockImpl
*
stateblock
,
WineD3DContext
*
context
)
{
void
texture_activate_dimensions
(
DWORD
stage
,
IWineD3DStateBlockImpl
*
stateblock
,
WineD3DContext
*
context
)
{
if
(
stateblock
->
textures
[
stage
])
{
if
(
stateblock
->
textures
[
stage
])
{
switch
(
stateblock
->
textureDimensions
[
stage
]
)
{
switch
(
IWineD3DBaseTexture_GetTextureDimensions
(
stateblock
->
textures
[
stage
])
)
{
case
GL_TEXTURE_2D
:
case
GL_TEXTURE_2D
:
glDisable
(
GL_TEXTURE_3D
);
glDisable
(
GL_TEXTURE_3D
);
checkGLcall
(
"glDisable(GL_TEXTURE_3D)"
);
checkGLcall
(
"glDisable(GL_TEXTURE_3D)"
);
...
...
dlls/wined3d/wined3d_private.h
View file @
70ed814b
...
@@ -1835,7 +1835,6 @@ struct IWineD3DStateBlockImpl
...
@@ -1835,7 +1835,6 @@ struct IWineD3DStateBlockImpl
/* Texture */
/* Texture */
IWineD3DBaseTexture
*
textures
[
MAX_COMBINED_SAMPLERS
];
IWineD3DBaseTexture
*
textures
[
MAX_COMBINED_SAMPLERS
];
int
textureDimensions
[
MAX_COMBINED_SAMPLERS
];
/* Texture State Stage */
/* Texture State Stage */
DWORD
textureState
[
MAX_TEXTURES
][
WINED3D_HIGHEST_TEXTURE_STATE
+
1
];
DWORD
textureState
[
MAX_TEXTURES
][
WINED3D_HIGHEST_TEXTURE_STATE
+
1
];
...
...
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