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
f3743fb4
Commit
f3743fb4
authored
Dec 15, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Shaders will never have a NULL function.
parent
46572f68
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
76 deletions
+21
-76
baseshader.c
dlls/wined3d/baseshader.c
+0
-15
nvidia_texture_shader.c
dlls/wined3d/nvidia_texture_shader.c
+2
-5
pixelshader.c
dlls/wined3d/pixelshader.c
+7
-16
state.c
dlls/wined3d/state.c
+4
-14
vertexshader.c
dlls/wined3d/vertexshader.c
+7
-23
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-3
No files found.
dlls/wined3d/baseshader.c
View file @
f3743fb4
...
...
@@ -216,13 +216,6 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m
memset
(
reg_maps
->
bumpmat
,
0
,
sizeof
(
reg_maps
->
bumpmat
));
memset
(
reg_maps
->
luminanceparams
,
0
,
sizeof
(
reg_maps
->
luminanceparams
));
if
(
!
pToken
)
{
WARN
(
"Got a NULL pFunction, returning.
\n
"
);
This
->
baseShader
.
functionLength
=
0
;
return
WINED3D_OK
;
}
/* get_registers_used is called on every compile on some 1.x shaders, which can result
* in stacking up a collection of local constants. Delete the old constants if existing
*/
...
...
@@ -844,8 +837,6 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
hw_arg
.
reg_maps
=
reg_maps
;
This
->
baseShader
.
parse_state
.
current_row
=
0
;
if
(
!
pToken
)
return
;
while
(
WINED3DPS_END
()
!=
*
pToken
)
{
/* Skip version token */
...
...
@@ -970,12 +961,6 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table
TRACE
(
"Parsing %p
\n
"
,
pFunction
);
if
(
!
pFunction
)
{
WARN
(
"Got a NULL pFunction, returning.
\n
"
);
return
;
}
/* The version token is supposed to be the first token */
if
(
!
shader_is_version_token
(
*
pToken
))
{
...
...
dlls/wined3d/nvidia_texture_shader.c
View file @
f3743fb4
...
...
@@ -457,11 +457,8 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3
TRACE
(
"Setting color op for stage %d
\n
"
,
stage
);
if
(
stateblock
->
pixelShader
&&
stateblock
->
wineD3DDevice
->
ps_selected_mode
!=
SHADER_NONE
&&
((
IWineD3DPixelShaderImpl
*
)
stateblock
->
pixelShader
)
->
baseShader
.
function
)
{
/* Using a pixel shader? Don't care for anything here, the shader applying does it */
return
;
}
/* Using a pixel shader? Don't care for anything here, the shader applying does it */
if
(
use_ps
(
stateblock
->
wineD3DDevice
))
return
;
if
(
stage
!=
mapped_stage
)
WARN
(
"Using non 1:1 mapping: %d -> %d!
\n
"
,
stage
,
mapped_stage
);
...
...
dlls/wined3d/pixelshader.c
View file @
f3743fb4
...
...
@@ -115,13 +115,10 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_GetFunction(IWineD3DPixelShader*
* return D3DERR_MOREDATA. That's not actually true. */
return
WINED3DERR_INVALIDCALL
;
}
if
(
NULL
==
This
->
baseShader
.
function
)
{
/* no function defined */
TRACE
(
"(%p) : GetFunction no User Function defined using NULL to %p
\n
"
,
This
,
pData
);
(
*
(
DWORD
**
)
pData
)
=
NULL
;
}
else
{
TRACE
(
"(%p) : GetFunction copying to %p
\n
"
,
This
,
pData
);
memcpy
(
pData
,
This
->
baseShader
.
function
,
This
->
baseShader
.
functionLength
);
}
TRACE
(
"(%p) : GetFunction copying to %p
\n
"
,
This
,
pData
);
memcpy
(
pData
,
This
->
baseShader
.
function
,
This
->
baseShader
.
functionLength
);
return
WINED3D_OK
;
}
...
...
@@ -382,16 +379,10 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *i
This
->
baseShader
.
shader_mode
=
deviceImpl
->
ps_selected_mode
;
TRACE
(
"(%p) : Copying the function
\n
"
,
This
);
if
(
NULL
!=
pFunction
)
{
void
*
function
;
function
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
This
->
baseShader
.
functionLength
);
if
(
!
function
)
return
E_OUTOFMEMORY
;
memcpy
(
function
,
pFunction
,
This
->
baseShader
.
functionLength
);
This
->
baseShader
.
function
=
function
;
}
else
{
This
->
baseShader
.
function
=
NULL
;
}
This
->
baseShader
.
function
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
baseShader
.
functionLength
);
if
(
!
This
->
baseShader
.
function
)
return
E_OUTOFMEMORY
;
memcpy
(
This
->
baseShader
.
function
,
pFunction
,
This
->
baseShader
.
functionLength
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/state.c
View file @
f3743fb4
...
...
@@ -2917,11 +2917,8 @@ static void tex_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
TRACE
(
"Setting color op for stage %d
\n
"
,
stage
);
if
(
stateblock
->
pixelShader
&&
stateblock
->
wineD3DDevice
->
ps_selected_mode
!=
SHADER_NONE
&&
((
IWineD3DPixelShaderImpl
*
)
stateblock
->
pixelShader
)
->
baseShader
.
function
)
{
/* Using a pixel shader? Don't care for anything here, the shader applying does it */
return
;
}
/* Using a pixel shader? Don't care for anything here, the shader applying does it */
if
(
use_ps
(
stateblock
->
wineD3DDevice
))
return
;
if
(
stage
!=
mapped_stage
)
WARN
(
"Using non 1:1 mapping: %d -> %d!
\n
"
,
stage
,
mapped_stage
);
...
...
@@ -4365,13 +4362,7 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
BOOL
load_numbered
=
FALSE
;
BOOL
load_named
=
FALSE
;
if
(
device
->
vs_selected_mode
!=
SHADER_NONE
&&
stateblock
->
vertexShader
&&
((
IWineD3DVertexShaderImpl
*
)
stateblock
->
vertexShader
)
->
baseShader
.
function
!=
NULL
)
{
useVertexShaderFunction
=
TRUE
;
}
else
{
useVertexShaderFunction
=
FALSE
;
}
useVertexShaderFunction
=
(
device
->
vs_selected_mode
!=
SHADER_NONE
&&
stateblock
->
vertexShader
)
?
TRUE
:
FALSE
;
if
(
device
->
up_strided
)
{
/* Note: this is a ddraw fixed-function code path */
...
...
@@ -4459,8 +4450,7 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
static
void
vertexdeclaration
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
WineD3DContext
*
context
)
{
BOOL
useVertexShaderFunction
=
FALSE
,
updateFog
=
FALSE
;
BOOL
usePixelShaderFunction
=
stateblock
->
wineD3DDevice
->
ps_selected_mode
!=
SHADER_NONE
&&
stateblock
->
pixelShader
&&
((
IWineD3DPixelShaderImpl
*
)
stateblock
->
pixelShader
)
->
baseShader
.
function
;
BOOL
usePixelShaderFunction
=
use_ps
(
stateblock
->
wineD3DDevice
);
BOOL
transformed
;
/* Some stuff is in the device until we have per context tracking */
IWineD3DDeviceImpl
*
device
=
stateblock
->
wineD3DDevice
;
...
...
dlls/wined3d/vertexshader.c
View file @
f3743fb4
...
...
@@ -412,13 +412,10 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_GetFunction(IWineD3DVertexShader*
* return D3DERR_MOREDATA. That's not actually true. */
return
WINED3DERR_INVALIDCALL
;
}
if
(
NULL
==
This
->
baseShader
.
function
)
{
/* no function defined */
TRACE
(
"(%p) : GetFunction no User Function defined using NULL to %p
\n
"
,
This
,
pData
);
(
*
(
DWORD
**
)
pData
)
=
NULL
;
}
else
{
TRACE
(
"(%p) : GetFunction copying to %p
\n
"
,
This
,
pData
);
memcpy
(
pData
,
This
->
baseShader
.
function
,
This
->
baseShader
.
functionLength
);
}
TRACE
(
"(%p) : GetFunction copying to %p
\n
"
,
This
,
pData
);
memcpy
(
pData
,
This
->
baseShader
.
function
,
This
->
baseShader
.
functionLength
);
return
WINED3D_OK
;
}
...
...
@@ -474,16 +471,9 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader
This
->
baseShader
.
load_local_constsF
=
This
->
baseShader
.
reg_maps
.
usesrelconstF
&&
!
list_empty
(
&
This
->
baseShader
.
constantsF
);
/* copy the function ... because it will certainly be released by application */
if
(
NULL
!=
pFunction
)
{
void
*
function
;
function
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
This
->
baseShader
.
functionLength
);
if
(
!
function
)
return
E_OUTOFMEMORY
;
memcpy
(
function
,
pFunction
,
This
->
baseShader
.
functionLength
);
This
->
baseShader
.
function
=
function
;
}
else
{
This
->
baseShader
.
function
=
NULL
;
}
This
->
baseShader
.
function
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
baseShader
.
functionLength
);
if
(
!
This
->
baseShader
.
function
)
return
E_OUTOFMEMORY
;
memcpy
(
This
->
baseShader
.
function
,
pFunction
,
This
->
baseShader
.
functionLength
);
return
WINED3D_OK
;
}
...
...
@@ -611,12 +601,6 @@ HRESULT IWineD3DVertexShaderImpl_CompileShader(IWineD3DVertexShader *iface) {
deviceImpl
->
shader_backend
->
shader_destroy
((
IWineD3DBaseShader
*
)
iface
);
}
/* We don't need to compile */
if
(
!
function
)
{
This
->
baseShader
.
is_compiled
=
TRUE
;
return
WINED3D_OK
;
}
/* Generate the HW shader */
TRACE
(
"(%p) : Generating hardware program
\n
"
,
This
);
IWineD3DVertexShaderImpl_GenerateShader
(
iface
,
&
This
->
baseShader
.
reg_maps
,
function
);
...
...
dlls/wined3d/wined3d_private.h
View file @
f3743fb4
...
...
@@ -2465,14 +2465,12 @@ const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt,
static
inline
BOOL
use_vs
(
IWineD3DDeviceImpl
*
device
)
{
return
(
device
->
vs_selected_mode
!=
SHADER_NONE
&&
device
->
stateBlock
->
vertexShader
&&
((
IWineD3DVertexShaderImpl
*
)
device
->
stateBlock
->
vertexShader
)
->
baseShader
.
function
&&
!
device
->
strided_streams
.
u
.
s
.
position_transformed
);
}
static
inline
BOOL
use_ps
(
IWineD3DDeviceImpl
*
device
)
{
return
(
device
->
ps_selected_mode
!=
SHADER_NONE
&&
device
->
stateBlock
->
pixelShader
&&
((
IWineD3DPixelShaderImpl
*
)
device
->
stateBlock
->
pixelShader
)
->
baseShader
.
function
);
&&
device
->
stateBlock
->
pixelShader
);
}
void
stretch_rect_fbo
(
IWineD3DDevice
*
iface
,
IWineD3DSurface
*
src_surface
,
WINED3DRECT
*
src_rect
,
...
...
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