2013/9/24 Rico Schüller kgbricola@web.de:
dlls/d3dx9_36/effect.c | 248 +++++++++++++++++++------------------------------ 1 Datei geändert, 95 Zeilen hinzugefügt(+), 153 Zeilen entfernt(-)
I definitely like the direction this patch takes.
@@ -5068,6 +5009,9 @@ static HRESULT d3dx9_parse_resource(struct d3dx9_base_effect *base, const char *
param = state->parameter;
+ /* + * TODO: Do we need to create the shader/string here or later when we access them? + */
Here it's fine AFAICS. What are the other options you are thinking about? Something like creating the shaders at the first Begin / BeginPass call?
On 25.09.2013 14:02, Matteo Bruni wrote:
2013/9/24 Rico Schüller kgbricola@web.de:
dlls/d3dx9_36/effect.c | 248 +++++++++++++++++++------------------------------ 1 Datei geändert, 95 Zeilen hinzugefügt(+), 153 Zeilen entfernt(-)
I definitely like the direction this patch takes.
@@ -5068,6 +5009,9 @@ static HRESULT d3dx9_parse_resource(struct d3dx9_base_effect *base, const char *
param = state->parameter;
- /*
* TODO: Do we need to create the shader/string here or later
when we access them?
*/
Here it's fine AFAICS. What are the other options you are thinking about? Something like creating the shaders at the first Begin / BeginPass call?
Yes. Depending on the use case we may create it on the Begin/BeginPass when the shader is needed the first time (this may also be something like isParameterUsed or GetVertexShader). We don't need the shaders for cases like GetPassDesc, where only the shader blob is used and in cases the shaders are not used at all (e.g. if some technique is for shader version 2 and one for shader version 3). That's why I think it may be an option to defer the shader creation. Imho this needs some tests first before an useful decision could be made. The comment was added, because I removed the previously available shader creation (which had some flaws).
Cheers Rico
On 25 September 2013 15:32, Rico Schüller kgbricola@web.de wrote:
Yes. Depending on the use case we may create it on the Begin/BeginPass when the shader is needed the first time (this may also be something like isParameterUsed or GetVertexShader). We don't need the shaders for cases like GetPassDesc, where only the shader blob is used and in cases the shaders are not used at all (e.g. if some technique is for shader version 2 and one for shader version 3). That's why I think it may be an option to defer the shader creation. Imho this needs some tests first before an useful decision could be made. The comment was added, because I removed the previously available shader creation (which had some flaws).
I think you almost always want to create shaders as early as possible. Shader compilation time and associated stuttering is a real issue. We could do better on that front in wined3d as well, and in some cases in the driver, but if the application doesn't pass us the shader until it's first used there's nothing we can do.