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
84ca0203
Commit
84ca0203
authored
Apr 24, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
Apr 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a scratch string buffers framework.
parent
54b4df67
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
0 deletions
+77
-0
glsl_shader.c
dlls/wined3d/glsl_shader.c
+0
-0
shader.c
dlls/wined3d/shader.c
+65
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+12
-0
No files found.
dlls/wined3d/glsl_shader.c
View file @
84ca0203
This diff is collapsed.
Click to expand it.
dlls/wined3d/shader.c
View file @
84ca0203
...
...
@@ -313,6 +313,71 @@ int shader_addline(struct wined3d_string_buffer *buffer, const char *format, ...
return
ret
;
}
struct
wined3d_string_buffer
*
string_buffer_get
(
struct
wined3d_string_buffer_list
*
list
)
{
struct
wined3d_string_buffer
*
buffer
;
if
(
list_empty
(
&
list
->
list
))
{
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
buffer
));
if
(
!
buffer
||
!
string_buffer_init
(
buffer
))
{
ERR
(
"Couldn't allocate buffer for temporary string.
\n
"
);
if
(
buffer
)
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
return
NULL
;
}
}
else
{
buffer
=
LIST_ENTRY
(
list_head
(
&
list
->
list
),
struct
wined3d_string_buffer
,
entry
);
list_remove
(
&
buffer
->
entry
);
}
string_buffer_clear
(
buffer
);
return
buffer
;
}
static
void
string_buffer_vsprintf
(
struct
wined3d_string_buffer
*
buffer
,
const
char
*
format
,
va_list
args
)
{
if
(
!
buffer
)
return
;
string_buffer_clear
(
buffer
);
shader_vaddline
(
buffer
,
format
,
args
);
}
void
string_buffer_sprintf
(
struct
wined3d_string_buffer
*
buffer
,
const
char
*
format
,
...)
{
va_list
args
;
va_start
(
args
,
format
);
string_buffer_vsprintf
(
buffer
,
format
,
args
);
va_end
(
args
);
}
void
string_buffer_release
(
struct
wined3d_string_buffer_list
*
list
,
struct
wined3d_string_buffer
*
buffer
)
{
if
(
!
buffer
)
return
;
list_add_head
(
&
list
->
list
,
&
buffer
->
entry
);
}
void
string_buffer_list_init
(
struct
wined3d_string_buffer_list
*
list
)
{
list_init
(
&
list
->
list
);
}
void
string_buffer_list_cleanup
(
struct
wined3d_string_buffer_list
*
list
)
{
struct
wined3d_string_buffer
*
buffer
,
*
buffer_next
;
LIST_FOR_EACH_ENTRY_SAFE
(
buffer
,
buffer_next
,
&
list
->
list
,
struct
wined3d_string_buffer
,
entry
)
{
string_buffer_free
(
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
list_init
(
&
list
->
list
);
}
/* Convert floating point offset relative to a register file to an absolute
* offset for float constants. */
static
unsigned
int
shader_get_float_offset
(
enum
wined3d_shader_register_type
register_type
,
UINT
register_idx
)
...
...
dlls/wined3d/wined3d_private.h
View file @
84ca0203
...
...
@@ -437,6 +437,7 @@ enum wined3d_shader_rel_op
struct
wined3d_string_buffer
{
struct
list
entry
;
char
*
buffer
;
unsigned
int
buffer_size
;
unsigned
int
content_size
;
...
...
@@ -2894,6 +2895,17 @@ struct wined3d_shader_limits
#define PRINTF_ATTR(fmt,args)
#endif
struct
wined3d_string_buffer_list
{
struct
list
list
;
};
struct
wined3d_string_buffer
*
string_buffer_get
(
struct
wined3d_string_buffer_list
*
list
)
DECLSPEC_HIDDEN
;
void
string_buffer_sprintf
(
struct
wined3d_string_buffer
*
buffer
,
const
char
*
format
,
...)
PRINTF_ATTR
(
2
,
3
)
DECLSPEC_HIDDEN
;
void
string_buffer_release
(
struct
wined3d_string_buffer_list
*
list
,
struct
wined3d_string_buffer
*
buffer
)
DECLSPEC_HIDDEN
;
void
string_buffer_list_init
(
struct
wined3d_string_buffer_list
*
list
)
DECLSPEC_HIDDEN
;
void
string_buffer_list_cleanup
(
struct
wined3d_string_buffer_list
*
list
)
DECLSPEC_HIDDEN
;
int
shader_addline
(
struct
wined3d_string_buffer
*
buffer
,
const
char
*
fmt
,
...)
PRINTF_ATTR
(
2
,
3
)
DECLSPEC_HIDDEN
;
int
shader_vaddline
(
struct
wined3d_string_buffer
*
buffer
,
const
char
*
fmt
,
va_list
args
)
DECLSPEC_HIDDEN
;
...
...
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