On 19/02/07, Stefan Dösinger stefan@codeweavers.com wrote:
- if(Sampler > GL_LIMITS(sampler_stages) || Sampler < 0 || Type >
WINED3D_HIGHEST_SAMPLER_STATE || Type < 0) {
This also checked the sampler state, not just the sampler.
H. Verbeet wrote:
On 19/02/07, Stefan Dösinger stefan@codeweavers.com wrote:
- if(Sampler > GL_LIMITS(sampler_stages) || Sampler < 0 || Type >
WINED3D_HIGHEST_SAMPLER_STATE || Type < 0) {
This also checked the sampler state, not just the sampler.
I would also keep some warning messages in there like WARN so we can easily see if game does something wrong.
Vitaliy
Am Montag 19 Februar 2007 16:19 schrieb H. Verbeet:
On 19/02/07, Stefan Dösinger stefan@codeweavers.com wrote:
- if(Sampler > GL_LIMITS(sampler_stages) || Sampler < 0 || Type >
WINED3D_HIGHEST_SAMPLER_STATE || Type < 0) {
This also checked the sampler state, not just the sampler.
True. I'll extend the test for that and send an updated patch
Am Montag 19 Februar 2007 16:19 schrieb H. Verbeet:
On 19/02/07, Stefan Dösinger stefan@codeweavers.com wrote:
- if(Sampler > GL_LIMITS(sampler_stages) || Sampler < 0 || Type >
WINED3D_HIGHEST_SAMPLER_STATE || Type < 0) {
This also checked the sampler state, not just the sampler.
I added a test to see if the sampler state is checked too, and neither ddraw, d3d8 nor d3d9 did checks on the sampler state / texture stage state. I am not sure if we should commit the test to wine because it could cause invisible memory corruption in the native d3d object which randomly breaks other tests.
DirectX is incorrect here, because I have a test for lights where the light type IS checked.
On 20/02/07, Stefan Dösinger stefan@codeweavers.com wrote:
Am Montag 19 Februar 2007 16:19 schrieb H. Verbeet:
On 19/02/07, Stefan Dösinger stefan@codeweavers.com wrote:
- if(Sampler > GL_LIMITS(sampler_stages) || Sampler < 0 || Type >
WINED3D_HIGHEST_SAMPLER_STATE || Type < 0) {
This also checked the sampler state, not just the sampler.
I added a test to see if the sampler state is checked too, and neither ddraw, d3d8 nor d3d9 did checks on the sampler state / texture stage state. I am not sure if we should commit the test to wine because it could cause invisible memory corruption in the native d3d object which randomly breaks other tests.
DirectX is incorrect here, because I have a test for lights where the light type IS checked.
Would it make sense to catch out of bounds samplers/sampler states, print a ERR/WARN, and just return WINED3D_OK? Memory corruption is pretty nasty, and we'd at least have some log info that an application is doing something it shouldn't be doing.
On 20/02/07, Stefan Dösinger stefan@codeweavers.com wrote:
Am Montag 19 Februar 2007 16:19 schrieb H. Verbeet:
On 19/02/07, Stefan Dösinger stefan@codeweavers.com wrote:
- if(Sampler > GL_LIMITS(sampler_stages) || Sampler < 0 || Type >
WINED3D_HIGHEST_SAMPLER_STATE || Type < 0) {
This also checked the sampler state, not just the sampler.
I added a test to see if the sampler state is checked too, and neither ddraw, d3d8 nor d3d9 did checks on the sampler state / texture stage state. I am not sure if we should commit the test to wine because it could cause invisible memory corruption in the native d3d object which randomly breaks other tests.
DirectX is incorrect here, because I have a test for lights where the light type IS checked.
Would it make sense to catch out of bounds samplers/sampler states, print a ERR/WARN, and just return WINED3D_OK? Memory corruption is pretty nasty, and we'd at least have some log info that an application is doing something it shouldn't be doing.