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
949de2e5
Commit
949de2e5
authored
May 15, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
May 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Add a stub parser.
parent
47a7f7f1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
128 additions
and
8 deletions
+128
-8
.gitignore
.gitignore
+2
-0
Makefile.in
dlls/d3dcompiler_43/Makefile.in
+3
-1
compiler.c
dlls/d3dcompiler_43/compiler.c
+0
-7
d3dcompiler_private.h
dlls/d3dcompiler_43/d3dcompiler_private.h
+29
-0
hlsl.y
dlls/d3dcompiler_43/hlsl.y
+94
-0
No files found.
.gitignore
View file @
949de2e5
...
...
@@ -52,6 +52,8 @@ dlls/advapi32/svcctl_c.c
dlls/d3dcompiler_43/asmshader.tab.c
dlls/d3dcompiler_43/asmshader.tab.h
dlls/d3dcompiler_43/asmshader.yy.c
dlls/d3dcompiler_43/hlsl.tab.c
dlls/d3dcompiler_43/hlsl.tab.h
dlls/dispex/disp_ex.h
dlls/dispex/disp_ex_p.c
dlls/dxdiagn/fil_data.h
...
...
dlls/d3dcompiler_43/Makefile.in
View file @
949de2e5
...
...
@@ -13,7 +13,9 @@ C_SRCS = \
utils.c
LEX_SRCS
=
asmshader.l
BISON_SRCS
=
asmshader.y
BISON_SRCS
=
\
asmshader.y
\
hlsl.y
RC_SRCS
=
version.rc
...
...
dlls/d3dcompiler_43/compiler.c
View file @
949de2e5
...
...
@@ -490,13 +490,6 @@ HRESULT WINAPI D3DAssemble(const void *data, SIZE_T datasize, const char *filena
return
hr
;
}
static
struct
bwriter_shader
*
parse_hlsl_shader
(
const
char
*
text
,
enum
shader_type
type
,
DWORD
version
,
const
char
*
entrypoint
,
char
**
messages
)
{
FIXME
(
"
\n
"
);
return
NULL
;
}
static
HRESULT
compile_shader
(
const
char
*
preproc_shader
,
const
char
*
target
,
const
char
*
entrypoint
,
ID3DBlob
**
shader_blob
,
ID3DBlob
**
error_messages
)
{
...
...
dlls/d3dcompiler_43/d3dcompiler_private.h
View file @
949de2e5
...
...
@@ -573,6 +573,35 @@ struct bwriter_shader *SlAssembleShader(const char *text, char **messages) DECLS
HRESULT
SlWriteBytecode
(
const
struct
bwriter_shader
*
shader
,
int
dxversion
,
DWORD
**
result
,
DWORD
*
size
)
DECLSPEC_HIDDEN
;
void
SlDeleteShader
(
struct
bwriter_shader
*
shader
)
DECLSPEC_HIDDEN
;
enum
hlsl_matrix_majority
{
HLSL_COLUMN_MAJOR
,
HLSL_ROW_MAJOR
};
struct
hlsl_parse_ctx
{
char
*
source_file
;
unsigned
int
line_no
;
enum
parse_status
status
;
struct
compilation_messages
messages
;
struct
hlsl_scope
*
cur_scope
;
struct
hlsl_scope
*
globals
;
struct
list
scopes
;
struct
list
types
;
struct
list
functions
;
enum
hlsl_matrix_majority
matrix_majority
;
};
extern
struct
hlsl_parse_ctx
hlsl_ctx
DECLSPEC_HIDDEN
;
void
hlsl_message
(
const
char
*
fmt
,
...)
PRINTF_ATTR
(
1
,
2
)
DECLSPEC_HIDDEN
;
struct
bwriter_shader
*
parse_hlsl_shader
(
const
char
*
text
,
enum
shader_type
type
,
DWORD
version
,
const
char
*
entrypoint
,
char
**
messages
)
DECLSPEC_HIDDEN
;
#define MAKE_TAG(ch0, ch1, ch2, ch3) \
((DWORD)(ch0) | ((DWORD)(ch1) << 8) | \
((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
...
...
dlls/d3dcompiler_43/hlsl.y
0 → 100644
View file @
949de2e5
/*
* HLSL parser
*
* Copyright 2008 Stefan Dösinger
* 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
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
%{
#include "config.h"
#include "wine/debug.h"
#include <stdio.h>
#include "d3dcompiler_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(hlsl_parser);
int hlsl_lex(void)
{
FIXME("Lexer.\n");
return 0;
}
struct hlsl_parse_ctx hlsl_ctx;
void hlsl_message(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
compilation_message(&hlsl_ctx.messages, fmt, args);
va_end(args);
}
static void hlsl_error(const char *s)
{
hlsl_message("Line %u: %s\n", hlsl_ctx.line_no, s);
set_parse_status(&hlsl_ctx.status, PARSE_ERR);
}
%}
%error-verbose
%union
{
char *name;
INT intval;
}
%token <intval> PRE_LINE
%token <name> STRING
%%
hlsl_prog: /* empty */
{
}
| hlsl_prog preproc_directive
{
}
preproc_directive: PRE_LINE STRING
{
TRACE("Updating line informations to file %s, line %u\n", debugstr_a($2), $1);
hlsl_ctx.line_no = $1 - 1;
d3dcompiler_free(hlsl_ctx.source_file);
hlsl_ctx.source_file = $2;
}
%%
struct bwriter_shader *parse_hlsl_shader(const char *text, enum shader_type type, DWORD version, const char *entrypoint, char **messages)
{
hlsl_ctx.line_no = 1;
hlsl_ctx.matrix_majority = HLSL_COLUMN_MAJOR;
hlsl_parse();
return NULL;
}
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