#include "util/u_atomic.h"
#include "util/timespec.h"
#include "util/ptralloc.h"
+#include "nir.h"
+#include "nir_builder.h"
#if defined(VK_USE_PLATFORM_WAYLAND_KHR) || \
defined(VK_USE_PLATFORM_WIN32_KHR) || \
return result;
}
+ nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_FRAGMENT, NULL, "dummy_frag");
+ struct pipe_shader_state shstate = {0};
+ shstate.type = PIPE_SHADER_IR_NIR;
+ shstate.ir.nir = b.shader;
+ device->noop_fs = device->queue.ctx->create_fs_state(device->queue.ctx, &shstate);
+
*pDevice = lvp_device_to_handle(device);
return VK_SUCCESS;
{
LVP_FROM_HANDLE(lvp_device, device, _device);
+ device->queue.ctx->delete_fs_state(device->queue.ctx, device->noop_fs);
+
if (device->queue.last_fence)
device->pscreen->fence_reference(device->pscreen, &device->queue.last_fence, NULL);
lvp_queue_finish(&device->queue);
{
if (pipeline->shader_cso[PIPE_SHADER_VERTEX])
device->queue.ctx->delete_vs_state(device->queue.ctx, pipeline->shader_cso[PIPE_SHADER_VERTEX]);
- if (pipeline->shader_cso[PIPE_SHADER_FRAGMENT])
+ if (pipeline->shader_cso[PIPE_SHADER_FRAGMENT] && !pipeline->noop_fs)
device->queue.ctx->delete_fs_state(device->queue.ctx, pipeline->shader_cso[PIPE_SHADER_FRAGMENT]);
if (pipeline->shader_cso[PIPE_SHADER_GEOMETRY])
device->queue.ctx->delete_gs_state(device->queue.ctx, pipeline->shader_cso[PIPE_SHADER_GEOMETRY]);
}
if (has_fragment_shader == false) {
- /* create a dummy fragment shader for this pipeline. */
- nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_FRAGMENT, NULL,
- "dummy_frag");
-
- pipeline->pipeline_nir[MESA_SHADER_FRAGMENT] = b.shader;
- struct pipe_shader_state shstate = {0};
- shstate.type = PIPE_SHADER_IR_NIR;
- shstate.ir.nir = nir_shader_clone(NULL, pipeline->pipeline_nir[MESA_SHADER_FRAGMENT]);
- pipeline->shader_cso[PIPE_SHADER_FRAGMENT] = device->queue.ctx->create_fs_state(device->queue.ctx, &shstate);
+ pipeline->noop_fs = true;
+ pipeline->shader_cso[PIPE_SHADER_FRAGMENT] = device->noop_fs;
}
}
return VK_SUCCESS;
struct lvp_instance * instance;
struct lvp_physical_device *physical_device;
struct pipe_screen *pscreen;
+ void *noop_fs;
bool poison_mem;
};
bool line_rectangular;
bool gs_output_lines;
bool library;
+ bool noop_fs;
};
struct lvp_event {