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
8fe80e18
Commit
8fe80e18
authored
Mar 30, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the IWineD3DBaseShader typedefs.
parent
f8f83ff2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
96 additions
and
104 deletions
+96
-104
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+23
-25
device.c
dlls/wined3d/device.c
+23
-25
glsl_shader.c
dlls/wined3d/glsl_shader.c
+25
-27
shader.c
dlls/wined3d/shader.c
+14
-14
state.c
dlls/wined3d/state.c
+2
-2
stateblock.c
dlls/wined3d/stateblock.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+7
-9
No files found.
dlls/wined3d/arb_program_shader.c
View file @
8fe80e18
...
...
@@ -362,7 +362,7 @@ static unsigned int reserved_vs_const(const struct arb_vshader_private *shader_d
* or GL_FRAGMENT_PROGRAM_ARB (for pixel shaders)
*/
/* GL locking is done by the caller */
static
unsigned
int
shader_arb_load_constantsF
(
IWineD3DBaseShaderImpl
*
shader
,
const
struct
wined3d_gl_info
*
gl_info
,
static
unsigned
int
shader_arb_load_constantsF
(
struct
wined3d_shader
*
shader
,
const
struct
wined3d_gl_info
*
gl_info
,
GLuint
target_type
,
unsigned
int
max_constants
,
const
float
*
constants
,
char
*
dirty_consts
)
{
local_constant
*
lconst
;
...
...
@@ -636,7 +636,7 @@ static void shader_arb_load_constants(const struct wined3d_context *context, cha
if
(
useVertexShader
)
{
IWineD3DBaseShaderImpl
*
vshader
=
(
IWineD3DBaseShaderImpl
*
)
stateBlock
->
state
.
vertex_shader
;
struct
wined3d_shader
*
vshader
=
stateBlock
->
state
.
vertex_shader
;
const
struct
arb_vs_compiled_shader
*
gl_shader
=
priv
->
compiled_vprog
;
/* Load DirectX 9 float constants for vertex shader */
...
...
@@ -647,7 +647,7 @@ static void shader_arb_load_constants(const struct wined3d_context *context, cha
if
(
usePixelShader
)
{
IWineD3DBaseShaderImpl
*
pshader
=
(
IWineD3DBaseShaderImpl
*
)
stateBlock
->
state
.
pixel_shader
;
struct
wined3d_shader
*
pshader
=
stateBlock
->
state
.
pixel_shader
;
const
struct
arb_ps_compiled_shader
*
gl_shader
=
priv
->
compiled_fprog
;
float
rt_height
=
device
->
render_targets
[
0
]
->
resource
.
height
;
...
...
@@ -682,7 +682,7 @@ static void shader_arb_update_float_pixel_constants(IWineD3DDeviceImpl *device,
device
->
highest_dirty_ps_const
=
max
(
device
->
highest_dirty_ps_const
,
start
+
count
);
}
static
DWORD
*
local_const_mapping
(
IWineD3DBaseShaderImpl
*
shader
)
static
DWORD
*
local_const_mapping
(
const
struct
wined3d_shader
*
shader
)
{
DWORD
*
ret
;
DWORD
idx
=
0
;
...
...
@@ -706,7 +706,7 @@ static DWORD *local_const_mapping(IWineD3DBaseShaderImpl *shader)
}
/* Generate the variable & register declarations for the ARB_vertex_program output target */
static
DWORD
shader_generate_arb_declarations
(
IWineD3DBaseShaderImpl
*
shader
,
static
DWORD
shader_generate_arb_declarations
(
struct
wined3d_shader
*
shader
,
const
struct
wined3d_shader_reg_maps
*
reg_maps
,
struct
wined3d_shader_buffer
*
buffer
,
const
struct
wined3d_gl_info
*
gl_info
,
DWORD
*
lconst_map
,
DWORD
*
num_clipplanes
,
struct
shader_arb_ctx_priv
*
ctx
)
...
...
@@ -3413,7 +3413,7 @@ static void arbfp_add_sRGB_correction(struct wined3d_shader_buffer *buffer, cons
/* [0.0;1.0] clamping. Not needed, this is done implicitly */
}
static
const
DWORD
*
find_loop_control_values
(
IWineD3DBaseShaderImpl
*
shader
,
DWORD
idx
)
static
const
DWORD
*
find_loop_control_values
(
const
struct
wined3d_shader
*
shader
,
DWORD
idx
)
{
const
local_constant
*
constant
;
...
...
@@ -3427,7 +3427,7 @@ static const DWORD *find_loop_control_values(IWineD3DBaseShaderImpl *shader, DWO
return
NULL
;
}
static
void
init_ps_input
(
const
IWineD3DBaseShaderImpl
*
shader
,
static
void
init_ps_input
(
const
struct
wined3d_shader
*
shader
,
const
struct
arb_ps_compile_args
*
args
,
struct
shader_arb_ctx_priv
*
priv
)
{
static
const
char
*
const
texcoords
[
8
]
=
...
...
@@ -3502,7 +3502,7 @@ static void init_ps_input(const IWineD3DBaseShaderImpl *shader,
}
/* GL locking is done by the caller */
static
GLuint
shader_arb_generate_pshader
(
IWineD3DBaseShaderImpl
*
shader
,
static
GLuint
shader_arb_generate_pshader
(
struct
wined3d_shader
*
shader
,
const
struct
wined3d_gl_info
*
gl_info
,
struct
wined3d_shader_buffer
*
buffer
,
const
struct
arb_ps_compile_args
*
args
,
struct
arb_ps_compiled_shader
*
compiled
)
{
...
...
@@ -3912,7 +3912,7 @@ static DWORD find_input_signature(struct shader_arb_priv *priv, const struct win
return
found_sig
->
idx
;
}
static
void
init_output_registers
(
IWineD3DBaseShaderImpl
*
shader
,
DWORD
sig_num
,
static
void
init_output_registers
(
struct
wined3d_shader
*
shader
,
DWORD
sig_num
,
struct
shader_arb_ctx_priv
*
priv_ctx
,
struct
arb_vs_compiled_shader
*
compiled
)
{
unsigned
int
i
,
j
;
...
...
@@ -4088,7 +4088,7 @@ static void init_output_registers(IWineD3DBaseShaderImpl *shader, DWORD sig_num,
}
/* GL locking is done by the caller */
static
GLuint
shader_arb_generate_vshader
(
IWineD3DBaseShaderImpl
*
shader
,
static
GLuint
shader_arb_generate_vshader
(
struct
wined3d_shader
*
shader
,
const
struct
wined3d_gl_info
*
gl_info
,
struct
wined3d_shader_buffer
*
buffer
,
const
struct
arb_vs_compile_args
*
args
,
struct
arb_vs_compiled_shader
*
compiled
)
{
...
...
@@ -4253,7 +4253,7 @@ static GLuint shader_arb_generate_vshader(IWineD3DBaseShaderImpl *shader,
}
/* GL locking is done by the caller */
static
struct
arb_ps_compiled_shader
*
find_arb_pshader
(
IWineD3DBaseShaderImpl
*
shader
,
static
struct
arb_ps_compiled_shader
*
find_arb_pshader
(
struct
wined3d_shader
*
shader
,
const
struct
arb_ps_compile_args
*
args
)
{
IWineD3DDeviceImpl
*
device
=
shader
->
device
;
...
...
@@ -4350,7 +4350,7 @@ static inline BOOL vs_args_equal(const struct arb_vs_compile_args *stored, const
return
!
memcmp
(
stored
->
loop_ctrl
,
new
->
loop_ctrl
,
sizeof
(
stored
->
loop_ctrl
));
}
static
struct
arb_vs_compiled_shader
*
find_arb_vshader
(
IWineD3DBaseShaderImpl
*
shader
,
static
struct
arb_vs_compiled_shader
*
find_arb_vshader
(
struct
wined3d_shader
*
shader
,
const
struct
arb_vs_compile_args
*
args
)
{
IWineD3DDeviceImpl
*
device
=
shader
->
device
;
...
...
@@ -4437,7 +4437,7 @@ static struct arb_vs_compiled_shader *find_arb_vshader(IWineD3DBaseShaderImpl *s
}
static
void
find_arb_ps_compile_args
(
const
struct
wined3d_state
*
state
,
IWineD3DBaseShaderImpl
*
shader
,
struct
arb_ps_compile_args
*
args
)
const
struct
wined3d_shader
*
shader
,
struct
arb_ps_compile_args
*
args
)
{
IWineD3DDeviceImpl
*
device
=
shader
->
device
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
...
...
@@ -4492,7 +4492,7 @@ static void find_arb_ps_compile_args(const struct wined3d_state *state,
}
static
void
find_arb_vs_compile_args
(
const
struct
wined3d_state
*
state
,
IWineD3DBaseShaderImpl
*
shader
,
struct
arb_vs_compile_args
*
args
)
const
struct
wined3d_shader
*
shader
,
struct
arb_vs_compile_args
*
args
)
{
IWineD3DDeviceImpl
*
device
=
shader
->
device
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
...
...
@@ -4504,8 +4504,8 @@ static void find_arb_vs_compile_args(const struct wined3d_state *state,
args
->
clip
.
boolclip_compare
=
0
;
if
(
use_ps
(
state
))
{
IWineD3DBaseShaderImpl
*
ps
=
state
->
pixel_shader
;
struct
arb_pshader_private
*
shader_priv
=
ps
->
backend_data
;
const
struct
wined3d_shader
*
ps
=
state
->
pixel_shader
;
const
struct
arb_pshader_private
*
shader_priv
=
ps
->
backend_data
;
args
->
ps_signature
=
shader_priv
->
input_signature_idx
;
args
->
clip
.
boolclip
.
clip_texcoord
=
shader_priv
->
clipplane_emulation
+
1
;
...
...
@@ -4579,7 +4579,7 @@ static void shader_arb_select(const struct wined3d_context *context, BOOL usePS,
/* Deal with pixel shaders first so the vertex shader arg function has the input signature ready */
if
(
usePS
)
{
IWineD3DBaseShaderImpl
*
ps
=
state
->
pixel_shader
;
struct
wined3d_shader
*
ps
=
state
->
pixel_shader
;
struct
arb_ps_compile_args
compile_args
;
struct
arb_ps_compiled_shader
*
compiled
;
...
...
@@ -4637,7 +4637,7 @@ static void shader_arb_select(const struct wined3d_context *context, BOOL usePS,
if
(
useVS
)
{
IWineD3DBaseShaderImpl
*
vs
=
state
->
vertex_shader
;
struct
wined3d_shader
*
vs
=
state
->
vertex_shader
;
struct
arb_vs_compile_args
compile_args
;
struct
arb_vs_compiled_shader
*
compiled
;
...
...
@@ -4727,7 +4727,7 @@ static void shader_arb_deselect_depth_blt(void *shader_priv, const struct wined3
}
}
static
void
shader_arb_destroy
(
IWineD3DBaseShaderImpl
*
shader
)
static
void
shader_arb_destroy
(
struct
wined3d_shader
*
shader
)
{
IWineD3DDeviceImpl
*
device
=
shader
->
device
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
...
...
@@ -5086,7 +5086,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
};
static
BOOL
get_bool_const
(
const
struct
wined3d_shader_instruction
*
ins
,
IWineD3DBaseShaderImpl
*
shader
,
DWORD
idx
)
const
struct
wined3d_shader
*
shader
,
DWORD
idx
)
{
const
struct
wined3d_shader_reg_maps
*
reg_maps
=
ins
->
ctx
->
reg_maps
;
BOOL
vshader
=
shader_is_vshader_version
(
reg_maps
->
shader_version
.
type
);
...
...
@@ -5117,7 +5117,7 @@ static BOOL get_bool_const(const struct wined3d_shader_instruction *ins,
}
static
void
get_loop_control_const
(
const
struct
wined3d_shader_instruction
*
ins
,
IWineD3DBaseShaderImpl
*
shader
,
UINT
idx
,
struct
wined3d_shader_loop_control
*
loop_control
)
const
struct
wined3d_shader
*
shader
,
UINT
idx
,
struct
wined3d_shader_loop_control
*
loop_control
)
{
const
struct
wined3d_shader_reg_maps
*
reg_maps
=
ins
->
ctx
->
reg_maps
;
struct
shader_arb_ctx_priv
*
priv
=
ins
->
ctx
->
backend_data
;
...
...
@@ -5673,8 +5673,7 @@ static void set_bumpmat_arbfp(DWORD state_id, struct wined3d_stateblock *statebl
if
(
use_ps
(
state
))
{
IWineD3DBaseShaderImpl
*
ps
=
state
->
pixel_shader
;
if
(
stage
&&
(
ps
->
reg_maps
.
bumpmat
&
(
1
<<
stage
)))
if
(
stage
&&
(
state
->
pixel_shader
->
reg_maps
.
bumpmat
&
(
1
<<
stage
)))
{
/* The pixel shader has to know the bump env matrix. Do a constants update if it isn't scheduled
* anyway
...
...
@@ -5712,8 +5711,7 @@ static void tex_bumpenvlum_arbfp(DWORD state_id,
if
(
use_ps
(
state
))
{
IWineD3DBaseShaderImpl
*
ps
=
state
->
pixel_shader
;
if
(
stage
&&
(
ps
->
reg_maps
.
luminanceparams
&
(
1
<<
stage
)))
if
(
stage
&&
(
state
->
pixel_shader
->
reg_maps
.
luminanceparams
&
(
1
<<
stage
)))
{
/* The pixel shader has to know the luminance offset. Do a constants update if it
* isn't scheduled anyway
...
...
dlls/wined3d/device.c
View file @
8fe80e18
...
...
@@ -1513,10 +1513,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF(IWineD3D
static
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateVertexShader
(
IWineD3DDevice
*
iface
,
const
DWORD
*
pFunction
,
const
struct
wined3d_shader_signature
*
output_signature
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
IWineD3DBaseS
hader
**
shader
)
struct
wined3d_s
hader
**
shader
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DBaseShaderImpl
*
object
;
struct
wined3d_shader
*
object
;
HRESULT
hr
;
if
(
This
->
vs_selected_mode
==
SHADER_NONE
)
...
...
@@ -1538,7 +1538,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice *ifac
}
TRACE
(
"Created vertex shader %p.
\n
"
,
object
);
*
shader
=
(
IWineD3DBaseShader
*
)
object
;
*
shader
=
object
;
return
WINED3D_OK
;
}
...
...
@@ -1546,10 +1546,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice *ifac
static
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateGeometryShader
(
IWineD3DDevice
*
iface
,
const
DWORD
*
byte_code
,
const
struct
wined3d_shader_signature
*
output_signature
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
IWineD3DBaseS
hader
**
shader
)
struct
wined3d_s
hader
**
shader
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DBaseShaderImpl
*
object
;
struct
wined3d_shader
*
object
;
HRESULT
hr
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
...
...
@@ -1568,7 +1568,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateGeometryShader(IWineD3DDevice *if
}
TRACE
(
"Created geometry shader %p.
\n
"
,
object
);
*
shader
=
(
IWineD3DBaseShader
*
)
object
;
*
shader
=
object
;
return
WINED3D_OK
;
}
...
...
@@ -1576,10 +1576,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateGeometryShader(IWineD3DDevice *if
static
HRESULT
WINAPI
IWineD3DDeviceImpl_CreatePixelShader
(
IWineD3DDevice
*
iface
,
const
DWORD
*
pFunction
,
const
struct
wined3d_shader_signature
*
output_signature
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
IWineD3DBaseS
hader
**
shader
)
struct
wined3d_s
hader
**
shader
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DBaseShaderImpl
*
object
;
struct
wined3d_shader
*
object
;
HRESULT
hr
;
if
(
This
->
ps_selected_mode
==
SHADER_NONE
)
...
...
@@ -1601,7 +1601,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface
}
TRACE
(
"Created pixel shader %p.
\n
"
,
object
);
*
shader
=
(
IWineD3DBaseShader
*
)
object
;
*
shader
=
object
;
return
WINED3D_OK
;
}
...
...
@@ -3339,12 +3339,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetVertexDeclaration(IWineD3DDevice *if
return
WINED3D_OK
;
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetVertexShader
(
IWineD3DDevice
*
iface
,
IWineD3DBaseS
hader
*
shader
)
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetVertexShader
(
IWineD3DDevice
*
iface
,
struct
wined3d_s
hader
*
shader
)
{
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DBaseShader
*
prev
=
(
IWineD3DBaseShader
*
)
device
->
updateStateBlock
->
state
.
vertex_shader
;
struct
wined3d_shader
*
prev
=
device
->
updateStateBlock
->
state
.
vertex_shader
;
device
->
updateStateBlock
->
state
.
vertex_shader
=
(
IWineD3DBaseShaderImpl
*
)
shader
;
device
->
updateStateBlock
->
state
.
vertex_shader
=
shader
;
device
->
updateStateBlock
->
changed
.
vertexShader
=
TRUE
;
if
(
device
->
isRecordingState
)
...
...
@@ -3374,14 +3374,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShader(IWineD3DDevice *iface,
return
WINED3D_OK
;
}
static
IWineD3DBaseS
hader
*
WINAPI
IWineD3DDeviceImpl_GetVertexShader
(
IWineD3DDevice
*
iface
)
static
struct
wined3d_s
hader
*
WINAPI
IWineD3DDeviceImpl_GetVertexShader
(
IWineD3DDevice
*
iface
)
{
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DBaseS
hader
*
shader
;
struct
wined3d_s
hader
*
shader
;
TRACE
(
"iface %p.
\n
"
,
iface
);
shader
=
(
IWineD3DBaseShader
*
)
device
->
stateBlock
->
state
.
vertex_shader
;
shader
=
device
->
stateBlock
->
state
.
vertex_shader
;
if
(
shader
)
wined3d_shader_incref
(
shader
);
...
...
@@ -3691,11 +3691,9 @@ static void device_map_vsamplers(IWineD3DDeviceImpl *This, BOOL ps, const struct
if
(
ps
)
{
IWineD3DBaseShaderImpl
*
pshader
=
This
->
stateBlock
->
state
.
pixel_shader
;
/* Note that we only care if a sampler is sampled or not, not the sampler's specific type.
* Otherwise we'd need to call shader_update_samplers() here for 1.x pixelshaders. */
pshader_sampler_type
=
p
shader
->
reg_maps
.
sampler_type
;
pshader_sampler_type
=
This
->
stateBlock
->
state
.
pixel_
shader
->
reg_maps
.
sampler_type
;
}
for
(
i
=
0
;
i
<
MAX_VERTEX_SAMPLERS
;
++
i
)
{
...
...
@@ -3743,12 +3741,12 @@ void IWineD3DDeviceImpl_FindTexUnitMap(IWineD3DDeviceImpl *This)
if
(
vs
)
device_map_vsamplers
(
This
,
ps
,
gl_info
);
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetPixelShader
(
IWineD3DDevice
*
iface
,
IWineD3DBaseS
hader
*
shader
)
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetPixelShader
(
IWineD3DDevice
*
iface
,
struct
wined3d_s
hader
*
shader
)
{
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DBaseShader
*
prev
=
(
IWineD3DBaseShader
*
)
device
->
updateStateBlock
->
state
.
pixel_shader
;
struct
wined3d_shader
*
prev
=
device
->
updateStateBlock
->
state
.
pixel_shader
;
device
->
updateStateBlock
->
state
.
pixel_shader
=
(
IWineD3DBaseShaderImpl
*
)
shader
;
device
->
updateStateBlock
->
state
.
pixel_shader
=
shader
;
device
->
updateStateBlock
->
changed
.
pixelShader
=
TRUE
;
/* Handle recording of state blocks */
...
...
@@ -3782,10 +3780,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShader(IWineD3DDevice *iface, I
return
WINED3D_OK
;
}
static
IWineD3DBaseS
hader
*
WINAPI
IWineD3DDeviceImpl_GetPixelShader
(
IWineD3DDevice
*
iface
)
static
struct
wined3d_s
hader
*
WINAPI
IWineD3DDeviceImpl_GetPixelShader
(
IWineD3DDevice
*
iface
)
{
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DBaseS
hader
*
shader
;
struct
wined3d_s
hader
*
shader
;
TRACE
(
"iface %p.
\n
"
,
iface
);
...
...
@@ -6252,13 +6250,13 @@ static void delete_opengl_contexts(IWineD3DDeviceImpl *device, IWineD3DSwapChain
{
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context
*
context
;
IWineD3DBaseShaderImpl
*
shader
;
struct
wined3d_shader
*
shader
;
context
=
context_acquire
(
device
,
NULL
);
gl_info
=
context
->
gl_info
;
IWineD3DDevice_EnumResources
((
IWineD3DDevice
*
)
device
,
device_unload_resource
,
NULL
);
LIST_FOR_EACH_ENTRY
(
shader
,
&
device
->
shaders
,
IWineD3DBaseShaderImpl
,
shader_list_entry
)
LIST_FOR_EACH_ENTRY
(
shader
,
&
device
->
shaders
,
struct
wined3d_shader
,
shader_list_entry
)
{
device
->
shader_backend
->
shader_destroy
(
shader
);
}
...
...
dlls/wined3d/glsl_shader.c
View file @
8fe80e18
This diff is collapsed.
Click to expand it.
dlls/wined3d/shader.c
View file @
8fe80e18
...
...
@@ -298,7 +298,7 @@ int shader_addline(struct wined3d_shader_buffer *buffer, const char *format, ...
return
ret
;
}
static
void
shader_init
(
IWineD3DBaseShaderImpl
*
shader
,
IWineD3DDeviceImpl
*
device
,
static
void
shader_init
(
struct
wined3d_shader
*
shader
,
IWineD3DDeviceImpl
*
device
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
{
shader
->
ref
=
1
;
...
...
@@ -348,7 +348,7 @@ static inline void set_bitmap_bit(DWORD *bitmap, DWORD bit)
bitmap
[
idx
]
|=
(
1
<<
shift
);
}
static
void
shader_record_register_usage
(
IWineD3DBaseShaderImpl
*
shader
,
struct
wined3d_shader_reg_maps
*
reg_maps
,
static
void
shader_record_register_usage
(
struct
wined3d_shader
*
shader
,
struct
wined3d_shader_reg_maps
*
reg_maps
,
const
struct
wined3d_shader_register
*
reg
,
enum
wined3d_shader_type
shader_type
)
{
switch
(
reg
->
type
)
...
...
@@ -448,7 +448,7 @@ static unsigned int get_instr_extra_regcount(enum WINED3D_SHADER_INSTRUCTION_HAN
}
/* Note that this does not count the loop register as an address register. */
static
HRESULT
shader_get_registers_used
(
IWineD3DBaseShaderImpl
*
shader
,
const
struct
wined3d_shader_frontend
*
fe
,
static
HRESULT
shader_get_registers_used
(
struct
wined3d_shader
*
shader
,
const
struct
wined3d_shader_frontend
*
fe
,
struct
wined3d_shader_reg_maps
*
reg_maps
,
struct
wined3d_shader_signature_element
*
input_signature
,
struct
wined3d_shader_signature_element
*
output_signature
,
const
DWORD
*
byte_code
,
DWORD
constf_size
)
{
...
...
@@ -1159,7 +1159,7 @@ void shader_dump_src_param(const struct wined3d_shader_src_param *param,
/* Shared code in order to generate the bulk of the shader string.
* NOTE: A description of how to parse tokens can be found on MSDN. */
void
shader_generate_main
(
IWineD3DBaseShaderImpl
*
shader
,
struct
wined3d_shader_buffer
*
buffer
,
void
shader_generate_main
(
struct
wined3d_shader
*
shader
,
struct
wined3d_shader_buffer
*
buffer
,
const
struct
wined3d_shader_reg_maps
*
reg_maps
,
const
DWORD
*
byte_code
,
void
*
backend_ctx
)
{
IWineD3DDeviceImpl
*
device
=
shader
->
device
;
...
...
@@ -1470,7 +1470,7 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
}
}
static
void
shader_cleanup
(
IWineD3DBaseShaderImpl
*
shader
)
static
void
shader_cleanup
(
struct
wined3d_shader
*
shader
)
{
shader
->
device
->
shader_backend
->
shader_destroy
(
shader
);
HeapFree
(
GetProcessHeap
(),
0
,
shader
->
reg_maps
.
constf
);
...
...
@@ -1494,7 +1494,7 @@ static void shader_none_update_float_pixel_constants(IWineD3DDeviceImpl *device,
static
void
shader_none_load_constants
(
const
struct
wined3d_context
*
context
,
char
usePS
,
char
useVS
)
{}
static
void
shader_none_load_np2fixup_constants
(
void
*
shader_priv
,
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
wined3d_state
*
state
)
{}
static
void
shader_none_destroy
(
IWineD3DBaseShaderImpl
*
shader
)
{}
static
void
shader_none_destroy
(
struct
wined3d_shader
*
shader
)
{}
static
HRESULT
shader_none_alloc
(
IWineD3DDeviceImpl
*
device
)
{
return
WINED3D_OK
;}
static
void
shader_none_free
(
IWineD3DDeviceImpl
*
device
)
{}
static
BOOL
shader_none_dirty_const
(
void
)
{
return
FALSE
;}
...
...
@@ -1546,7 +1546,7 @@ const shader_backend_t none_shader_backend = {
shader_none_color_fixup_supported
,
};
static
HRESULT
shader_set_function
(
IWineD3DBaseShaderImpl
*
shader
,
const
DWORD
*
byte_code
,
static
HRESULT
shader_set_function
(
struct
wined3d_shader
*
shader
,
const
DWORD
*
byte_code
,
const
struct
wined3d_shader_signature
*
output_signature
,
DWORD
float_const_count
)
{
struct
wined3d_shader_reg_maps
*
reg_maps
=
&
shader
->
reg_maps
;
...
...
@@ -1681,7 +1681,7 @@ HRESULT CDECL wined3d_shader_set_local_constants_float(struct wined3d_shader *sh
}
void
find_vs_compile_args
(
const
struct
wined3d_state
*
state
,
IWineD3DBaseShaderImpl
*
shader
,
struct
vs_compile_args
*
args
)
const
struct
wined3d_shader
*
shader
,
struct
vs_compile_args
*
args
)
{
args
->
fog_src
=
state
->
render_states
[
WINED3DRS_FOGTABLEMODE
]
==
WINED3DFOG_NONE
?
VS_FOG_COORD
:
VS_FOG_Z
;
...
...
@@ -1720,7 +1720,7 @@ BOOL vshader_get_input(struct wined3d_shader *shader,
return
FALSE
;
}
static
void
vertexshader_set_limits
(
IWineD3DBaseShaderImpl
*
shader
)
static
void
vertexshader_set_limits
(
struct
wined3d_shader
*
shader
)
{
DWORD
shader_version
=
WINED3D_SHADER_VERSION
(
shader
->
reg_maps
.
shader_version
.
major
,
shader
->
reg_maps
.
shader_version
.
minor
);
...
...
@@ -1794,7 +1794,7 @@ static void vertexshader_set_limits(IWineD3DBaseShaderImpl *shader)
}
}
HRESULT
vertexshader_init
(
IWineD3DBaseShaderImpl
*
shader
,
IWineD3DDeviceImpl
*
device
,
HRESULT
vertexshader_init
(
struct
wined3d_shader
*
shader
,
IWineD3DDeviceImpl
*
device
,
const
DWORD
*
byte_code
,
const
struct
wined3d_shader_signature
*
output_signature
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
{
...
...
@@ -1843,7 +1843,7 @@ HRESULT vertexshader_init(IWineD3DBaseShaderImpl *shader, IWineD3DDeviceImpl *de
return
WINED3D_OK
;
}
HRESULT
geometryshader_init
(
IWineD3DBaseShaderImpl
*
shader
,
IWineD3DDeviceImpl
*
device
,
HRESULT
geometryshader_init
(
struct
wined3d_shader
*
shader
,
IWineD3DDeviceImpl
*
device
,
const
DWORD
*
byte_code
,
const
struct
wined3d_shader_signature
*
output_signature
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
{
...
...
@@ -1864,7 +1864,7 @@ HRESULT geometryshader_init(IWineD3DBaseShaderImpl *shader, IWineD3DDeviceImpl *
}
void
find_ps_compile_args
(
const
struct
wined3d_state
*
state
,
IWineD3DBaseShaderImpl
*
shader
,
struct
ps_compile_args
*
args
)
const
struct
wined3d_shader
*
shader
,
struct
ps_compile_args
*
args
)
{
IWineD3DDeviceImpl
*
device
=
shader
->
device
;
const
struct
wined3d_texture
*
texture
;
...
...
@@ -1961,7 +1961,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
}
}
static
void
pixelshader_set_limits
(
IWineD3DBaseShaderImpl
*
shader
)
static
void
pixelshader_set_limits
(
struct
wined3d_shader
*
shader
)
{
DWORD
shader_version
=
WINED3D_SHADER_VERSION
(
shader
->
reg_maps
.
shader_version
.
major
,
shader
->
reg_maps
.
shader_version
.
minor
);
...
...
@@ -2049,7 +2049,7 @@ static void pixelshader_set_limits(IWineD3DBaseShaderImpl *shader)
}
}
HRESULT
pixelshader_init
(
IWineD3DBaseShaderImpl
*
shader
,
IWineD3DDeviceImpl
*
device
,
HRESULT
pixelshader_init
(
struct
wined3d_shader
*
shader
,
IWineD3DDeviceImpl
*
device
,
const
DWORD
*
byte_code
,
const
struct
wined3d_shader_signature
*
output_signature
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
{
...
...
dlls/wined3d/state.c
View file @
8fe80e18
...
...
@@ -3569,7 +3569,7 @@ static void shaderconstant(DWORD state_id, struct wined3d_stateblock *stateblock
static
void
tex_bumpenvlscale
(
DWORD
state
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
{
DWORD
stage
=
(
state
-
STATE_TEXTURESTAGE
(
0
,
0
))
/
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
);
IWineD3DBaseShaderImpl
*
ps
=
stateblock
->
state
.
pixel_shader
;
const
struct
wined3d_shader
*
ps
=
stateblock
->
state
.
pixel_shader
;
if
(
ps
&&
stage
&&
(
ps
->
reg_maps
.
luminanceparams
&
(
1
<<
stage
)))
{
...
...
@@ -3740,7 +3740,7 @@ void apply_pixelshader(DWORD state_id, struct wined3d_stateblock *stateblock, st
static
void
shader_bumpenvmat
(
DWORD
state
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
{
DWORD
stage
=
(
state
-
STATE_TEXTURESTAGE
(
0
,
0
))
/
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
);
IWineD3DBaseShaderImpl
*
ps
=
stateblock
->
state
.
pixel_shader
;
const
struct
wined3d_shader
*
ps
=
stateblock
->
state
.
pixel_shader
;
if
(
ps
&&
stage
&&
(
ps
->
reg_maps
.
bumpmat
&
(
1
<<
stage
)))
{
...
...
dlls/wined3d/stateblock.c
View file @
8fe80e18
...
...
@@ -901,7 +901,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
TRACE
(
"Blocktype: %#x.
\n
"
,
stateblock
->
blockType
);
if
(
stateblock
->
changed
.
vertexShader
)
IWineD3DDevice_SetVertexShader
(
device
,
(
IWineD3DBaseShader
*
)
stateblock
->
state
.
vertex_shader
);
IWineD3DDevice_SetVertexShader
(
device
,
stateblock
->
state
.
vertex_shader
);
/* Vertex Shader Constants. */
for
(
i
=
0
;
i
<
stateblock
->
num_contained_vs_consts_f
;
++
i
)
...
...
@@ -923,7 +923,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
apply_lights
(
device
,
&
stateblock
->
state
);
if
(
stateblock
->
changed
.
pixelShader
)
IWineD3DDevice_SetPixelShader
(
device
,
(
IWineD3DBaseShader
*
)
stateblock
->
state
.
pixel_shader
);
IWineD3DDevice_SetPixelShader
(
device
,
stateblock
->
state
.
pixel_shader
);
/* Pixel Shader Constants. */
for
(
i
=
0
;
i
<
stateblock
->
num_contained_ps_consts_f
;
++
i
)
...
...
dlls/wined3d/wined3d_private.h
View file @
8fe80e18
...
...
@@ -55,8 +55,6 @@
typedef
struct
IWineD3DSurfaceImpl
IWineD3DSurfaceImpl
;
typedef
struct
IWineD3DDeviceImpl
IWineD3DDeviceImpl
;
typedef
struct
IWineD3DSwapChainImpl
IWineD3DSwapChainImpl
;
typedef
struct
wined3d_shader
IWineD3DBaseShaderImpl
;
typedef
struct
wined3d_shader
IWineD3DBaseShader
;
/* Texture format fixups */
...
...
@@ -2741,21 +2739,21 @@ struct wined3d_shader
}
u
;
};
HRESULT
geometryshader_init
(
IWineD3DBaseShaderImpl
*
shader
,
IWineD3DDeviceImpl
*
device
,
HRESULT
geometryshader_init
(
struct
wined3d_shader
*
shader
,
IWineD3DDeviceImpl
*
device
,
const
DWORD
*
byte_code
,
const
struct
wined3d_shader_signature
*
output_signature
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
DECLSPEC_HIDDEN
;
HRESULT
pixelshader_init
(
IWineD3DBaseShaderImpl
*
shader
,
IWineD3DDeviceImpl
*
device
,
HRESULT
pixelshader_init
(
struct
wined3d_shader
*
shader
,
IWineD3DDeviceImpl
*
device
,
const
DWORD
*
byte_code
,
const
struct
wined3d_shader_signature
*
output_signature
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
DECLSPEC_HIDDEN
;
void
pixelshader_update_samplers
(
struct
wined3d_shader_reg_maps
*
reg_maps
,
struct
wined3d_texture
*
const
*
textures
)
DECLSPEC_HIDDEN
;
void
find_ps_compile_args
(
const
struct
wined3d_state
*
state
,
IWineD3DBaseShaderImpl
*
shader
,
struct
ps_compile_args
*
args
)
DECLSPEC_HIDDEN
;
const
struct
wined3d_shader
*
shader
,
struct
ps_compile_args
*
args
)
DECLSPEC_HIDDEN
;
void
find_vs_compile_args
(
const
struct
wined3d_state
*
state
,
IWineD3DBaseShaderImpl
*
shader
,
struct
vs_compile_args
*
args
)
DECLSPEC_HIDDEN
;
HRESULT
vertexshader_init
(
IWineD3DBaseShaderImpl
*
shader
,
IWineD3DDeviceImpl
*
device
,
const
struct
wined3d_shader
*
shader
,
struct
vs_compile_args
*
args
)
DECLSPEC_HIDDEN
;
HRESULT
vertexshader_init
(
struct
wined3d_shader
*
shader
,
IWineD3DDeviceImpl
*
device
,
const
DWORD
*
byte_code
,
const
struct
wined3d_shader_signature
*
output_signature
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
DECLSPEC_HIDDEN
;
...
...
@@ -2768,7 +2766,7 @@ void shader_dump_dst_param(const struct wined3d_shader_dst_param *param,
const
struct
wined3d_shader_version
*
shader_version
)
DECLSPEC_HIDDEN
;
unsigned
int
shader_find_free_input_register
(
const
struct
wined3d_shader_reg_maps
*
reg_maps
,
unsigned
int
max
)
DECLSPEC_HIDDEN
;
void
shader_generate_main
(
IWineD3DBaseShaderImpl
*
shader
,
struct
wined3d_shader_buffer
*
buffer
,
void
shader_generate_main
(
struct
wined3d_shader
*
shader
,
struct
wined3d_shader_buffer
*
buffer
,
const
struct
wined3d_shader_reg_maps
*
reg_maps
,
const
DWORD
*
pFunction
,
void
*
backend_ctx
)
DECLSPEC_HIDDEN
;
BOOL
shader_match_semantic
(
const
char
*
semantic_name
,
WINED3DDECLUSAGE
usage
)
DECLSPEC_HIDDEN
;
...
...
@@ -2832,7 +2830,7 @@ static inline void shader_get_position_fixup(const struct wined3d_context *conte
}
}
static
inline
BOOL
shader_constant_is_local
(
IWineD3DBaseShaderImpl
*
shader
,
DWORD
reg
)
static
inline
BOOL
shader_constant_is_local
(
const
struct
wined3d_shader
*
shader
,
DWORD
reg
)
{
struct
local_constant
*
lconst
;
...
...
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