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

wined3d: Merge drawStridedSlow() and drawStridedSlowVs().

parent eeac4013
......@@ -432,8 +432,9 @@ static inline void fixup_d3dcolor(DWORD *dst_color)
{
DWORD src_color = *dst_color;
/* Color conversion like in drawStridedSlow. watch out for little endianity
* If we want that stuff to work on big endian machines too we have to consider more things
/* Color conversion like in draw_primitive_immediate_mode(). Watch out for
* endianness. If we want this to work on big-endian machines as well we
* have to consider more things.
*
* 0xff000000: Alpha mask
* 0x00ff0000: Blue mask
......@@ -1318,15 +1319,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER;
}
/* Observations show that draw_primitive_immediate_mode() is faster on
* dynamic vertex buffers than converting + drawStridedFast().
* (Half-Life 2 and others.) */
dynamic_buffer_ok = gl_info->supported[APPLE_FLUSH_BUFFER_RANGE] || gl_info->supported[ARB_MAP_BUFFER_RANGE];
/* Observations show that drawStridedSlow is faster on dynamic VBs than converting +
* drawStridedFast (half-life 2 and others).
*
* Basically converting the vertices in the buffer is quite expensive, and observations
* show that drawStridedSlow is faster than converting + uploading + drawStridedFast.
* Therefore do not create a VBO for WINED3DUSAGE_DYNAMIC buffers.
*/
if (!gl_info->supported[ARB_VERTEX_BUFFER_OBJECT])
{
TRACE("Not creating a vbo because GL_ARB_vertex_buffer is not supported\n");
......
......@@ -3101,7 +3101,8 @@ static void context_update_stream_info(struct wined3d_context *context, const st
* sources. In most sane cases the pointer - offset will still be > 0,
* otherwise it will wrap around to some big value. Hope that with the
* indices the driver wraps it back internally. If not,
* drawStridedSlow is needed, including a vertex buffer path. */
* draw_primitive_immediate_mode() is needed, including a vertex buffer
* path. */
if (state->load_base_vertex_index < 0)
{
WARN_(d3d_perf)("load_base_vertex_index is < 0 (%d), not using VBOs.\n",
......@@ -3132,7 +3133,7 @@ static void context_update_stream_info(struct wined3d_context *context, const st
{
if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo)
{
TRACE("Using drawStridedSlow with vertex shaders for FLOAT16 conversion.\n");
TRACE("Using immediate mode draw with vertex shaders for FLOAT16 conversion.\n");
context->use_immediate_mode_draw = TRUE;
}
else
......
......@@ -5608,9 +5608,9 @@ static void WINE_GLAPI invalid_generic_attrib_func(GLuint idx, const void *data)
DebugBreak();
}
/* Helper functions for providing vertex data to opengl. The arrays are initialized based on
* the extension detection and are used in drawStridedSlow
*/
/* Helper functions for providing vertex data to OpenGL. The arrays are
* initialised based on the extension detection and are used in
* draw_primitive_immediate_mode(). */
static void WINE_GLAPI position_d3dcolor(const void *data)
{
DWORD pos = *((const DWORD *)data);
......
......@@ -1126,10 +1126,10 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st
/* drop through */
case WINED3D_FOG_NONE:
/* Both are none? According to msdn the alpha channel of the specular
* color contains a fog factor. Set it in drawStridedSlow.
* Same happens with Vertexfog on transformed vertices
*/
/* Both are none? According to msdn the alpha channel of
* the specular colour contains a fog factor. Set it in
* draw_primitive_immediate_mode(). Same happens with
* vertex fog on transformed vertices. */
new_source = FOGSOURCE_COORD;
gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_LINEAR);
checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR)");
......@@ -4204,11 +4204,13 @@ static void load_vertex_data(struct wined3d_context *context,
warned = TRUE;
}
}
} else {
/* TODO: support blends in drawStridedSlow
* No need to write a FIXME here, this is done after the general vertex decl decoding
*/
WARN("unsupported blending in openGl\n");
}
else
{
/* TODO: Support vertex blending in immediate mode draws. No need
* to write a FIXME here, this is done after the general vertex
* declaration decoding. */
WARN("Vertex blending not supported.\n");
}
}
else
......
......@@ -4364,18 +4364,20 @@ static void compute_texture_matrix(const struct wined3d_gl_info *gl_info, const
/* case WINED3D_TTFF_COUNT1: Won't ever get here. */
case WINED3D_TTFF_COUNT2:
mat._13 = mat._23 = mat._33 = mat._43 = 0.0f;
/* OpenGL divides the first 3 vertex coord by the 4th by default,
* which is essentially the same as D3DTTFF_PROJECTED. Make sure that
* the 4th coord evaluates to 1.0 to eliminate that.
*
* If the fixed function pipeline is used, the 4th value remains unused,
* so there is no danger in doing this. With vertex shaders we have a
* problem. Should an app hit that problem, the code here would have to
* check for pixel shaders, and the shader has to undo the default gl divide.
*
* A more serious problem occurs if the app passes 4 coordinates in, and the
* 4th is != 1.0(opengl default). This would have to be fixed in drawStridedSlow
* or a replacement shader. */
/* OpenGL divides the first 3 vertex coordinates by the 4th by
* default, which is essentially the same as D3DTTFF_PROJECTED.
* Make sure that the 4th coordinate evaluates to 1.0 to
* eliminate that.
*
* If the fixed function pipeline is used, the 4th value
* remains unused, so there is no danger in doing this. With
* vertex shaders we have a problem. Should an application hit
* that problem, the code here would have to check for pixel
* shaders, and the shader has to undo the default GL divide.
*
* A more serious problem occurs if the application passes 4
* coordinates in, and the 4th is != 1.0 (OpenGL default).
* This would have to be fixed with immediate mode draws. */
default:
mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f;
}
......
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