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
2173fde7
Commit
2173fde7
authored
Jun 06, 2008
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 06, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Avoid float->string conversion in arb shaders.
parent
20655afb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+24
-4
wined3d_gl.h
include/wine/wined3d_gl.h
+1
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
2173fde7
...
...
@@ -354,12 +354,13 @@ void shader_generate_arb_declarations(
ps_impl
->
srgb_mode_hardcoded
=
1
;
}
/* Hardcodable local constants */
/* Load local constants using the program-local space,
* this avoids reloading them each time the shader is used
*/
if
(
!
This
->
baseShader
.
load_local_constsF
)
{
LIST_FOR_EACH_ENTRY
(
lconst
,
&
This
->
baseShader
.
constantsF
,
local_constant
,
entry
)
{
float
*
value
=
(
float
*
)
lconst
->
value
;
shader_addline
(
buffer
,
"PARAM C%u = {%f, %f, %f, %f};
\n
"
,
lconst
->
idx
,
value
[
0
],
value
[
1
],
value
[
2
],
value
[
3
]);
shader_addline
(
buffer
,
"PARAM C%u = program.local[%u];
\n
"
,
lconst
->
idx
,
lconst
->
idx
);
}
}
...
...
@@ -1873,6 +1874,7 @@ static void shader_arb_generate_pshader(IWineD3DPixelShader *iface, SHADER_BUFFE
CONST
DWORD
*
function
=
This
->
baseShader
.
function
;
const
char
*
fragcolor
;
WineD3D_GL_Info
*
gl_info
=
&
((
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
)
->
adapter
->
gl_info
;
local_constant
*
lconst
;
/* Create the hw ARB shader */
shader_addline
(
buffer
,
"!!ARBfp1.0
\n
"
);
...
...
@@ -1954,6 +1956,15 @@ static void shader_arb_generate_pshader(IWineD3DPixelShader *iface, SHADER_BUFFE
errPos
,
debugstr_a
((
const
char
*
)
glGetString
(
GL_PROGRAM_ERROR_STRING_ARB
)));
This
->
baseShader
.
prgId
=
-
1
;
}
/* Load immediate constants */
if
(
!
This
->
baseShader
.
load_local_constsF
)
{
LIST_FOR_EACH_ENTRY
(
lconst
,
&
This
->
baseShader
.
constantsF
,
local_constant
,
entry
)
{
float
*
value
=
(
float
*
)
lconst
->
value
;
GL_EXTCALL
(
glProgramLocalParameter4fvARB
(
GL_FRAGMENT_PROGRAM_ARB
,
lconst
->
idx
,
value
));
checkGLcall
(
"glProgramLocalParameter4fvARB"
);
}
}
}
static
void
shader_arb_generate_vshader
(
IWineD3DVertexShader
*
iface
,
SHADER_BUFFER
*
buffer
)
{
...
...
@@ -1961,6 +1972,7 @@ static void shader_arb_generate_vshader(IWineD3DVertexShader *iface, SHADER_BUFF
shader_reg_maps
*
reg_maps
=
&
This
->
baseShader
.
reg_maps
;
CONST
DWORD
*
function
=
This
->
baseShader
.
function
;
WineD3D_GL_Info
*
gl_info
=
&
((
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
)
->
adapter
->
gl_info
;
local_constant
*
lconst
;
/* Create the hw ARB shader */
shader_addline
(
buffer
,
"!!ARBvp1.0
\n
"
);
...
...
@@ -2049,6 +2061,14 @@ static void shader_arb_generate_vshader(IWineD3DVertexShader *iface, SHADER_BUFF
errPos
,
debugstr_a
((
const
char
*
)
glGetString
(
GL_PROGRAM_ERROR_STRING_ARB
)));
This
->
baseShader
.
prgId
=
-
1
;
}
/* Load immediate constants */
if
(
!
This
->
baseShader
.
load_local_constsF
)
{
LIST_FOR_EACH_ENTRY
(
lconst
,
&
This
->
baseShader
.
constantsF
,
local_constant
,
entry
)
{
float
*
value
=
(
float
*
)
lconst
->
value
;
GL_EXTCALL
(
glProgramLocalParameter4fvARB
(
GL_VERTEX_PROGRAM_ARB
,
lconst
->
idx
,
value
));
}
}
}
static
void
shader_arb_get_caps
(
WINED3DDEVTYPE
devtype
,
WineD3D_GL_Info
*
gl_info
,
struct
shader_caps
*
pCaps
)
{
...
...
include/wine/wined3d_gl.h
View file @
2173fde7
...
...
@@ -3487,6 +3487,7 @@ typedef enum _GL_SupportedExt {
USE_GL_FUNC(PGLFNPROGRAMSTRINGARBPROC, glProgramStringARB, ARB_VERTEX_PROGRAM, NULL );\
USE_GL_FUNC(PGLFNDELETEPROGRAMSARBPROC, glDeleteProgramsARB, ARB_VERTEX_PROGRAM, NULL );\
USE_GL_FUNC(PGLFNPROGRAMENVPARAMETER4FVARBPROC, glProgramEnvParameter4fvARB, ARB_VERTEX_PROGRAM, NULL );\
USE_GL_FUNC(PGLFNPROGRAMLOCALPARAMETER4FVARBPROC, glProgramLocalParameter4fvARB, ARB_VERTEX_PROGRAM, NULL );\
USE_GL_FUNC(PGLFNVERTEXATTRIBPOINTERARBPROC, glVertexAttribPointerARB, ARB_VERTEX_PROGRAM, NULL );\
USE_GL_FUNC(PGLFNENABLEVERTEXATTRIBARRAYARBPROC, glEnableVertexAttribArrayARB, ARB_VERTEX_PROGRAM, NULL );\
USE_GL_FUNC(PGLFNDISABLEVERTEXATTRIBARRAYARBPROC, glDisableVertexAttribArrayARB, ARB_VERTEX_PROGRAM, NULL );\
...
...
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