Commit ede01abe authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Support GL_ATI_envmap_bumpmap for D3DFMT_V8U8.

parent e213d7ef
...@@ -715,11 +715,12 @@ void pshader_hw_texbem(SHADER_OPCODE_ARG* arg) { ...@@ -715,11 +715,12 @@ void pshader_hw_texbem(SHADER_OPCODE_ARG* arg) {
* So the surface loading code converts the -128 ... 127 signed integers to * So the surface loading code converts the -128 ... 127 signed integers to
* 0 ... 255 unsigned ones. The following line undoes that. * 0 ... 255 unsigned ones. The following line undoes that.
* *
* TODO: GL_ATI_envmap_bumpmap provides pixel formats * TODO: GL_ATI_envmap_bumpmap supports D3DFMT_DU8DV8 only. If conversion for other formats
* suitable for loading the Direct3D perturbation data. If it is used, do * is implemented check the texture format.
* not correct the signedness *
* TODO: Move that to the common sampling function
*/ */
if(!GL_SUPPORT(NV_TEXTURE_SHADER3)) if(!GL_SUPPORT(NV_TEXTURE_SHADER3) && !GL_SUPPORT(ATI_ENVMAP_BUMPMAP))
shader_addline(buffer, "MAD T%u, T%u, coefmul.x, -one;\n", src, src); shader_addline(buffer, "MAD T%u, T%u, coefmul.x, -one;\n", src, src);
shader_addline(buffer, "SWZ TMP2, bumpenvmat, x, z, 0, 0;\n"); shader_addline(buffer, "SWZ TMP2, bumpenvmat, x, z, 0, 0;\n");
......
...@@ -1464,11 +1464,14 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO ...@@ -1464,11 +1464,14 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO
break; break;
case WINED3DFMT_V8U8: case WINED3DFMT_V8U8:
/* TODO: GL_ATI_envmap_bumpmap provides suitable formats.
* use it instead of converting
* Remember to adjust the texbem instruction in the shader
*/
if(GL_SUPPORT(NV_TEXTURE_SHADER3)) break; if(GL_SUPPORT(NV_TEXTURE_SHADER3)) break;
else if(GL_SUPPORT(ATI_ENVMAP_BUMPMAP)) {
*format = GL_DUDV_ATI;
*internal = GL_DU8DV8_ATI;
*type = GL_BYTE;
/* No conversion - Just change the gl type */
break;
}
*convert = CONVERT_V8U8; *convert = CONVERT_V8U8;
*format = GL_BGR; *format = GL_BGR;
*internal = GL_RGB8; *internal = GL_RGB8;
...@@ -1483,6 +1486,7 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO ...@@ -1483,6 +1486,7 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO
*internal = GL_RGBA8; *internal = GL_RGBA8;
*type = GL_BYTE; *type = GL_BYTE;
*target_bpp = 4; *target_bpp = 4;
/* Not supported by GL_ATI_envmap_bumpmap */
break; break;
case WINED3DFMT_Q8W8V8U8: case WINED3DFMT_Q8W8V8U8:
...@@ -1492,6 +1496,7 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO ...@@ -1492,6 +1496,7 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO
*internal = GL_RGBA8; *internal = GL_RGBA8;
*type = GL_BYTE; *type = GL_BYTE;
*target_bpp = 4; *target_bpp = 4;
/* Not supported by GL_ATI_envmap_bumpmap */
break; break;
case WINED3DFMT_V16U16: case WINED3DFMT_V16U16:
...@@ -1501,6 +1506,9 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO ...@@ -1501,6 +1506,9 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO
*internal = GL_COLOR_INDEX; *internal = GL_COLOR_INDEX;
*type = GL_SHORT; *type = GL_SHORT;
*target_bpp = 4; *target_bpp = 4;
/* What should I do here about GL_ATI_envmap_bumpmap?
* Convert it or allow data loss by loading it into a 8 bit / channel texture?
*/
break; break;
default: default:
......
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