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) {
* So the surface loading code converts the -128 ... 127 signed integers to
* 0 ... 255 unsigned ones. The following line undoes that.
*
* TODO: GL_ATI_envmap_bumpmap provides pixel formats
* suitable for loading the Direct3D perturbation data. If it is used, do
* not correct the signedness
* TODO: GL_ATI_envmap_bumpmap supports D3DFMT_DU8DV8 only. If conversion for other formats
* is implemented check the texture format.
*
* 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, "SWZ TMP2, bumpenvmat, x, z, 0, 0;\n");
......
......@@ -1464,11 +1464,14 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO
break;
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;
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;
*format = GL_BGR;
*internal = GL_RGB8;
......@@ -1483,6 +1486,7 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO
*internal = GL_RGBA8;
*type = GL_BYTE;
*target_bpp = 4;
/* Not supported by GL_ATI_envmap_bumpmap */
break;
case WINED3DFMT_Q8W8V8U8:
......@@ -1492,6 +1496,7 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO
*internal = GL_RGBA8;
*type = GL_BYTE;
*target_bpp = 4;
/* Not supported by GL_ATI_envmap_bumpmap */
break;
case WINED3DFMT_V16U16:
......@@ -1501,6 +1506,9 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO
*internal = GL_COLOR_INDEX;
*type = GL_SHORT;
*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;
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