gskspv: emit Debug information
This commit is contained in:
@@ -426,12 +426,17 @@ gsk_sl_function_declared_write_call_spv (GskSlFunction *function,
|
||||
guint32 *arguments)
|
||||
{
|
||||
GskSlFunctionDeclared *declared = (GskSlFunctionDeclared *) function;
|
||||
guint32 result;
|
||||
|
||||
return gsk_spv_writer_function_call (writer,
|
||||
declared->return_type,
|
||||
gsk_spv_writer_get_id_for_function (writer, function),
|
||||
arguments,
|
||||
declared->n_arguments);
|
||||
result = gsk_spv_writer_function_call (writer,
|
||||
declared->return_type,
|
||||
gsk_spv_writer_get_id_for_function (writer, function),
|
||||
arguments,
|
||||
declared->n_arguments);
|
||||
|
||||
gsk_spv_writer_name (writer, result, declared->name);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static const GskSlFunctionClass GSK_SL_FUNCTION_DECLARED = {
|
||||
|
||||
@@ -1149,12 +1149,19 @@ gsk_sl_type_struct_can_convert (const GskSlType *target,
|
||||
return gsk_sl_type_equal (target, source);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gsk_sl_type_struct_has_name (const GskSlTypeStruct *struc)
|
||||
{
|
||||
return !g_str_has_prefix (struc->name, "struct { ");
|
||||
}
|
||||
|
||||
static guint32
|
||||
gsk_sl_type_struct_write_spv (GskSlType *type,
|
||||
GskSpvWriter *writer)
|
||||
{
|
||||
GskSlTypeStruct *struc = (GskSlTypeStruct *) type;
|
||||
guint32 ids[struc->n_members];
|
||||
guint32 result_id;
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < struc->n_members; i++)
|
||||
@@ -1162,9 +1169,22 @@ gsk_sl_type_struct_write_spv (GskSlType *type,
|
||||
ids[i] = gsk_spv_writer_get_id_for_type (writer, struc->members[i].type);
|
||||
}
|
||||
|
||||
return gsk_spv_writer_type_struct (writer,
|
||||
ids,
|
||||
struc->n_members);
|
||||
result_id = gsk_spv_writer_type_struct (writer,
|
||||
ids,
|
||||
struc->n_members);
|
||||
|
||||
|
||||
if (gsk_sl_type_struct_has_name (struc))
|
||||
gsk_spv_writer_name (writer, result_id, struc->name);
|
||||
else
|
||||
gsk_spv_writer_name (writer, result_id, "");
|
||||
|
||||
for (i = 0; i < struc->n_members; i++)
|
||||
{
|
||||
gsk_spv_writer_member_name (writer, result_id, i, struc->members[i].name);
|
||||
}
|
||||
|
||||
return result_id;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -151,10 +151,12 @@ guint32
|
||||
gsk_sl_variable_write_spv (const GskSlVariable *variable,
|
||||
GskSpvWriter *writer)
|
||||
{
|
||||
guint32 result_id;
|
||||
|
||||
if (gsk_sl_qualifier_get_location (gsk_sl_pointer_type_get_qualifier (variable->type)) == GSK_SL_QUALIFIER_PARAMETER)
|
||||
{
|
||||
return gsk_spv_writer_function_parameter (writer,
|
||||
gsk_sl_pointer_type_get_type (variable->type));
|
||||
result_id = gsk_spv_writer_function_parameter (writer,
|
||||
gsk_sl_pointer_type_get_type (variable->type));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -165,9 +167,14 @@ gsk_sl_variable_write_spv (const GskSlVariable *variable,
|
||||
else
|
||||
value_id = 0;
|
||||
|
||||
return gsk_spv_writer_variable (writer,
|
||||
variable->type,
|
||||
gsk_sl_qualifier_get_storage_class (gsk_sl_pointer_type_get_qualifier (variable->type)),
|
||||
value_id);
|
||||
result_id = gsk_spv_writer_variable (writer,
|
||||
variable->type,
|
||||
gsk_sl_qualifier_get_storage_class (gsk_sl_pointer_type_get_qualifier (variable->type)),
|
||||
value_id);
|
||||
}
|
||||
|
||||
if (variable->name)
|
||||
gsk_spv_writer_name (writer, result_id, variable->name);
|
||||
|
||||
return result_id;
|
||||
}
|
||||
|
||||
@@ -152,6 +152,11 @@ gsk_spv_writer_write_header (GskSpvWriter *writer)
|
||||
gsk_spv_writer_execution_mode (writer,
|
||||
entry_point,
|
||||
GSK_SPV_EXECUTION_MODE_ORIGIN_UPPER_LEFT);
|
||||
gsk_spv_writer_source (writer,
|
||||
GSK_SPV_SOURCE_LANGUAGE_GLSL,
|
||||
440,
|
||||
0,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user