unsigned sample_count,
unsigned usage)
{
+ struct vc4_screen *screen = vc4_screen(pscreen);
unsigned retval = 0;
if (sample_count > 1 && sample_count != VC4_MAX_SAMPLES)
if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
vc4_tex_format_supported(format) &&
- format != PIPE_FORMAT_ETC1_RGB8) {
+ (format != PIPE_FORMAT_ETC1_RGB8 || screen->has_etc1)) {
retval |= PIPE_BIND_SAMPLER_VIEW;
}
}
static bool
-vc4_supports_branches(struct vc4_screen *screen)
+vc4_has_feature(struct vc4_screen *screen, uint32_t feature)
{
struct drm_vc4_get_param p = {
- .param = DRM_VC4_PARAM_SUPPORTS_BRANCHES,
+ .param = feature,
};
int ret = vc4_ioctl(screen->fd, DRM_IOCTL_VC4_GET_PARAM, &p);
pipe_mutex_init(screen->bo_handles_mutex);
screen->bo_handles = util_hash_table_create(handle_hash, handle_compare);
- if (vc4_supports_branches(screen))
- screen->has_control_flow = true;
+ screen->has_control_flow =
+ vc4_has_feature(screen, DRM_VC4_PARAM_SUPPORTS_BRANCHES);
+ screen->has_etc1 =
+ vc4_has_feature(screen, DRM_VC4_PARAM_SUPPORTS_ETC1);
if (!vc4_get_chip_info(screen))
goto fail;
#include "util/list.h"
#include "util/slab.h"
+#ifndef DRM_VC4_PARAM_SUPPORTS_ETC1
+#define DRM_VC4_PARAM_SUPPORTS_ETC1 4
+#endif
+
struct vc4_bo;
#define VC4_DEBUG_CL 0x0001
uint32_t bo_size;
uint32_t bo_count;
bool has_control_flow;
+ bool has_etc1;
struct vc4_simulator_file *sim_file;
};