Stefan Dösinger : wined3d: Add casts for int to float conversions.
Alexandre Julliard
julliard at winehq.org
Thu Jul 29 12:08:41 CDT 2010
Module: wine
Branch: master
Commit: cc8a45321fb97994820dfdc52d7b845e4d4e1ca4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=cc8a45321fb97994820dfdc52d7b845e4d4e1ca4
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Wed Jul 28 15:39:03 2010 +0200
wined3d: Add casts for int to float conversions.
---
dlls/wined3d/arb_program_shader.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 4482d53..0617fe3 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -582,9 +582,9 @@ static inline void shader_arb_ps_local_constants(IWineD3DDeviceImpl* deviceImpl)
if(gl_shader->int_consts[i] != WINED3D_CONST_NUM_UNUSED)
{
float val[4];
- val[0] = stateBlock->pixelShaderConstantI[4 * i];
- val[1] = stateBlock->pixelShaderConstantI[4 * i + 1];
- val[2] = stateBlock->pixelShaderConstantI[4 * i + 2];
+ val[0] = (float) stateBlock->pixelShaderConstantI[4 * i];
+ val[1] = (float) stateBlock->pixelShaderConstantI[4 * i + 1];
+ val[2] = (float) stateBlock->pixelShaderConstantI[4 * i + 2];
val[3] = -1.0f;
GL_EXTCALL(glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, gl_shader->int_consts[i], val));
@@ -614,9 +614,9 @@ static inline void shader_arb_vs_local_constants(IWineD3DDeviceImpl* deviceImpl)
if(gl_shader->int_consts[i] != WINED3D_CONST_NUM_UNUSED)
{
float val[4];
- val[0] = stateBlock->vertexShaderConstantI[4 * i];
- val[1] = stateBlock->vertexShaderConstantI[4 * i + 1];
- val[2] = stateBlock->vertexShaderConstantI[4 * i + 2];
+ val[0] = (float) stateBlock->vertexShaderConstantI[4 * i];
+ val[1] = (float) stateBlock->vertexShaderConstantI[4 * i + 1];
+ val[2] = (float) stateBlock->vertexShaderConstantI[4 * i + 2];
val[3] = -1.0f;
GL_EXTCALL(glProgramLocalParameter4fvARB(GL_VERTEX_PROGRAM_ARB, gl_shader->int_consts[i], val));
@@ -1058,7 +1058,7 @@ static void shader_arb_get_register_name(const struct wined3d_shader_instruction
else if (reg->idx >= rel_offset)
sprintf(register_name, "C[%s + %u]", rel_reg, reg->idx - rel_offset);
else
- sprintf(register_name, "C[%s - %u]", rel_reg, -reg->idx + rel_offset);
+ sprintf(register_name, "C[%s - %u]", rel_reg, rel_offset - reg->idx);
}
else
{
@@ -6981,7 +6981,7 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surfac
GLenum shader;
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
- float size[4] = {surface->pow2Width, surface->pow2Height, 1, 1};
+ float size[4] = {(float) surface->pow2Width, (float) surface->pow2Height, 1.0f, 1.0f};
struct arbfp_blit_priv *priv = device->blit_priv;
enum complex_fixup fixup;
GLenum textype = surface->texture_target;
More information about the wine-cvs
mailing list