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
cf12f51b
Commit
cf12f51b
authored
Feb 25, 2013
by
Ričardas Barkauskas
Committed by
Alexandre Julliard
Feb 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Make shader buffer dynamic.
parent
b5ff0a69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
shader.c
dlls/wined3d/shader.c
+21
-7
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-1
No files found.
dlls/wined3d/shader.c
View file @
cf12f51b
...
@@ -251,6 +251,7 @@ BOOL shader_buffer_init(struct wined3d_shader_buffer *buffer)
...
@@ -251,6 +251,7 @@ BOOL shader_buffer_init(struct wined3d_shader_buffer *buffer)
ERR
(
"Failed to allocate shader buffer memory.
\n
"
);
ERR
(
"Failed to allocate shader buffer memory.
\n
"
);
return
FALSE
;
return
FALSE
;
}
}
buffer
->
buffer_size
=
SHADER_PGMSIZE
;
shader_buffer_clear
(
buffer
);
shader_buffer_clear
(
buffer
);
return
TRUE
;
return
TRUE
;
...
@@ -265,15 +266,28 @@ int shader_vaddline(struct wined3d_shader_buffer *buffer, const char *format, va
...
@@ -265,15 +266,28 @@ int shader_vaddline(struct wined3d_shader_buffer *buffer, const char *format, va
{
{
char
*
base
=
buffer
->
buffer
+
buffer
->
content_size
;
char
*
base
=
buffer
->
buffer
+
buffer
->
content_size
;
int
rc
;
int
rc
;
char
*
new_buffer
;
rc
=
vsnprintf
(
base
,
SHADER_PGMSIZE
-
1
-
buffer
->
content_size
,
format
,
args
);
while
(
1
)
if
(
rc
<
0
/* C89 */
||
(
unsigned
int
)
rc
>
SHADER_PGMSIZE
-
1
-
buffer
->
content_size
/* C99 */
)
{
{
ERR
(
"The buffer allocated for the shader program string "
rc
=
vsnprintf
(
base
,
buffer
->
buffer_size
-
buffer
->
content_size
,
format
,
args
);
"is too small at %d bytes.
\n
"
,
SHADER_PGMSIZE
);
if
(
rc
<
0
/* C89 */
||
(
unsigned
int
)
rc
>=
buffer
->
buffer_size
-
buffer
->
content_size
/* C99 */
)
buffer
->
content_size
=
SHADER_PGMSIZE
-
1
;
{
return
-
1
;
new_buffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
buffer
->
buffer
,
buffer
->
buffer_size
*
2
);
if
(
!
new_buffer
)
{
ERR
(
"The buffer allocated for the shader program string is too small at %d bytes.
\n
"
,
buffer
->
buffer_size
);
buffer
->
content_size
=
buffer
->
buffer_size
-
1
;
return
-
1
;
}
buffer
->
buffer
=
new_buffer
;
buffer
->
buffer_size
=
buffer
->
buffer_size
*
2
;
base
=
buffer
->
buffer
+
buffer
->
content_size
;
}
else
{
break
;
}
}
}
if
(
buffer
->
newline
)
if
(
buffer
->
newline
)
...
...
dlls/wined3d/wined3d_private.h
View file @
cf12f51b
...
@@ -402,11 +402,12 @@ enum wined3d_shader_rel_op
...
@@ -402,11 +402,12 @@ enum wined3d_shader_rel_op
* Shader model 3 according to msdn (and for software shaders) */
* Shader model 3 according to msdn (and for software shaders) */
#define MAX_LABELS 16
#define MAX_LABELS 16
#define SHADER_PGMSIZE
65535
#define SHADER_PGMSIZE
16384
struct
wined3d_shader_buffer
struct
wined3d_shader_buffer
{
{
char
*
buffer
;
char
*
buffer
;
unsigned
int
buffer_size
;
unsigned
int
content_size
;
unsigned
int
content_size
;
unsigned
int
lineNo
;
unsigned
int
lineNo
;
BOOL
newline
;
BOOL
newline
;
...
...
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