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
193f6bbd
Commit
193f6bbd
authored
Sep 26, 2006
by
H. Verbeet
Committed by
Alexandre Julliard
Sep 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add support for native NPOT textures.
parent
fdefaed4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
12 deletions
+32
-12
device.c
dlls/wined3d/device.c
+20
-11
directx.c
dlls/wined3d/directx.c
+9
-0
wined3d_main.c
dlls/wined3d/wined3d_main.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
wined3d_gl.h
include/wine/wined3d_gl.h
+1
-0
No files found.
dlls/wined3d/device.c
View file @
193f6bbd
...
...
@@ -971,11 +971,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U
*******************************/
/* Non-power2 support */
/* Find the nearest pow2 match */
pow2Width
=
pow2Height
=
1
;
while
(
pow2Width
<
Width
)
pow2Width
<<=
1
;
while
(
pow2Height
<
Height
)
pow2Height
<<=
1
;
if
(
wined3d_settings
.
nonpower2_mode
==
NP2_NATIVE
)
{
pow2Width
=
Width
;
pow2Height
=
Height
;
}
else
{
/* Find the nearest pow2 match */
pow2Width
=
pow2Height
=
1
;
while
(
pow2Width
<
Width
)
pow2Width
<<=
1
;
while
(
pow2Height
<
Height
)
pow2Height
<<=
1
;
}
if
(
pow2Width
>
Width
||
pow2Height
>
Height
)
{
/** TODO: add support for non power two compressed textures (OpenGL 2 provices support for * non-power-two textures gratis) **/
...
...
@@ -1125,8 +1129,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
UINT
tmpW
;
UINT
tmpH
;
HRESULT
hr
;
unsigned
int
pow2Width
=
Width
;
unsigned
int
pow2Height
=
Height
;
unsigned
int
pow2Width
;
unsigned
int
pow2Height
;
TRACE
(
"(%p) : Width %d, Height %d, Levels %d, Usage %#lx
\n
"
,
This
,
Width
,
Height
,
Levels
,
Usage
);
...
...
@@ -1146,10 +1150,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
object
->
height
=
Height
;
/** Non-power2 support **/
/* Find the nearest pow2 match */
pow2Width
=
pow2Height
=
1
;
while
(
pow2Width
<
Width
)
pow2Width
<<=
1
;
while
(
pow2Height
<
Height
)
pow2Height
<<=
1
;
if
(
wined3d_settings
.
nonpower2_mode
==
NP2_NATIVE
)
{
pow2Width
=
Width
;
pow2Height
=
Height
;
}
else
{
/* Find the nearest pow2 match */
pow2Width
=
pow2Height
=
1
;
while
(
pow2Width
<
Width
)
pow2Width
<<=
1
;
while
(
pow2Height
<
Height
)
pow2Height
<<=
1
;
}
/** FIXME: add support for real non-power-two if it's provided by the video card **/
/* Precalculated scaling for 'faked' non power of two texture coords */
...
...
dlls/wined3d/directx.c
View file @
193f6bbd
...
...
@@ -590,6 +590,9 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display) {
}
else
if
(
strcmp
(
ThisExtn
,
"GL_ARB_texture_mirrored_repeat"
)
==
0
)
{
TRACE_
(
d3d_caps
)(
" FOUND: ARB Texture mirrored repeat support
\n
"
);
gl_info
->
supported
[
ARB_TEXTURE_MIRRORED_REPEAT
]
=
TRUE
;
}
else
if
(
strcmp
(
ThisExtn
,
"GL_ARB_texture_non_power_of_two"
)
==
0
)
{
TRACE_
(
d3d_caps
)(
" FOUND: ARB NPOT texture support
\n
"
);
gl_info
->
supported
[
ARB_TEXTURE_NON_POWER_OF_TWO
]
=
TRUE
;
}
else
if
(
strcmp
(
ThisExtn
,
"GLX_ARB_multisample"
)
==
0
)
{
TRACE_
(
d3d_caps
)(
" FOUND: ARB multisample support
\n
"
);
gl_info
->
supported
[
ARB_MULTISAMPLE
]
=
TRUE
;
...
...
@@ -765,6 +768,12 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display) {
gl_info
->
max_sampler_stages
=
max
(
gl_info
->
max_samplers
,
gl_info
->
max_texture_stages
);
/* We can only use NP2_NATIVE when the hardware supports it. */
if
(
wined3d_settings
.
nonpower2_mode
==
NP2_NATIVE
&&
!
gl_info
->
supported
[
ARB_TEXTURE_NON_POWER_OF_TWO
])
{
WARN_
(
d3d_caps
)(
"GL_ARB_texture_non_power_of_two not supported, falling back to NP2_NONE NPOT mode.
\n
"
);
wined3d_settings
.
nonpower2_mode
=
NP2_NONE
;
}
/* Below is a list of Nvidia and ATI GPUs. Both vendors have dozens of different GPUs with roughly the same
* features. In most cases GPUs from a certain family differ in clockspeeds, the amount of video memory and
* in case of the latest videocards in the number of pixel/vertex pipelines.
...
...
dlls/wined3d/wined3d_main.c
View file @
193f6bbd
...
...
@@ -42,7 +42,7 @@ wined3d_settings_t wined3d_settings =
FALSE
,
/* Use of GLSL disabled by default */
SHADER_ARB
,
/* Use ARB vertex programs, when available */
SHADER_ARB
,
/* Use ARB fragment programs, when available */
NP2_N
ONE
,
/* Box NPOT textures
*/
NP2_N
ATIVE
,
/* Use native NPOT textures, when available
*/
RTL_AUTO
,
/* Automatically determine best locking method */
64
*
1024
*
1024
/* 64MB texture memory by default */
};
...
...
dlls/wined3d/wined3d_private.h
View file @
193f6bbd
...
...
@@ -132,6 +132,7 @@ static WINED3DGLTYPE const glTypeLookup[D3DDECLTYPE_UNUSED] = {
#define NP2_NONE 0
#define NP2_REPACK 1
#define NP2_NATIVE 2
#define SHADER_SW 0
#define SHADER_ARB 1
...
...
include/wine/wined3d_gl.h
View file @
193f6bbd
...
...
@@ -1424,6 +1424,7 @@ typedef enum _GL_SupportedExt {
ARB_HALF_FLOAT_PIXEL
,
ARB_TEXTURE_BORDER_CLAMP
,
ARB_TEXTURE_MIRRORED_REPEAT
,
ARB_TEXTURE_NON_POWER_OF_TWO
,
ARB_VERTEX_PROGRAM
,
ARB_VERTEX_BLEND
,
ARB_VERTEX_BUFFER_OBJECT
,
...
...
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