Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
8dae597f
Commit
8dae597f
authored
Mar 12, 2007
by
Fabian Bieler
Committed by
Alexandre Julliard
Mar 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implemented signed texture formats via NV_TEXTURE_SHADER.
parent
89843f2c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
9 deletions
+39
-9
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+5
-3
surface.c
dlls/wined3d/surface.c
+30
-2
utils.c
dlls/wined3d/utils.c
+4
-4
No files found.
dlls/wined3d/arb_program_shader.c
View file @
8dae597f
...
...
@@ -694,6 +694,7 @@ void pshader_hw_texreg2gb(SHADER_OPCODE_ARG* arg) {
void
pshader_hw_texbem
(
SHADER_OPCODE_ARG
*
arg
)
{
IWineD3DPixelShaderImpl
*
This
=
(
IWineD3DPixelShaderImpl
*
)
arg
->
shader
;
WineD3D_GL_Info
*
gl_info
=
&
((
IWineD3DImpl
*
)(((
IWineD3DDeviceImpl
*
)(
This
->
baseShader
.
device
))
->
wineD3D
))
->
gl_info
;
DWORD
dst
=
arg
->
dst
;
DWORD
src
=
arg
->
src
[
0
]
&
WINED3DSP_REGNUM_MASK
;
...
...
@@ -714,11 +715,12 @@ void pshader_hw_texbem(SHADER_OPCODE_ARG* arg) {
* So the surface loading code converts the -128 ... 127 signed integers to
* 0 ... 255 unsigned ones. The following line undoes that.
*
* TODO:
Both GL_NV_texture_shader and GL_ATI_envmap_bumpmap provide
pixel formats
* suitable for loading the Direct3D perturbation data. If
one of them
is used, do
* TODO:
GL_ATI_envmap_bumpmap provides
pixel formats
* suitable for loading the Direct3D perturbation data. If
it
is used, do
* not correct the signedness
*/
shader_addline
(
buffer
,
"MAD T%u, T%u, coefmul.x, -one;
\n
"
,
src
,
src
);
if
(
!
GL_SUPPORT
(
NV_TEXTURE_SHADER3
))
shader_addline
(
buffer
,
"MAD T%u, T%u, coefmul.x, -one;
\n
"
,
src
,
src
);
shader_addline
(
buffer
,
"SWZ TMP2, bumpenvmat, x, z, 0, 0;
\n
"
);
shader_addline
(
buffer
,
"DP3 TMP.r, TMP2, T%u;
\n
"
,
src
);
...
...
dlls/wined3d/surface.c
View file @
8dae597f
...
...
@@ -1455,10 +1455,11 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
break
;
case
WINED3DFMT_V8U8
:
/* TODO: GL_
NV_texture_shader and GL_ATI_envmap_bumpmap provide
suitable formats.
* use
one of them
instead of converting
/* TODO: GL_
ATI_envmap_bumpmap provides
suitable formats.
* use
it
instead of converting
* Remember to adjust the texbem instruction in the shader
*/
if
(
GL_SUPPORT
(
NV_TEXTURE_SHADER3
))
break
;
*
convert
=
CONVERT_V8U8
;
*
format
=
GL_BGR
;
*
internal
=
GL_RGB8
;
...
...
@@ -1466,6 +1467,33 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
*
target_bpp
=
3
;
break
;
case
WINED3DFMT_X8L8V8U8
:
if
(
GL_SUPPORT
(
NV_TEXTURE_SHADER3
))
break
;
FIXME
(
"Conversion for D3D_X8L8V8U8 not implemented
\n
"
);
*
format
=
GL_BGRA
;
*
internal
=
GL_RGBA8
;
*
type
=
GL_BYTE
;
*
target_bpp
=
4
;
break
;
case
WINED3DFMT_Q8W8V8U8
:
if
(
GL_SUPPORT
(
NV_TEXTURE_SHADER3
))
break
;
FIXME
(
"Conversion for D3D_Q8W8V8U8 not implemented
\n
"
);
*
format
=
GL_BGRA
;
*
internal
=
GL_RGBA8
;
*
type
=
GL_BYTE
;
*
target_bpp
=
4
;
break
;
case
WINED3DFMT_V16U16
:
if
(
GL_SUPPORT
(
NV_TEXTURE_SHADER3
))
break
;
FIXME
(
"Conversion for D3D_V16U16 not implemented
\n
"
);
*
format
=
GL_COLOR_INDEX
;
*
internal
=
GL_COLOR_INDEX
;
*
type
=
GL_SHORT
;
*
target_bpp
=
4
;
break
;
default:
break
;
}
...
...
dlls/wined3d/utils.c
View file @
8dae597f
...
...
@@ -82,11 +82,11 @@ static const PixelFormatDesc formats[] = {
{
WINED3DFMT_A8L8
,
0x0000ff00
,
0x0
,
0x0
,
0x0
,
2
,
FALSE
,
GL_LUMINANCE8_ALPHA8
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_A4L4
,
0x000000f0
,
0x0
,
0x0
,
0x0
,
1
,
FALSE
,
GL_LUMINANCE4_ALPHA4
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
},
/* Bump mapping stuff */
{
WINED3DFMT_V8U8
,
0x0
,
0x0
,
0x0
,
0x0
,
2
,
FALSE
,
GL_
RGB8
,
GL_BGR
,
GL_BYTE
/* needs conversion! */
},
{
WINED3DFMT_V8U8
,
0x0
,
0x0
,
0x0
,
0x0
,
2
,
FALSE
,
GL_
DSDT8_NV
,
GL_DSDT_NV
,
GL_BYTE
},
{
WINED3DFMT_L6V5U5
,
0x0
,
0x0
,
0x0
,
0x0
,
2
,
FALSE
,
GL_COLOR_INDEX8_EXT
,
GL_COLOR_INDEX
,
GL_UNSIGNED_SHORT_5_5_5_1
},
{
WINED3DFMT_X8L8V8U8
,
0x0
,
0x0
,
0x0
,
0x0
,
4
,
FALSE
,
GL_
RGBA8
,
GL_BGRA
,
GL_UNSIGNED
_BYTE
},
{
WINED3DFMT_Q8W8V8U8
,
0x0
,
0x0
,
0x0
,
0x0
,
4
,
FALSE
,
GL_
RGBA8
,
GL_RGBA
,
GL_UNSIGNED_INT_8_8_8_8_REV
/*?*/
},
{
WINED3DFMT_V16U16
,
0x0
,
0x0
,
0x0
,
0x0
,
4
,
FALSE
,
GL_
COLOR_INDEX
,
GL_COLOR_INDEX
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_X8L8V8U8
,
0x0
,
0x0
,
0x0
,
0x0
,
4
,
FALSE
,
GL_
DSDT8_MAG8_INTENSITY8_NV
,
GL_DSDT_MAG_INTENSITY_NV
,
GL
_BYTE
},
{
WINED3DFMT_Q8W8V8U8
,
0x0
,
0x0
,
0x0
,
0x0
,
4
,
FALSE
,
GL_
SIGNED_RGBA8_NV
,
GL_RGBA
,
GL_BYTE
},
{
WINED3DFMT_V16U16
,
0x0
,
0x0
,
0x0
,
0x0
,
4
,
FALSE
,
GL_
SIGNED_HILO16_NV
,
GL_HILO_NV
,
GL_SHORT
},
{
WINED3DFMT_W11V11U10
,
0x0
,
0x0
,
0x0
,
0x0
,
4
,
FALSE
,
0
,
0
,
0
},
{
WINED3DFMT_A2W10V10U10
,
0xb0000000
,
0x0
,
0x0
,
0x0
,
4
,
FALSE
,
0
,
0
,
0
},
/* Depth stencil formats */
...
...
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