Commit c2178eb6 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Make some GLSL structs and functions private to the backend.

parent de03fe3c
...@@ -53,9 +53,42 @@ typedef struct { ...@@ -53,9 +53,42 @@ typedef struct {
DWORD coord_mask; DWORD coord_mask;
} glsl_sample_function_t; } glsl_sample_function_t;
/** Prints the GLSL info log which will contain error messages if they exist */ /* GLSL shader private data */
void print_glsl_info_log(WineD3D_GL_Info *gl_info, GLhandleARB obj) { struct shader_glsl_priv {
struct hash_table_t *glsl_program_lookup;
struct glsl_shader_prog_link *glsl_program;
GLhandleARB depth_blt_glsl_program_id;
};
/* Struct to maintain data about a linked GLSL program */
struct glsl_shader_prog_link {
struct list vshader_entry;
struct list pshader_entry;
GLhandleARB programId;
GLhandleARB *vuniformF_locations;
GLhandleARB *puniformF_locations;
GLhandleARB vuniformI_locations[MAX_CONST_I];
GLhandleARB puniformI_locations[MAX_CONST_I];
GLhandleARB posFixup_location;
GLhandleARB bumpenvmat_location[MAX_TEXTURES];
GLhandleARB luminancescale_location[MAX_TEXTURES];
GLhandleARB luminanceoffset_location[MAX_TEXTURES];
GLhandleARB srgb_comparison_location;
GLhandleARB srgb_mul_low_location;
GLhandleARB ycorrection_location;
GLenum vertex_color_clamp;
GLhandleARB vshader;
GLhandleARB pshader;
};
typedef struct {
GLhandleARB vshader;
GLhandleARB pshader;
} glsl_program_key_t;
/** Prints the GLSL info log which will contain error messages if they exist */
static void print_glsl_info_log(WineD3D_GL_Info *gl_info, GLhandleARB obj) {
int infologLength = 0; int infologLength = 0;
char *infoLog; char *infoLog;
int i; int i;
...@@ -364,7 +397,7 @@ static void shader_glsl_load_constantsB( ...@@ -364,7 +397,7 @@ static void shader_glsl_load_constantsB(
/** /**
* Loads the app-supplied constants into the currently set GLSL program. * Loads the app-supplied constants into the currently set GLSL program.
*/ */
void shader_glsl_load_constants( static void shader_glsl_load_constants(
IWineD3DDevice* device, IWineD3DDevice* device,
char usePixelShader, char usePixelShader,
char useVertexShader) { char useVertexShader) {
...@@ -497,7 +530,7 @@ void shader_glsl_load_constants( ...@@ -497,7 +530,7 @@ void shader_glsl_load_constants(
} }
/** Generate the variable & register declarations for the GLSL output target */ /** Generate the variable & register declarations for the GLSL output target */
void shader_generate_glsl_declarations( static void shader_generate_glsl_declarations(
IWineD3DBaseShader *iface, IWineD3DBaseShader *iface,
shader_reg_maps* reg_maps, shader_reg_maps* reg_maps,
SHADER_BUFFER* buffer, SHADER_BUFFER* buffer,
...@@ -2762,7 +2795,7 @@ void pshader_glsl_dp2add(SHADER_OPCODE_ARG* arg) { ...@@ -2762,7 +2795,7 @@ void pshader_glsl_dp2add(SHADER_OPCODE_ARG* arg) {
} }
} }
void pshader_glsl_input_pack( static void pshader_glsl_input_pack(
SHADER_BUFFER* buffer, SHADER_BUFFER* buffer,
semantic* semantics_in, semantic* semantics_in,
IWineD3DPixelShader *iface) { IWineD3DPixelShader *iface) {
...@@ -2838,7 +2871,7 @@ static struct glsl_shader_prog_link *get_glsl_program_entry(struct shader_glsl_p ...@@ -2838,7 +2871,7 @@ static struct glsl_shader_prog_link *get_glsl_program_entry(struct shader_glsl_p
return (struct glsl_shader_prog_link *)hash_table_get(priv->glsl_program_lookup, &key); return (struct glsl_shader_prog_link *)hash_table_get(priv->glsl_program_lookup, &key);
} }
void delete_glsl_program_entry(struct shader_glsl_priv *priv, WineD3D_GL_Info *gl_info, struct glsl_shader_prog_link *entry) { static void delete_glsl_program_entry(struct shader_glsl_priv *priv, WineD3D_GL_Info *gl_info, struct glsl_shader_prog_link *entry) {
glsl_program_key_t *key; glsl_program_key_t *key;
key = HeapAlloc(GetProcessHeap(), 0, sizeof(glsl_program_key_t)); key = HeapAlloc(GetProcessHeap(), 0, sizeof(glsl_program_key_t));
......
...@@ -255,13 +255,6 @@ extern const shader_backend_t glsl_shader_backend; ...@@ -255,13 +255,6 @@ extern const shader_backend_t glsl_shader_backend;
extern const shader_backend_t arb_program_shader_backend; extern const shader_backend_t arb_program_shader_backend;
extern const shader_backend_t none_shader_backend; extern const shader_backend_t none_shader_backend;
/* GLSL shader private data */
struct shader_glsl_priv {
struct hash_table_t *glsl_program_lookup;
struct glsl_shader_prog_link *glsl_program;
GLhandleARB depth_blt_glsl_program_id;
};
/* ARB_program_shader private data */ /* ARB_program_shader private data */
struct shader_arb_priv { struct shader_arb_priv {
GLuint current_vprogram_id; GLuint current_vprogram_id;
...@@ -1893,34 +1886,6 @@ unsigned int count_bits(unsigned int mask); ...@@ -1893,34 +1886,6 @@ unsigned int count_bits(unsigned int mask);
typedef void (*SHADER_HANDLER) (struct SHADER_OPCODE_ARG*); typedef void (*SHADER_HANDLER) (struct SHADER_OPCODE_ARG*);
/* Struct to maintain a list of GLSL shader programs and their associated pixel and
* vertex shaders. A list of this type is maintained on the DeviceImpl, and is only
* used if the user is using GLSL shaders. */
struct glsl_shader_prog_link {
struct list vshader_entry;
struct list pshader_entry;
GLhandleARB programId;
GLhandleARB *vuniformF_locations;
GLhandleARB *puniformF_locations;
GLhandleARB vuniformI_locations[MAX_CONST_I];
GLhandleARB puniformI_locations[MAX_CONST_I];
GLhandleARB posFixup_location;
GLhandleARB bumpenvmat_location[MAX_TEXTURES];
GLhandleARB luminancescale_location[MAX_TEXTURES];
GLhandleARB luminanceoffset_location[MAX_TEXTURES];
GLhandleARB srgb_comparison_location;
GLhandleARB srgb_mul_low_location;
GLhandleARB ycorrection_location;
GLenum vertex_color_clamp;
GLhandleARB vshader;
GLhandleARB pshader;
};
typedef struct {
GLhandleARB vshader;
GLhandleARB pshader;
} glsl_program_key_t;
/* TODO: Make this dynamic, based on shader limits ? */ /* TODO: Make this dynamic, based on shader limits ? */
#define MAX_REG_ADDR 1 #define MAX_REG_ADDR 1
#define MAX_REG_TEMP 32 #define MAX_REG_TEMP 32
...@@ -2103,10 +2068,6 @@ extern void vshader_hw_rsq_rcp(SHADER_OPCODE_ARG* arg); ...@@ -2103,10 +2068,6 @@ extern void vshader_hw_rsq_rcp(SHADER_OPCODE_ARG* arg);
/* GLSL helper functions */ /* GLSL helper functions */
extern void shader_glsl_add_instruction_modifiers(SHADER_OPCODE_ARG *arg); extern void shader_glsl_add_instruction_modifiers(SHADER_OPCODE_ARG *arg);
extern void shader_glsl_load_constants(
IWineD3DDevice* device,
char usePixelShader,
char useVertexShader);
/** The following translate DirectX pixel/vertex shader opcodes to GLSL lines */ /** The following translate DirectX pixel/vertex shader opcodes to GLSL lines */
extern void shader_glsl_cross(SHADER_OPCODE_ARG* arg); extern void shader_glsl_cross(SHADER_OPCODE_ARG* arg);
...@@ -2165,10 +2126,6 @@ extern void pshader_glsl_texreg2ar(SHADER_OPCODE_ARG* arg); ...@@ -2165,10 +2126,6 @@ extern void pshader_glsl_texreg2ar(SHADER_OPCODE_ARG* arg);
extern void pshader_glsl_texreg2gb(SHADER_OPCODE_ARG* arg); extern void pshader_glsl_texreg2gb(SHADER_OPCODE_ARG* arg);
extern void pshader_glsl_texreg2rgb(SHADER_OPCODE_ARG* arg); extern void pshader_glsl_texreg2rgb(SHADER_OPCODE_ARG* arg);
extern void pshader_glsl_dp2add(SHADER_OPCODE_ARG* arg); extern void pshader_glsl_dp2add(SHADER_OPCODE_ARG* arg);
extern void pshader_glsl_input_pack(
SHADER_BUFFER* buffer,
semantic* semantics_out,
IWineD3DPixelShader *iface);
/***************************************************************************** /*****************************************************************************
* IDirect3DBaseShader implementation structure * IDirect3DBaseShader implementation structure
...@@ -2236,12 +2193,6 @@ extern HRESULT shader_get_registers_used( ...@@ -2236,12 +2193,6 @@ extern HRESULT shader_get_registers_used(
CONST DWORD* pToken, CONST DWORD* pToken,
IWineD3DStateBlockImpl *stateBlock); IWineD3DStateBlockImpl *stateBlock);
extern void shader_generate_glsl_declarations(
IWineD3DBaseShader *iface,
shader_reg_maps* reg_maps,
SHADER_BUFFER* buffer,
WineD3D_GL_Info* gl_info);
extern void shader_generate_arb_declarations( extern void shader_generate_arb_declarations(
IWineD3DBaseShader *iface, IWineD3DBaseShader *iface,
shader_reg_maps* reg_maps, shader_reg_maps* reg_maps,
...@@ -2277,10 +2228,6 @@ extern int shader_skip_unrecognized( ...@@ -2277,10 +2228,6 @@ extern int shader_skip_unrecognized(
IWineD3DBaseShader* iface, IWineD3DBaseShader* iface,
const DWORD* pToken); const DWORD* pToken);
extern void print_glsl_info_log(
WineD3D_GL_Info *gl_info,
GLhandleARB obj);
static inline int shader_get_regtype(const DWORD param) { static inline int shader_get_regtype(const DWORD param) {
return (((param & WINED3DSP_REGTYPE_MASK) >> WINED3DSP_REGTYPE_SHIFT) | return (((param & WINED3DSP_REGTYPE_MASK) >> WINED3DSP_REGTYPE_SHIFT) |
((param & WINED3DSP_REGTYPE_MASK2) >> WINED3DSP_REGTYPE_SHIFT2)); ((param & WINED3DSP_REGTYPE_MASK2) >> WINED3DSP_REGTYPE_SHIFT2));
......
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