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
491d0e9d
Commit
491d0e9d
authored
May 08, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
May 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Rename asm_alloc/realloc/free functions to more generic names.
parent
e2866d6f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
67 deletions
+77
-67
asmparser.c
dlls/d3dcompiler_43/asmparser.c
+13
-13
asmshader.y
dlls/d3dcompiler_43/asmshader.y
+13
-7
bytecodewriter.c
dlls/d3dcompiler_43/bytecodewriter.c
+42
-42
d3dcompiler_private.h
dlls/d3dcompiler_43/d3dcompiler_private.h
+7
-3
utils.c
dlls/d3dcompiler_43/utils.c
+2
-2
No files found.
dlls/d3dcompiler_43/asmparser.c
View file @
491d0e9d
...
...
@@ -1350,7 +1350,7 @@ static void gen_oldps_input(struct bwriter_shader *shader, DWORD texcoords) {
void
create_vs10_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"vs_1_0
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1366,7 +1366,7 @@ void create_vs10_parser(struct asm_parser *ret) {
void
create_vs11_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"vs_1_1
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1382,7 +1382,7 @@ void create_vs11_parser(struct asm_parser *ret) {
void
create_vs20_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"vs_2_0
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1398,7 +1398,7 @@ void create_vs20_parser(struct asm_parser *ret) {
void
create_vs2x_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"vs_2_x
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1414,7 +1414,7 @@ void create_vs2x_parser(struct asm_parser *ret) {
void
create_vs30_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"vs_3_0
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1429,7 +1429,7 @@ void create_vs30_parser(struct asm_parser *ret) {
void
create_ps10_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"ps_1_0
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1445,7 +1445,7 @@ void create_ps10_parser(struct asm_parser *ret) {
void
create_ps11_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"ps_1_1
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1461,7 +1461,7 @@ void create_ps11_parser(struct asm_parser *ret) {
void
create_ps12_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"ps_1_2
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1477,7 +1477,7 @@ void create_ps12_parser(struct asm_parser *ret) {
void
create_ps13_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"ps_1_3
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1493,7 +1493,7 @@ void create_ps13_parser(struct asm_parser *ret) {
void
create_ps14_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"ps_1_4
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1509,7 +1509,7 @@ void create_ps14_parser(struct asm_parser *ret) {
void
create_ps20_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"ps_2_0
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1525,7 +1525,7 @@ void create_ps20_parser(struct asm_parser *ret) {
void
create_ps2x_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"ps_2_x
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
@@ -1541,7 +1541,7 @@ void create_ps2x_parser(struct asm_parser *ret) {
void
create_ps30_parser
(
struct
asm_parser
*
ret
)
{
TRACE_
(
parsed_shader
)(
"ps_3_0
\n
"
);
ret
->
shader
=
asm
_alloc
(
sizeof
(
*
ret
->
shader
));
ret
->
shader
=
d3dcompiler
_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
...
...
dlls/d3dcompiler_43/asmshader.y
View file @
491d0e9d
...
...
@@ -51,7 +51,7 @@ static void set_rel_reg(struct shader_reg *reg, struct rel_reg *rel) {
if(!rel->has_rel_reg) {
reg->rel_reg = NULL;
} else {
reg->rel_reg =
asm
_alloc(sizeof(*reg->rel_reg));
reg->rel_reg =
d3dcompiler
_alloc(sizeof(*reg->rel_reg));
if(!reg->rel_reg) {
return;
}
...
...
@@ -1693,16 +1693,22 @@ struct bwriter_shader *parse_asm_shader(char **messages)
if (asm_ctx.messages.size)
{
/* Shrink the buffer to the used size */
*messages = asm_realloc(asm_ctx.messages.string, asm_ctx.messages.size + 1);
if(!*messages) {
*messages = d3dcompiler_realloc(asm_ctx.messages.string, asm_ctx.messages.size + 1);
if (!*messages)
{
ERR("Out of memory, no messages reported\n");
asm
_free(asm_ctx.messages.string);
d3dcompiler
_free(asm_ctx.messages.string);
}
} else {
}
else
{
*messages = NULL;
}
} else {
if(asm_ctx.messages.capacity) asm_free(asm_ctx.messages.string);
}
else
{
if (asm_ctx.messages.capacity)
d3dcompiler_free(asm_ctx.messages.string);
}
return ret;
...
...
dlls/d3dcompiler_43/bytecodewriter.c
View file @
491d0e9d
This diff is collapsed.
Click to expand it.
dlls/d3dcompiler_43/d3dcompiler_private.h
View file @
491d0e9d
...
...
@@ -2,6 +2,7 @@
* Copyright 2008 Stefan Dösinger
* Copyright 2009 Matteo Bruni
* Copyright 2010 Rico Schüller
* Copyright 2012 Matteo Bruni for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -138,15 +139,18 @@ struct bwriter_shader {
unsigned
int
num_instrs
,
instr_alloc_size
;
};
static
inline
LPVOID
asm_alloc
(
SIZE_T
size
)
{
static
inline
void
*
d3dcompiler_alloc
(
SIZE_T
size
)
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
}
static
inline
LPVOID
asm_realloc
(
LPVOID
ptr
,
SIZE_T
size
)
{
static
inline
void
*
d3dcompiler_realloc
(
void
*
ptr
,
SIZE_T
size
)
{
return
HeapReAlloc
(
GetProcessHeap
(),
0
,
ptr
,
size
);
}
static
inline
BOOL
asm_free
(
LPVOID
ptr
)
{
static
inline
BOOL
d3dcompiler_free
(
void
*
ptr
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
...
...
dlls/d3dcompiler_43/utils.c
View file @
491d0e9d
...
...
@@ -725,7 +725,7 @@ void compilation_message(struct compilation_messages *msg, const char *fmt, va_l
if
(
msg
->
capacity
==
0
)
{
msg
->
string
=
asm
_alloc
(
MESSAGEBUFFER_INITIAL_SIZE
);
msg
->
string
=
d3dcompiler
_alloc
(
MESSAGEBUFFER_INITIAL_SIZE
);
if
(
msg
->
string
==
NULL
)
{
ERR
(
"Error allocating memory for parser messages
\n
"
);
...
...
@@ -742,7 +742,7 @@ void compilation_message(struct compilation_messages *msg, const char *fmt, va_l
if
(
rc
<
0
||
rc
>=
msg
->
capacity
-
msg
->
size
)
{
size
=
msg
->
capacity
*
2
;
buffer
=
asm
_realloc
(
msg
->
string
,
size
);
buffer
=
d3dcompiler
_realloc
(
msg
->
string
,
size
);
if
(
buffer
==
NULL
)
{
ERR
(
"Error reallocating memory for parser messages
\n
"
);
...
...
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