static void context_destroy_fbo(IWineD3DDeviceImpl *This, const GLuint *fbo)
{
- int i = 0;
+ unsigned int i;
GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, *fbo));
checkGLcall("glBindFramebuffer()");
HPBUFFERARB pbuffer = NULL;
HGLRC ctx = NULL, oldCtx;
WineD3DContext *ret = NULL;
- int s;
+ unsigned int s;
TRACE("(%p): Creating a %s context for render target %p\n", This, create_pbuffer ? "offscreen" : "onscreen", target);
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DStateBlockImpl *object;
- int i, j;
+ unsigned int i, j;
HRESULT temp_result;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
UINT count) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
- int i, cnt = min(count, MAX_CONST_B - start);
+ unsigned int i, cnt = min(count, MAX_CONST_B - start);
TRACE("(iface %p, srcData %p, start %d, count %d)\n",
iface, srcData, start, count);
- if (srcData == NULL || cnt < 0)
- return WINED3DERR_INVALIDCALL;
+ if (!srcData || start >= MAX_CONST_B) return WINED3DERR_INVALIDCALL;
memcpy(&This->updateStateBlock->vertexShaderConstantB[start], srcData, cnt * sizeof(BOOL));
for (i = 0; i < cnt; i++)
UINT count) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
- int i, cnt = min(count, MAX_CONST_I - start);
+ unsigned int i, cnt = min(count, MAX_CONST_I - start);
TRACE("(iface %p, srcData %p, start %d, count %d)\n",
iface, srcData, start, count);
- if (srcData == NULL || cnt < 0)
- return WINED3DERR_INVALIDCALL;
+ if (!srcData || start >= MAX_CONST_I) return WINED3DERR_INVALIDCALL;
memcpy(&This->updateStateBlock->vertexShaderConstantI[start * 4], srcData, cnt * sizeof(int) * 4);
for (i = 0; i < cnt; i++)
}
static void device_map_fixed_function_samplers(IWineD3DDeviceImpl *This) {
- int i, tex;
+ unsigned int i, tex;
WORD ffu_map;
device_update_fixed_function_usage_map(This);
static void device_map_psamplers(IWineD3DDeviceImpl *This) {
const DWORD *sampler_tokens =
((IWineD3DPixelShaderImpl *)This->stateBlock->pixelShader)->baseShader.reg_maps.samplers;
- int i;
+ unsigned int i;
for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) {
if (sampler_tokens[i] && This->texUnitMap[i] != i) {
UINT count) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
- int i, cnt = min(count, MAX_CONST_B - start);
+ unsigned int i, cnt = min(count, MAX_CONST_B - start);
- TRACE("(iface %p, srcData %p, start %d, count %d)\n",
+ TRACE("(iface %p, srcData %p, start %u, count %u)\n",
iface, srcData, start, count);
- if (srcData == NULL || cnt < 0)
- return WINED3DERR_INVALIDCALL;
+ if (!srcData || start >= MAX_CONST_B) return WINED3DERR_INVALIDCALL;
memcpy(&This->updateStateBlock->pixelShaderConstantB[start], srcData, cnt * sizeof(BOOL));
for (i = 0; i < cnt; i++)
UINT count) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
- int i, cnt = min(count, MAX_CONST_I - start);
+ unsigned int i, cnt = min(count, MAX_CONST_I - start);
- TRACE("(iface %p, srcData %p, start %d, count %d)\n",
+ TRACE("(iface %p, srcData %p, start %u, count %u)\n",
iface, srcData, start, count);
- if (srcData == NULL || cnt < 0)
- return WINED3DERR_INVALIDCALL;
+ if (!srcData || start >= MAX_CONST_I) return WINED3DERR_INVALIDCALL;
memcpy(&This->updateStateBlock->pixelShaderConstantI[start * 4], srcData, cnt * sizeof(int) * 4);
for (i = 0; i < cnt; i++)
}
if(Type == WINED3DTSS_COLOROP) {
- int i;
+ unsigned int i;
if(Value == WINED3DTOP_DISABLE && oldValue != WINED3DTOP_DISABLE) {
/* Previously enabled stage disabled now. Make sure to dirtify all enabled stages above Stage,
* The current stage is dirtified below.
*/
for(i = Stage + 1; i < This->stateBlock->lowest_disabled_stage; i++) {
- TRACE("Additionally dirtifying stage %d\n", i);
+ TRACE("Additionally dirtifying stage %u\n", i);
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_TEXTURESTAGE(i, WINED3DTSS_COLOROP));
}
This->stateBlock->lowest_disabled_stage = Stage;
- TRACE("New lowest disabled: %d\n", Stage);
+ TRACE("New lowest disabled: %u\n", Stage);
} else if(Value != WINED3DTOP_DISABLE && oldValue == WINED3DTOP_DISABLE) {
/* Previously disabled stage enabled. Stages above it may need enabling
* stage must be lowest_disabled_stage here, if it's bigger success is returned above,
if(This->updateStateBlock->textureState[i][WINED3DTSS_COLOROP] == WINED3DTOP_DISABLE) {
break;
}
- TRACE("Additionally dirtifying stage %d due to enable\n", i);
+ TRACE("Additionally dirtifying stage %u due to enable\n", i);
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_TEXTURESTAGE(i, WINED3DTSS_COLOROP));
}
This->stateBlock->lowest_disabled_stage = i;
- TRACE("New lowest disabled: %d\n", i);
+ TRACE("New lowest disabled: %u\n", i);
}
}
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 ycorrection_location;
+ GLint *vuniformF_locations;
+ GLint *puniformF_locations;
+ GLint vuniformI_locations[MAX_CONST_I];
+ GLint puniformI_locations[MAX_CONST_I];
+ GLint posFixup_location;
+ GLint bumpenvmat_location[MAX_TEXTURES];
+ GLint luminancescale_location[MAX_TEXTURES];
+ GLint luminanceoffset_location[MAX_TEXTURES];
+ GLint ycorrection_location;
GLenum vertex_color_clamp;
IWineD3DVertexShader *vshader;
IWineD3DPixelShader *pshader;
*/
static void shader_glsl_load_psamplers(const WineD3D_GL_Info *gl_info, DWORD *tex_unit_map, GLhandleARB programId)
{
- GLhandleARB name_loc;
+ GLint name_loc;
int i;
char sampler_name[20];
static void shader_glsl_load_vsamplers(const WineD3D_GL_Info *gl_info, DWORD *tex_unit_map, GLhandleARB programId)
{
- GLhandleARB name_loc;
+ GLint name_loc;
char sampler_name[20];
int i;
}
static inline void walk_constant_heap(const WineD3D_GL_Info *gl_info, const float *constants,
- const GLhandleARB *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version)
+ const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version)
{
int stack_idx = 0;
unsigned int heap_idx = 1;
}
static inline void walk_constant_heap_clamped(const WineD3D_GL_Info *gl_info, const float *constants,
- const GLhandleARB *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version)
+ const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version)
{
int stack_idx = 0;
unsigned int heap_idx = 1;
/* Loads floating point constants (aka uniforms) into the currently set GLSL program. */
static void shader_glsl_load_constantsF(IWineD3DBaseShaderImpl *This, const WineD3D_GL_Info *gl_info,
- const float *constants, const GLhandleARB *constant_locations, const struct constant_heap *heap,
+ const float *constants, const GLint *constant_locations, const struct constant_heap *heap,
unsigned char *stack, UINT version)
{
const local_constant *lconst;
/* Immediate constants are clamped to [-1;1] at shader creation time if needed */
LIST_FOR_EACH_ENTRY(lconst, &This->baseShader.constantsF, local_constant, entry)
{
- GLhandleARB location = constant_locations[lconst->idx];
+ GLint location = constant_locations[lconst->idx];
/* We found this uniform name in the program - go ahead and send the data */
if (location != -1) GL_EXTCALL(glUniform4fvARB(location, 1, (const GLfloat *)lconst->value));
}
/* Loads integer constants (aka uniforms) into the currently set GLSL program. */
static void shader_glsl_load_constantsI(IWineD3DBaseShaderImpl *This, const WineD3D_GL_Info *gl_info,
- const GLhandleARB locations[MAX_CONST_I], const int *constants, WORD constants_set)
+ const GLint locations[MAX_CONST_I], const int *constants, WORD constants_set)
{
unsigned int i;
struct list* ptr;
static void shader_glsl_load_constantsB(IWineD3DBaseShaderImpl *This, const WineD3D_GL_Info *gl_info,
GLhandleARB programId, const BOOL *constants, WORD constants_set)
{
- GLhandleARB tmp_loc;
+ GLint tmp_loc;
unsigned int i;
char tmp_name[8];
char is_pshader = shader_is_pshader_version(This->baseShader.reg_maps.shader_version);
if (in_idx >= (in_count + 2)) {
FIXME("More input varyings declared than supported, expect issues\n");
continue;
- } else if(map[i] == -1) {
+ }
+ else if (map[i] == ~0U)
+ {
/* Declared, but not read register */
continue;
}
GLhandleARB programId, char prefix)
{
const local_constant *lconst;
- GLuint tmp_loc;
+ GLint tmp_loc;
const float *value;
char glsl_name[8];
struct glsl_shader_prog_link *entry = NULL;
GLhandleARB programId = 0;
GLhandleARB reorder_shader_id = 0;
- int i;
+ unsigned int i;
char glsl_name[8];
GLhandleARB vshader_id, pshader_id;
struct ps_compile_args ps_compile_args;
/* Attach GLSL vshader */
if (vshader_id) {
- int max_attribs = 16; /* TODO: Will this always be the case? It is at the moment... */
+ const unsigned int max_attribs = 16; /* TODO: Will this always be the case? It is at the moment... */
char tmp_name[10];
reorder_shader_id = generate_param_reorder_function(vshader, pshader, gl_info);
GLhandleARB *blt_program = &priv->depth_blt_program[tex_type];
if (!*blt_program) {
- GLhandleARB loc;
+ GLint loc;
*blt_program = create_glsl_blt_shader(gl_info, tex_type);
loc = GL_EXTCALL(glGetUniformLocationARB(*blt_program, "sampler"));
GL_EXTCALL(glUseProgramObjectARB(*blt_program));
for (i = 0; i < MAX_REG_INPUT; ++i)
{
if (This->input_reg_used[i]) This->input_reg_map[i] = This->declared_in_count++;
- else This->input_reg_map[i] = -1;
+ else This->input_reg_map[i] = ~0U;
}
}
}
static void unloadTexCoords(IWineD3DStateBlockImpl *stateblock) {
- int texture_idx;
+ unsigned int texture_idx;
for (texture_idx = 0; texture_idx < GL_LIMITS(texture_stages); ++texture_idx) {
GL_EXTCALL(glClientActiveTextureARB(GL_TEXTURE0_ARB + texture_idx));
GL_EXTCALL(glVertexBlendARB(stateblock->renderState[WINED3DRS_VERTEXBLEND] + 1));
if(!stateblock->wineD3DDevice->vertexBlendUsed) {
- int i;
+ unsigned int i;
for(i = 1; i < GL_LIMITS(blends); i++) {
if(!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(i)))) {
transform_worldex(STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(i)), stateblock, context);
}
} else {
if(!context->last_was_vshader) {
- int i;
+ unsigned int i;
static BOOL warned = FALSE;
/* Disable all clip planes to get defined results on all drivers. See comment in the
* state_clipping state handler
******************************************* */
static void WINAPI IWineD3DTextureImpl_Destroy(IWineD3DTexture *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroySurface) {
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
- int i;
+ unsigned int i;
TRACE("(%p) : Cleaning up\n",This);
for (i = 0; i < This->baseTexture.levels; i++) {
const WINED3DVERTEXELEMENT *elements, UINT element_count) {
IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface;
HRESULT hr = WINED3D_OK;
- int i;
+ unsigned int i;
char isPreLoaded[MAX_STREAMS];
TRACE("(%p) : d3d version %d\n", This, ((IWineD3DImpl *)This->wineD3DDevice->wineD3D)->dxVersion);
IWineD3DVertexShaderImpl *This =(IWineD3DVertexShaderImpl *)iface;
IWineD3DVertexDeclarationImpl* vdecl = (IWineD3DVertexDeclarationImpl*)vertex_declaration;
- int i;
+ unsigned int i;
for (i = 0; i < vdecl->declarationWNumElements - 1; ++i) {
const WINED3DVERTEXELEMENT *element = vdecl->pDeclarationWine + i;
vshader_set_input(This, element->Reg, element->Usage, element->UsageIndex);
void volumetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRGB srgb) {
/* Overrider the IWineD3DResource Preload method */
- int i;
+ unsigned int i;
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
BOOL srgb_mode = This->baseTexture.is_srgb;
******************************************* */
static void WINAPI IWineD3DVolumeTextureImpl_Destroy(IWineD3DVolumeTexture *iface, D3DCB_DESTROYVOLUMEFN D3DCB_DestroyVolume) {
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
- int i;
+ unsigned int i;
TRACE("(%p) : Cleaning up\n",This);
for (i = 0; i < This->baseTexture.levels; i++) {
if (This->volumes[i] != NULL) {
/* Some information about the shader behavior */
struct stb_const_desc bumpenvmatconst[MAX_TEXTURES];
- char numbumpenvmatconsts;
+ unsigned char numbumpenvmatconsts;
struct stb_const_desc luminanceconst[MAX_TEXTURES];
char vpos_uniform;