@@ -132,6 +134,7 @@ struct shader_runner_caps bool float64; bool int64; bool rov; + bool rgba_float_4xmsaa; }; static inline unsigned int shader_runner_caps_get_feature_flags(const struct shader_runner_caps *caps)
I suppose that's fine for a single format and sample count combination, but I'm not sure that can scale. Could we just allow runner->ops->create_resource() to optionally fail, and then skip any tests referencing such a failed resource?
+ if (params->sample_count) + { + if (params->level_count > 1) + fatal_error("Multisample resource has multiple levels.\n"); + resource->resource = create_default_texture_(__LINE__, device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, + params->width, params->height, 1, 1, params->sample_count, params->format, + D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, D3D12_RESOURCE_STATE_RENDER_TARGET); + } + else + { + resource->resource = create_default_texture2d(device, params->width, params->height, 1, params->level_count, + params->format, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, D3D12_RESOURCE_STATE_RENDER_TARGET); + }
Right, but create_default_texture2d() can be trivially replaced with create_default_texture_() as well, and then the two branches can be merged.
+ if ((glGetInternalformativ = (void *)eglGetProcAddress("glGetInternalformativ"))) + { + glGetInternalformativ(GL_TEXTURE_2D_MULTISAMPLE, GL_RGBA32F, GL_SAMPLES, 1, &tex_max_sample_count); + glGetInternalformativ(GL_RENDERBUFFER, GL_RGBA32F, GL_SAMPLES, 1, &rt_max_sample_count); + runner->caps.rgba_float_4xmsaa = tex_max_sample_count >= 4 && rt_max_sample_count >= 4; + }
You don't need to use eglGetProcAddress() for glGetInternalformativ(), libOpenGL.so exports all the OpenGL 4.5 core and compat entry points, and glGetInternalformativ() is GL 4.2. You probably do need to check that GL_ARB_internalformat_query is supported. We don't use renderbuffers.