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

wined3d: Const correctness fixes for arb_program_shader.c.

parent cfb3bea8
...@@ -1019,7 +1019,8 @@ static void atifs_enable(IWineD3DDevice *iface, BOOL enable) { ...@@ -1019,7 +1019,8 @@ static void atifs_enable(IWineD3DDevice *iface, BOOL enable) {
} }
} }
static void atifs_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info, struct fragment_caps *caps) { static void atifs_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *caps)
{
caps->TextureOpCaps = WINED3DTEXOPCAPS_DISABLE | caps->TextureOpCaps = WINED3DTEXOPCAPS_DISABLE |
WINED3DTEXOPCAPS_SELECTARG1 | WINED3DTEXOPCAPS_SELECTARG1 |
WINED3DTEXOPCAPS_SELECTARG2 | WINED3DTEXOPCAPS_SELECTARG2 |
......
...@@ -782,12 +782,9 @@ void shader_dump_param( ...@@ -782,12 +782,9 @@ void shader_dump_param(
Use the shader_header_fct & shader_footer_fct to add strings Use the shader_header_fct & shader_footer_fct to add strings
that are specific to pixel or vertex functions that are specific to pixel or vertex functions
NOTE: A description of how to parse tokens can be found on msdn */ NOTE: A description of how to parse tokens can be found on msdn */
void shader_generate_main( void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
IWineD3DBaseShader *iface, const shader_reg_maps* reg_maps, CONST DWORD* pFunction)
SHADER_BUFFER* buffer, {
shader_reg_maps* reg_maps,
CONST DWORD* pFunction) {
IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface;
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) This->baseShader.device; /* To access shader backend callbacks */ IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) This->baseShader.device; /* To access shader backend callbacks */
const SHADER_HANDLER *handler_table = device->shader_backend->shader_instruction_handler_table; const SHADER_HANDLER *handler_table = device->shader_backend->shader_instruction_handler_table;
...@@ -1096,7 +1093,7 @@ static void shader_none_select_depth_blt(IWineD3DDevice *iface, enum tex_types t ...@@ -1096,7 +1093,7 @@ static void shader_none_select_depth_blt(IWineD3DDevice *iface, enum tex_types t
static void shader_none_deselect_depth_blt(IWineD3DDevice *iface) {} static void shader_none_deselect_depth_blt(IWineD3DDevice *iface) {}
static void shader_none_load_constants(IWineD3DDevice *iface, char usePS, char useVS) {} static void shader_none_load_constants(IWineD3DDevice *iface, char usePS, char useVS) {}
static void shader_none_cleanup(IWineD3DDevice *iface) {} static void shader_none_cleanup(IWineD3DDevice *iface) {}
static void shader_none_color_correction(SHADER_OPCODE_ARG* arg) {} static void shader_none_color_correction(const SHADER_OPCODE_ARG *arg) {}
static void shader_none_destroy(IWineD3DBaseShader *iface) {} static void shader_none_destroy(IWineD3DBaseShader *iface) {}
static HRESULT shader_none_alloc(IWineD3DDevice *iface) {return WINED3D_OK;} static HRESULT shader_none_alloc(IWineD3DDevice *iface) {return WINED3D_OK;}
static void shader_none_free(IWineD3DDevice *iface) {} static void shader_none_free(IWineD3DDevice *iface) {}
...@@ -1110,7 +1107,8 @@ static void shader_none_generate_vshader(IWineD3DVertexShader *iface, SHADER_BUF ...@@ -1110,7 +1107,8 @@ static void shader_none_generate_vshader(IWineD3DVertexShader *iface, SHADER_BUF
} }
#define GLINFO_LOCATION (*gl_info) #define GLINFO_LOCATION (*gl_info)
static void shader_none_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info, struct shader_caps *pCaps) { static void shader_none_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *pCaps)
{
/* Set the shader caps to 0 for the none shader backend */ /* Set the shader caps to 0 for the none shader backend */
pCaps->VertexShaderVersion = 0; pCaps->VertexShaderVersion = 0;
pCaps->PixelShaderVersion = 0; pCaps->PixelShaderVersion = 0;
......
...@@ -1186,7 +1186,8 @@ static void shader_glsl_get_sample_function(DWORD sampler_type, BOOL projected, ...@@ -1186,7 +1186,8 @@ static void shader_glsl_get_sample_function(DWORD sampler_type, BOOL projected,
} }
} }
static void shader_glsl_color_correction(SHADER_OPCODE_ARG* arg) { static void shader_glsl_color_correction(const SHADER_OPCODE_ARG *arg)
{
IWineD3DBaseShaderImpl* shader = (IWineD3DBaseShaderImpl*) arg->shader; IWineD3DBaseShaderImpl* shader = (IWineD3DBaseShaderImpl*) arg->shader;
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) shader->baseShader.device; IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) shader->baseShader.device;
WineD3D_GL_Info *gl_info = &deviceImpl->adapter->gl_info; WineD3D_GL_Info *gl_info = &deviceImpl->adapter->gl_info;
...@@ -3805,7 +3806,8 @@ static void shader_glsl_generate_vshader(IWineD3DVertexShader *iface, SHADER_BUF ...@@ -3805,7 +3806,8 @@ static void shader_glsl_generate_vshader(IWineD3DVertexShader *iface, SHADER_BUF
This->prgId = shader_obj; This->prgId = shader_obj;
} }
static void shader_glsl_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info, struct shader_caps *pCaps) { static void shader_glsl_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *pCaps)
{
/* Nvidia Geforce6/7 or Ati R4xx/R5xx cards with GLSL support, support VS 3.0 but older Nvidia/Ati /* Nvidia Geforce6/7 or Ati R4xx/R5xx cards with GLSL support, support VS 3.0 but older Nvidia/Ati
* models with GLSL support only support 2.0. In case of nvidia we can detect VS 2.0 support using * models with GLSL support only support 2.0. In case of nvidia we can detect VS 2.0 support using
* vs_nv_version which is based on NV_vertex_program. * vs_nv_version which is based on NV_vertex_program.
......
...@@ -610,7 +610,8 @@ static void nvts_enable(IWineD3DDevice *iface, BOOL enable) { ...@@ -610,7 +610,8 @@ static void nvts_enable(IWineD3DDevice *iface, BOOL enable) {
} }
} }
static void nvrc_fragment_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info, struct fragment_caps *pCaps) { static void nvrc_fragment_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *pCaps)
{
pCaps->TextureOpCaps = WINED3DTEXOPCAPS_ADD | pCaps->TextureOpCaps = WINED3DTEXOPCAPS_ADD |
WINED3DTEXOPCAPS_ADDSIGNED | WINED3DTEXOPCAPS_ADDSIGNED |
WINED3DTEXOPCAPS_ADDSIGNED2X | WINED3DTEXOPCAPS_ADDSIGNED2X |
......
...@@ -5437,7 +5437,8 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = { ...@@ -5437,7 +5437,8 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = {
#define GLINFO_LOCATION (*gl_info) #define GLINFO_LOCATION (*gl_info)
static void ffp_enable(IWineD3DDevice *iface, BOOL enable) { } static void ffp_enable(IWineD3DDevice *iface, BOOL enable) { }
static void ffp_fragment_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info, struct fragment_caps *pCaps) { static void ffp_fragment_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *pCaps)
{
pCaps->TextureOpCaps = WINED3DTEXOPCAPS_ADD | pCaps->TextureOpCaps = WINED3DTEXOPCAPS_ADD |
WINED3DTEXOPCAPS_ADDSIGNED | WINED3DTEXOPCAPS_ADDSIGNED |
WINED3DTEXOPCAPS_ADDSIGNED2X | WINED3DTEXOPCAPS_ADDSIGNED2X |
......
...@@ -345,14 +345,14 @@ typedef struct { ...@@ -345,14 +345,14 @@ typedef struct {
void (*shader_deselect_depth_blt)(IWineD3DDevice *iface); void (*shader_deselect_depth_blt)(IWineD3DDevice *iface);
void (*shader_load_constants)(IWineD3DDevice *iface, char usePS, char useVS); void (*shader_load_constants)(IWineD3DDevice *iface, char usePS, char useVS);
void (*shader_cleanup)(IWineD3DDevice *iface); void (*shader_cleanup)(IWineD3DDevice *iface);
void (*shader_color_correction)(struct SHADER_OPCODE_ARG *arg); void (*shader_color_correction)(const struct SHADER_OPCODE_ARG *arg);
void (*shader_destroy)(IWineD3DBaseShader *iface); void (*shader_destroy)(IWineD3DBaseShader *iface);
HRESULT (*shader_alloc_private)(IWineD3DDevice *iface); HRESULT (*shader_alloc_private)(IWineD3DDevice *iface);
void (*shader_free_private)(IWineD3DDevice *iface); void (*shader_free_private)(IWineD3DDevice *iface);
BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface); BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface);
GLuint (*shader_generate_pshader)(IWineD3DPixelShader *iface, SHADER_BUFFER *buffer); GLuint (*shader_generate_pshader)(IWineD3DPixelShader *iface, SHADER_BUFFER *buffer);
void (*shader_generate_vshader)(IWineD3DVertexShader *iface, SHADER_BUFFER *buffer); void (*shader_generate_vshader)(IWineD3DVertexShader *iface, SHADER_BUFFER *buffer);
void (*shader_get_caps)(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info, struct shader_caps *caps); void (*shader_get_caps)(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *caps);
BOOL (*shader_conv_supported)(WINED3DFORMAT conv); BOOL (*shader_conv_supported)(WINED3DFORMAT conv);
} shader_backend_t; } shader_backend_t;
...@@ -642,7 +642,7 @@ struct fragment_caps { ...@@ -642,7 +642,7 @@ struct fragment_caps {
struct fragment_pipeline { struct fragment_pipeline {
void (*enable_extension)(IWineD3DDevice *iface, BOOL enable); void (*enable_extension)(IWineD3DDevice *iface, BOOL enable);
void (*get_caps)(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info, struct fragment_caps *caps); void (*get_caps)(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *caps);
HRESULT (*alloc_private)(IWineD3DDevice *iface); HRESULT (*alloc_private)(IWineD3DDevice *iface);
void (*free_private)(IWineD3DDevice *iface); void (*free_private)(IWineD3DDevice *iface);
BOOL (*conv_supported)(WINED3DFORMAT conv); BOOL (*conv_supported)(WINED3DFORMAT conv);
...@@ -2066,7 +2066,7 @@ typedef struct SHADER_OPCODE { ...@@ -2066,7 +2066,7 @@ typedef struct SHADER_OPCODE {
typedef struct SHADER_OPCODE_ARG { typedef struct SHADER_OPCODE_ARG {
IWineD3DBaseShader* shader; IWineD3DBaseShader* shader;
shader_reg_maps* reg_maps; const shader_reg_maps *reg_maps;
CONST SHADER_OPCODE* opcode; CONST SHADER_OPCODE* opcode;
DWORD opcode_token; DWORD opcode_token;
DWORD dst; DWORD dst;
...@@ -2194,11 +2194,8 @@ extern HRESULT shader_get_registers_used( ...@@ -2194,11 +2194,8 @@ extern HRESULT shader_get_registers_used(
CONST DWORD* pToken, CONST DWORD* pToken,
IWineD3DStateBlockImpl *stateBlock); IWineD3DStateBlockImpl *stateBlock);
extern void shader_generate_main( extern void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER *buffer,
IWineD3DBaseShader *iface, const shader_reg_maps *reg_maps, const DWORD *pFunction);
SHADER_BUFFER* buffer,
shader_reg_maps* reg_maps,
CONST DWORD* pFunction);
extern void shader_dump_ins_modifiers( extern void shader_dump_ins_modifiers(
const DWORD output); const DWORD output);
......
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