Commit 007eb7d8 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Generate code for hull shaders.

parent 32c8d11e
......@@ -3809,7 +3809,7 @@ static GLuint shader_arb_generate_pshader(const struct wined3d_shader *shader,
}
/* Base Shader Body */
if (FAILED(shader_generate_main(shader, buffer, reg_maps, &priv_ctx)))
if (FAILED(shader_generate_code(shader, buffer, reg_maps, &priv_ctx, NULL, NULL)))
return 0;
if(args->super.srgb_correction) {
......@@ -4223,7 +4223,7 @@ static GLuint shader_arb_generate_vshader(const struct wined3d_shader *shader,
/* The shader starts with the main function */
priv_ctx.in_main_func = TRUE;
/* Base Shader Body */
if (FAILED(shader_generate_main(shader, buffer, reg_maps, &priv_ctx)))
if (FAILED(shader_generate_code(shader, buffer, reg_maps, &priv_ctx, NULL, NULL)))
return -1;
if (!priv_ctx.footer_written) vshader_add_footer(&priv_ctx,
......
......@@ -2418,10 +2418,10 @@ static void shader_dump_src_param(struct wined3d_string_buffer *buffer,
}
}
/* Shared code in order to generate the bulk of the shader string.
* NOTE: A description of how to parse tokens can be found on MSDN. */
HRESULT shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer,
const struct wined3d_shader_reg_maps *reg_maps, void *backend_ctx)
/* Shared code in order to generate the bulk of the shader string. */
HRESULT shader_generate_code(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer,
const struct wined3d_shader_reg_maps *reg_maps, void *backend_ctx,
const DWORD *start, const DWORD *end)
{
struct wined3d_device *device = shader->device;
const struct wined3d_shader_frontend *fe = shader->frontend;
......@@ -2449,8 +2449,10 @@ HRESULT shader_generate_main(const struct wined3d_shader *shader, struct wined3d
ins.ctx = &ctx;
fe->shader_read_header(fe_data, &ptr, &shader_version);
if (start)
ptr = start;
while (!fe->shader_is_end(fe_data, &ptr))
while (!fe->shader_is_end(fe_data, &ptr) && ptr != end)
{
/* Read opcode. */
fe->shader_read_instruction(fe_data, &ptr, &ins);
......
......@@ -3833,8 +3833,9 @@ BOOL string_buffer_init(struct wined3d_string_buffer *buffer) DECLSPEC_HIDDEN;
void string_buffer_free(struct wined3d_string_buffer *buffer) DECLSPEC_HIDDEN;
unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_maps *reg_maps,
unsigned int max) DECLSPEC_HIDDEN;
HRESULT shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer,
const struct wined3d_shader_reg_maps *reg_maps, void *backend_ctx) DECLSPEC_HIDDEN;
HRESULT shader_generate_code(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer,
const struct wined3d_shader_reg_maps *reg_maps, void *backend_ctx,
const DWORD *start, const DWORD *end) DECLSPEC_HIDDEN;
BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN;
static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment