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
32779a22
Commit
32779a22
authored
Jan 03, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass an IWineD3DBaseTextureImpl pointer to basetexture_bind().
parent
bf108ac8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
20 deletions
+22
-20
basetexture.c
dlls/wined3d/basetexture.c
+18
-16
cubetexture.c
dlls/wined3d/cubetexture.c
+1
-1
texture.c
dlls/wined3d/texture.c
+1
-1
volumetexture.c
dlls/wined3d/volumetexture.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/basetexture.c
View file @
32779a22
...
@@ -243,23 +243,23 @@ BOOL basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty)
...
@@ -243,23 +243,23 @@ BOOL basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty)
}
}
/* Context activation is done by the caller. */
/* Context activation is done by the caller. */
HRESULT
basetexture_bind
(
IWineD3DBaseTexture
*
ifac
e
,
BOOL
srgb
,
BOOL
*
set_surface_desc
)
HRESULT
basetexture_bind
(
IWineD3DBaseTexture
Impl
*
textur
e
,
BOOL
srgb
,
BOOL
*
set_surface_desc
)
{
{
IWineD3DBaseTextureImpl
*
This
=
(
IWineD3DBaseTextureImpl
*
)
iface
;
HRESULT
hr
=
WINED3D_OK
;
HRESULT
hr
=
WINED3D_OK
;
GLenum
textureDimensions
;
GLenum
textureDimensions
;
BOOL
isNewTexture
=
FALSE
;
BOOL
isNewTexture
=
FALSE
;
struct
gl_texture
*
gl_tex
;
struct
gl_texture
*
gl_tex
;
TRACE
(
"(%p) : About to bind texture
\n
"
,
This
);
This
->
baseTexture
.
is_srgb
=
srgb
;
/* SRGB mode cache for PreLoad calls outside drawprim */
TRACE
(
"texture %p, srgb %#x, set_surface_desc %p.
\n
"
,
texture
,
srgb
,
set_surface_desc
);
if
(
srgb
)
{
gl_tex
=
&
This
->
baseTexture
.
texture_srgb
;
texture
->
baseTexture
.
is_srgb
=
srgb
;
/* SRGB mode cache for PreLoad calls outside drawprim */
}
else
{
if
(
srgb
)
gl_tex
=
&
This
->
baseTexture
.
texture_rgb
;
gl_tex
=
&
texture
->
baseTexture
.
texture_srgb
;
}
else
gl_tex
=
&
texture
->
baseTexture
.
texture_rgb
;
textureDimensions
=
texture
->
baseTexture
.
target
;
textureDimensions
=
This
->
baseTexture
.
target
;
ENTER_GL
();
ENTER_GL
();
/* Generate a texture name if we don't already have one */
/* Generate a texture name if we don't already have one */
if
(
!
gl_tex
->
name
)
if
(
!
gl_tex
->
name
)
...
@@ -268,7 +268,8 @@ HRESULT basetexture_bind(IWineD3DBaseTexture *iface, BOOL srgb, BOOL *set_surfac
...
@@ -268,7 +268,8 @@ HRESULT basetexture_bind(IWineD3DBaseTexture *iface, BOOL srgb, BOOL *set_surfac
glGenTextures
(
1
,
&
gl_tex
->
name
);
glGenTextures
(
1
,
&
gl_tex
->
name
);
checkGLcall
(
"glGenTextures"
);
checkGLcall
(
"glGenTextures"
);
TRACE
(
"Generated texture %d
\n
"
,
gl_tex
->
name
);
TRACE
(
"Generated texture %d
\n
"
,
gl_tex
->
name
);
if
(
This
->
resource
.
pool
==
WINED3DPOOL_DEFAULT
)
{
if
(
texture
->
resource
.
pool
==
WINED3DPOOL_DEFAULT
)
{
/* Tell opengl to try and keep this texture in video ram (well mostly) */
/* Tell opengl to try and keep this texture in video ram (well mostly) */
GLclampf
tmp
;
GLclampf
tmp
;
tmp
=
0
.
9
f
;
tmp
=
0
.
9
f
;
...
@@ -288,10 +289,11 @@ HRESULT basetexture_bind(IWineD3DBaseTexture *iface, BOOL srgb, BOOL *set_surfac
...
@@ -288,10 +289,11 @@ HRESULT basetexture_bind(IWineD3DBaseTexture *iface, BOOL srgb, BOOL *set_surfac
gl_tex
->
states
[
WINED3DTEXSTA_MAXANISOTROPY
]
=
1
;
gl_tex
->
states
[
WINED3DTEXSTA_MAXANISOTROPY
]
=
1
;
gl_tex
->
states
[
WINED3DTEXSTA_SRGBTEXTURE
]
=
0
;
gl_tex
->
states
[
WINED3DTEXSTA_SRGBTEXTURE
]
=
0
;
gl_tex
->
states
[
WINED3DTEXSTA_SHADOW
]
=
FALSE
;
gl_tex
->
states
[
WINED3DTEXSTA_SHADOW
]
=
FALSE
;
basetexture_set_dirty
(
This
,
TRUE
);
basetexture_set_dirty
(
texture
,
TRUE
);
isNewTexture
=
TRUE
;
isNewTexture
=
TRUE
;
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_AUTOGENMIPMAP
)
{
if
(
texture
->
resource
.
usage
&
WINED3DUSAGE_AUTOGENMIPMAP
)
{
/* This means double binding the texture at creation, but keeps the code simpler all
/* This means double binding the texture at creation, but keeps the code simpler all
* in all, and the run-time path free from additional checks
* in all, and the run-time path free from additional checks
*/
*/
...
@@ -319,9 +321,9 @@ HRESULT basetexture_bind(IWineD3DBaseTexture *iface, BOOL srgb, BOOL *set_surfac
...
@@ -319,9 +321,9 @@ HRESULT basetexture_bind(IWineD3DBaseTexture *iface, BOOL srgb, BOOL *set_surfac
*/
*/
if
(
textureDimensions
!=
GL_TEXTURE_RECTANGLE_ARB
)
if
(
textureDimensions
!=
GL_TEXTURE_RECTANGLE_ARB
)
{
{
TRACE
(
"Setting GL_TEXTURE_MAX_LEVEL to %u.
\n
"
,
This
->
baseTexture
.
level_count
-
1
);
TRACE
(
"Setting GL_TEXTURE_MAX_LEVEL to %u.
\n
"
,
texture
->
baseTexture
.
level_count
-
1
);
glTexParameteri
(
textureDimensions
,
GL_TEXTURE_MAX_LEVEL
,
This
->
baseTexture
.
level_count
-
1
);
glTexParameteri
(
textureDimensions
,
GL_TEXTURE_MAX_LEVEL
,
texture
->
baseTexture
.
level_count
-
1
);
checkGLcall
(
"glTexParameteri(textureDimensions, GL_TEXTURE_MAX_LEVEL,
This
->baseTexture.level_count)"
);
checkGLcall
(
"glTexParameteri(textureDimensions, GL_TEXTURE_MAX_LEVEL,
texture
->baseTexture.level_count)"
);
}
}
if
(
textureDimensions
==
GL_TEXTURE_CUBE_MAP_ARB
)
{
if
(
textureDimensions
==
GL_TEXTURE_CUBE_MAP_ARB
)
{
/* Cubemaps are always set to clamp, regardless of the sampler state. */
/* Cubemaps are always set to clamp, regardless of the sampler state. */
...
...
dlls/wined3d/cubetexture.c
View file @
32779a22
...
@@ -283,7 +283,7 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_BindTexture(IWineD3DCubeTexture *i
...
@@ -283,7 +283,7 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_BindTexture(IWineD3DCubeTexture *i
TRACE
(
"(%p) : relay to BaseTexture
\n
"
,
This
);
TRACE
(
"(%p) : relay to BaseTexture
\n
"
,
This
);
hr
=
basetexture_bind
((
IWineD3DBaseTexture
*
)
iface
,
srgb
,
&
set_gl_texture_desc
);
hr
=
basetexture_bind
((
IWineD3DBaseTexture
Impl
*
)
iface
,
srgb
,
&
set_gl_texture_desc
);
if
(
set_gl_texture_desc
&&
SUCCEEDED
(
hr
))
if
(
set_gl_texture_desc
&&
SUCCEEDED
(
hr
))
{
{
UINT
sub_count
=
This
->
baseTexture
.
level_count
*
This
->
baseTexture
.
layer_count
;
UINT
sub_count
=
This
->
baseTexture
.
level_count
*
This
->
baseTexture
.
layer_count
;
...
...
dlls/wined3d/texture.c
View file @
32779a22
...
@@ -274,7 +274,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_BindTexture(IWineD3DTexture *iface, BO
...
@@ -274,7 +274,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_BindTexture(IWineD3DTexture *iface, BO
TRACE
(
"(%p) : relay to BaseTexture
\n
"
,
This
);
TRACE
(
"(%p) : relay to BaseTexture
\n
"
,
This
);
hr
=
basetexture_bind
((
IWineD3DBaseTexture
*
)
iface
,
srgb
,
&
set_gl_texture_desc
);
hr
=
basetexture_bind
((
IWineD3DBaseTexture
Impl
*
)
iface
,
srgb
,
&
set_gl_texture_desc
);
if
(
set_gl_texture_desc
&&
SUCCEEDED
(
hr
))
{
if
(
set_gl_texture_desc
&&
SUCCEEDED
(
hr
))
{
UINT
i
;
UINT
i
;
struct
gl_texture
*
gl_tex
;
struct
gl_texture
*
gl_tex
;
...
...
dlls/wined3d/volumetexture.c
View file @
32779a22
...
@@ -237,7 +237,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_BindTexture(IWineD3DVolumeTextur
...
@@ -237,7 +237,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_BindTexture(IWineD3DVolumeTextur
TRACE
(
"iface %p, srgb %#x.
\n
"
,
iface
,
srgb
);
TRACE
(
"iface %p, srgb %#x.
\n
"
,
iface
,
srgb
);
return
basetexture_bind
((
IWineD3DBaseTexture
*
)
iface
,
srgb
,
&
dummy
);
return
basetexture_bind
((
IWineD3DBaseTexture
Impl
*
)
iface
,
srgb
,
&
dummy
);
}
}
static
BOOL
WINAPI
IWineD3DVolumeTextureImpl_IsCondNP2
(
IWineD3DVolumeTexture
*
iface
)
static
BOOL
WINAPI
IWineD3DVolumeTextureImpl_IsCondNP2
(
IWineD3DVolumeTexture
*
iface
)
...
...
dlls/wined3d/wined3d_private.h
View file @
32779a22
...
@@ -1912,7 +1912,7 @@ typedef struct IWineD3DBaseTextureImpl
...
@@ -1912,7 +1912,7 @@ typedef struct IWineD3DBaseTextureImpl
void
basetexture_apply_state_changes
(
IWineD3DBaseTexture
*
iface
,
void
basetexture_apply_state_changes
(
IWineD3DBaseTexture
*
iface
,
const
DWORD
samplerStates
[
WINED3D_HIGHEST_SAMPLER_STATE
+
1
],
const
DWORD
samplerStates
[
WINED3D_HIGHEST_SAMPLER_STATE
+
1
],
const
struct
wined3d_gl_info
*
gl_info
)
DECLSPEC_HIDDEN
;
const
struct
wined3d_gl_info
*
gl_info
)
DECLSPEC_HIDDEN
;
HRESULT
basetexture_bind
(
IWineD3DBaseTexture
*
ifac
e
,
BOOL
srgb
,
BOOL
*
set_surface_desc
)
DECLSPEC_HIDDEN
;
HRESULT
basetexture_bind
(
IWineD3DBaseTexture
Impl
*
textur
e
,
BOOL
srgb
,
BOOL
*
set_surface_desc
)
DECLSPEC_HIDDEN
;
void
basetexture_cleanup
(
IWineD3DBaseTextureImpl
*
texture
)
DECLSPEC_HIDDEN
;
void
basetexture_cleanup
(
IWineD3DBaseTextureImpl
*
texture
)
DECLSPEC_HIDDEN
;
void
basetexture_generate_mipmaps
(
IWineD3DBaseTextureImpl
*
texture
)
DECLSPEC_HIDDEN
;
void
basetexture_generate_mipmaps
(
IWineD3DBaseTextureImpl
*
texture
)
DECLSPEC_HIDDEN
;
WINED3DTEXTUREFILTERTYPE
basetexture_get_autogen_filter_type
(
IWineD3DBaseTextureImpl
*
texture
)
DECLSPEC_HIDDEN
;
WINED3DTEXTUREFILTERTYPE
basetexture_get_autogen_filter_type
(
IWineD3DBaseTextureImpl
*
texture
)
DECLSPEC_HIDDEN
;
...
...
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