30#define D3DXERR_INVALIDDATA 0x88760b59
32#define BUFFER_INITIAL_CAPACITY 256
45#define INCLUDES_INITIAL_CAPACITY 4
81 0, 0, { (
DWORD_PTR)(__FILE__
": wpp_mutex") }
110 if(newbuffer ==
NULL)
112 ERR(
"Error reallocating memory for parser messages\n");
139 wpp_write_message_var(
"%s:%d:%d: %s: ",
143 wpp_write_message_var(
"\n");
153 wpp_write_message_var(
"%s:%d:%d: %s: ",
157 wpp_write_message_var(
"\n");
184 ERR(
"Parent include %s missing.\n",
debugstr_a(parent_name));
227 ERR(
"Error allocating memory for the loaded includes structure\n");
237 if(newincludes ==
NULL)
239 ERR(
"Error reallocating memory for the loaded includes structure\n");
267 ERR(
"current_include == NULL, desc == %p, buffer = %s\n",
286 char *new_wpp_output;
306 ERR(
"Error allocating memory\n");
319 if(!new_wpp_output)
return 0;
391 def->
value = new_value;
516 TRACE(
"Error during shader preprocessing\n");
567 TRACE(
"Assembler messages:\n");
570 TRACE(
"Shader source:\n");
585 pos = ID3D10Blob_GetBufferPointer(
buffer);
586 if (preproc_messages)
601 ERR(
"Asm reading failed\n");
609 ERR(
"SlWriteBytecode failed with 0x%08x\n",
hr);
636 TRACE(
"data %p, datasize %lu, filename %s, defines %p, include %p, sflags %#x, "
637 "shader %p, error_messages %p.\n",
794 TRACE(
"Compiler messages:\n");
797 TRACE(
"Shader source:\n");
812 pos = ID3D10Blob_GetBufferPointer(
buffer);
813 if (preproc_messages)
828 ERR(
"HLSL shader parsing failed.\n");
836 ERR(
"SlWriteBytecode failed with error 0x%08x.\n",
hr);
865 TRACE(
"data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s, "
866 "target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p, "
867 "secondary_data_size %lu, shader %p, error_messages %p.\n",
873 FIXME(
"secondary data not implemented yet\n");
893 TRACE(
"data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s, "
894 "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p.\n",
909 TRACE(
"data %p, size %lu, filename %s, defines %p, include %p, shader %p, error_messages %p\n",
944 FIXME(
"data %p, size %lu, flags %#x, comments %p, disassembly %p stub!\n",
952 FIXME(
"filename %s, defines %p, includes %p, entrypoint %s, target %s, flags1 %x, flags2 %x, code %p, errors %p\n",
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
HRESULT SlWriteBytecode(const struct bwriter_shader *shader, int dxversion, DWORD **result, DWORD *size)
void SlDeleteShader(struct bwriter_shader *shader)
static HRESULT compile_shader(const char *preproc_shader, const char *target, const char *entrypoint, ID3DBlob **shader_blob, ID3DBlob **error_messages)
static void del_special_defines(void)
HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **shader, ID3DBlob **error_messages)
static const struct target_info * get_target_info(const char *target)
void * wpp_open(const char *filename, int type)
static int wpp_output_capacity
static CRITICAL_SECTION wpp_mutex
HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages)
#define INCLUDES_INITIAL_CAPACITY
void wpp_write(const char *buffer, unsigned int len)
int WINAPIV ppy_error(const char *msg,...)
#define BUFFER_INITIAL_CAPACITY
static void wpp_write_message(const char *fmt, __ms_va_list args)
static void add_special_defines(void)
static int wpp_output_size
static int wpp_close_output(void)
HRESULT WINAPI D3DDisassemble(const void *data, SIZE_T size, UINT flags, const char *comments, ID3DBlob **disassembly)
static CRITICAL_SECTION_DEBUG wpp_mutex_debug
static char * wpp_messages
static int wpp_messages_capacity
static int wpp_messages_size
int wpp_add_define(const char *name, const char *value)
void wpp_close(void *file)
#define D3DXERR_INVALIDDATA
void wpp_del_define(const char *name)
int wpp_parse(const char *input, FILE *output)
HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, UINT secondary_flags, const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader, ID3DBlob **error_messages)
int WINAPIV ppy_warning(const char *msg,...)
static ID3DInclude * current_include
HRESULT WINAPI D3DAssemble(const void *data, SIZE_T datasize, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, UINT flags, ID3DBlob **shader, ID3DBlob **error_messages)
int wpp_read(void *file, char *buffer, unsigned int len)
static struct loaded_include * includes
static const char * parent_include
char * wpp_lookup(const char *filename, int type, const char *parent_name)
static HRESULT preprocess_shader(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **error_messages)
HRESULT WINAPI D3DLoadModule(const void *data, SIZE_T size, ID3D11Module **module)
static const char * initial_filename
static struct define * cmdline_defines
static const struct target_info targets_info[]
static struct mem_file_desc current_shader
HRESULT WINAPI D3DCompileFromFile(const WCHAR *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *includes, const char *entrypoint, const char *target, UINT flags1, UINT flags2, ID3DBlob **code, ID3DBlob **errors)
static void add_cmdline_defines(void)
static HRESULT assemble_shader(const char *preproc_shader, ID3DBlob **shader_blob, ID3DBlob **error_messages)
static void del_cmdline_defines(void)
static int includes_capacity
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
static SIZE_T const char const D3D_SHADER_MACRO * defines
struct bwriter_shader * parse_hlsl_shader(const char *text, enum shader_type type, DWORD major, DWORD minor, const char *entrypoint, char **messages) DECLSPEC_HIDDEN
#define PRINTF_ATTR(fmt, args)
#define D3DERR_INVALIDCALL
struct bwriter_shader * SlAssembleShader(const char *text, char **messages) DECLSPEC_HIDDEN
#define MESSAGEBUFFER_INITIAL_SIZE
HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3DBlob **blob)
pp_entry_t * pp_add_define(const char *def, const char *text)
char * pp_xstrdup(const char *str)
int pp_get_if_depth(void)
void * pp_xmalloc(size_t size)
int pp_push_define_state(void)
void pp_pop_define_state(void)
pp_if_state_t pp_pop_if(void)
void pp_del_define(const char *name)
void WINAPIV int ppy_parse(void)
void WINAPIV pp_writestring(const char *format,...) __attribute__((format(printf
static __inline const char * debugstr_an(const char *s, int n)
#define HeapFree(x, y, z)
static void cleanup(void)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLenum GLenum input
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
static const WCHAR desc[]
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
size_t CDECL strftime(char *str, size_t max, const char *format, const struct tm *mstm)
LIST_ENTRY ProcessLocksList
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define __ms_va_end(list)
#define __ms_va_start(list, arg)
void int int ULONGLONG int va_list * ap