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
483d552e
Commit
483d552e
authored
Jul 09, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Allow shader_buffer_init() to fail.
parent
40b41195
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
7 deletions
+36
-7
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+22
-4
baseshader.c
dlls/wined3d/baseshader.c
+8
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+5
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
483d552e
...
...
@@ -4006,7 +4006,12 @@ static struct arb_ps_compiled_shader *find_arb_pshader(IWineD3DPixelShaderImpl *
pixelshader_update_samplers
(
&
shader
->
baseShader
.
reg_maps
,
((
IWineD3DDeviceImpl
*
)
shader
->
baseShader
.
device
)
->
stateBlock
->
textures
);
shader_buffer_init
(
&
buffer
);
if
(
!
shader_buffer_init
(
&
buffer
))
{
ERR
(
"Failed to initialize shader buffer.
\n
"
);
return
0
;
}
ret
=
shader_arb_generate_pshader
(
shader
,
&
buffer
,
args
,
&
shader_data
->
gl_shaders
[
shader_data
->
num_gl_shaders
]);
shader_buffer_free
(
&
buffer
);
...
...
@@ -4076,7 +4081,12 @@ static struct arb_vs_compiled_shader *find_arb_vshader(IWineD3DVertexShaderImpl
shader_data
->
gl_shaders
[
shader_data
->
num_gl_shaders
].
args
=
*
args
;
shader_buffer_init
(
&
buffer
);
if
(
!
shader_buffer_init
(
&
buffer
))
{
ERR
(
"Failed to initialize shader buffer.
\n
"
);
return
0
;
}
ret
=
shader_arb_generate_vshader
(
shader
,
&
buffer
,
args
,
&
shader_data
->
gl_shaders
[
shader_data
->
num_gl_shaders
]);
shader_buffer_free
(
&
buffer
);
...
...
@@ -5541,7 +5551,11 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi
}
/* Shader header */
shader_buffer_init
(
&
buffer
);
if
(
!
shader_buffer_init
(
&
buffer
))
{
ERR
(
"Failed to initialize shader buffer.
\n
"
);
return
0
;
}
shader_addline
(
&
buffer
,
"!!ARBfp1.0
\n
"
);
...
...
@@ -6304,7 +6318,11 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu
struct
arbfp_blit_priv
*
priv
=
device
->
blit_priv
;
/* Shader header */
shader_buffer_init
(
&
buffer
);
if
(
!
shader_buffer_init
(
&
buffer
))
{
ERR
(
"Failed to initialize shader buffer.
\n
"
);
return
0
;
}
ENTER_GL
();
GL_EXTCALL
(
glGenProgramsARB
(
1
,
&
shader
));
...
...
dlls/wined3d/baseshader.c
View file @
483d552e
...
...
@@ -146,10 +146,17 @@ void shader_buffer_clear(struct wined3d_shader_buffer *buffer)
buffer
->
newline
=
TRUE
;
}
void
shader_buffer_init
(
struct
wined3d_shader_buffer
*
buffer
)
BOOL
shader_buffer_init
(
struct
wined3d_shader_buffer
*
buffer
)
{
buffer
->
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
SHADER_PGMSIZE
);
if
(
!
buffer
->
buffer
)
{
ERR
(
"Failed to allocate shader buffer memory.
\n
"
);
return
FALSE
;
}
shader_buffer_clear
(
buffer
);
return
TRUE
;
}
void
shader_buffer_free
(
struct
wined3d_shader_buffer
*
buffer
)
...
...
dlls/wined3d/glsl_shader.c
View file @
483d552e
...
...
@@ -4456,7 +4456,11 @@ static HRESULT shader_glsl_alloc(IWineD3DDevice *iface) {
struct
shader_glsl_priv
*
priv
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
shader_glsl_priv
));
SIZE_T
stack_size
=
wined3d_log2i
(
max
(
GL_LIMITS
(
vshader_constantsF
),
GL_LIMITS
(
pshader_constantsF
)))
+
1
;
shader_buffer_init
(
&
priv
->
shader_buffer
);
if
(
!
shader_buffer_init
(
&
priv
->
shader_buffer
))
{
ERR
(
"Failed to initialize shader buffer.
\n
"
);
goto
fail
;
}
priv
->
stack
=
HeapAlloc
(
GetProcessHeap
(),
0
,
stack_size
*
sizeof
(
*
priv
->
stack
));
if
(
!
priv
->
stack
)
...
...
dlls/wined3d/wined3d_private.h
View file @
483d552e
...
...
@@ -2601,7 +2601,7 @@ typedef struct IWineD3DBaseShaderImpl {
}
IWineD3DBaseShaderImpl
;
void
shader_buffer_clear
(
struct
wined3d_shader_buffer
*
buffer
);
void
shader_buffer_init
(
struct
wined3d_shader_buffer
*
buffer
);
BOOL
shader_buffer_init
(
struct
wined3d_shader_buffer
*
buffer
);
void
shader_buffer_free
(
struct
wined3d_shader_buffer
*
buffer
);
void
shader_cleanup
(
IWineD3DBaseShader
*
iface
);
void
shader_dump_src_param
(
const
struct
wined3d_shader_src_param
*
param
,
...
...
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