mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/hlsl: Add SM5.1 shader target strings.
This commit is contained in:
parent
843968cd63
commit
c5f507ac38
Notes:
Alexandre Julliard
2024-04-09 15:45:34 -05:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/757
@ -3289,7 +3289,9 @@ const struct hlsl_profile_info *hlsl_get_target_info(const char *target)
|
|||||||
{"cs_4_0", VKD3D_SHADER_TYPE_COMPUTE, 4, 0, 0, 0, false},
|
{"cs_4_0", VKD3D_SHADER_TYPE_COMPUTE, 4, 0, 0, 0, false},
|
||||||
{"cs_4_1", VKD3D_SHADER_TYPE_COMPUTE, 4, 1, 0, 0, false},
|
{"cs_4_1", VKD3D_SHADER_TYPE_COMPUTE, 4, 1, 0, 0, false},
|
||||||
{"cs_5_0", VKD3D_SHADER_TYPE_COMPUTE, 5, 0, 0, 0, false},
|
{"cs_5_0", VKD3D_SHADER_TYPE_COMPUTE, 5, 0, 0, 0, false},
|
||||||
|
{"cs_5_1", VKD3D_SHADER_TYPE_COMPUTE, 5, 1, 0, 0, false},
|
||||||
{"ds_5_0", VKD3D_SHADER_TYPE_DOMAIN, 5, 0, 0, 0, false},
|
{"ds_5_0", VKD3D_SHADER_TYPE_DOMAIN, 5, 0, 0, 0, false},
|
||||||
|
{"ds_5_1", VKD3D_SHADER_TYPE_DOMAIN, 5, 1, 0, 0, false},
|
||||||
{"fx_2_0", VKD3D_SHADER_TYPE_EFFECT, 2, 0, 0, 0, false},
|
{"fx_2_0", VKD3D_SHADER_TYPE_EFFECT, 2, 0, 0, 0, false},
|
||||||
{"fx_4_0", VKD3D_SHADER_TYPE_EFFECT, 4, 0, 0, 0, false},
|
{"fx_4_0", VKD3D_SHADER_TYPE_EFFECT, 4, 0, 0, 0, false},
|
||||||
{"fx_4_1", VKD3D_SHADER_TYPE_EFFECT, 4, 1, 0, 0, false},
|
{"fx_4_1", VKD3D_SHADER_TYPE_EFFECT, 4, 1, 0, 0, false},
|
||||||
@ -3297,7 +3299,9 @@ const struct hlsl_profile_info *hlsl_get_target_info(const char *target)
|
|||||||
{"gs_4_0", VKD3D_SHADER_TYPE_GEOMETRY, 4, 0, 0, 0, false},
|
{"gs_4_0", VKD3D_SHADER_TYPE_GEOMETRY, 4, 0, 0, 0, false},
|
||||||
{"gs_4_1", VKD3D_SHADER_TYPE_GEOMETRY, 4, 1, 0, 0, false},
|
{"gs_4_1", VKD3D_SHADER_TYPE_GEOMETRY, 4, 1, 0, 0, false},
|
||||||
{"gs_5_0", VKD3D_SHADER_TYPE_GEOMETRY, 5, 0, 0, 0, false},
|
{"gs_5_0", VKD3D_SHADER_TYPE_GEOMETRY, 5, 0, 0, 0, false},
|
||||||
|
{"gs_5_1", VKD3D_SHADER_TYPE_GEOMETRY, 5, 1, 0, 0, false},
|
||||||
{"hs_5_0", VKD3D_SHADER_TYPE_HULL, 5, 0, 0, 0, false},
|
{"hs_5_0", VKD3D_SHADER_TYPE_HULL, 5, 0, 0, 0, false},
|
||||||
|
{"hs_5_1", VKD3D_SHADER_TYPE_HULL, 5, 1, 0, 0, false},
|
||||||
{"ps.1.0", VKD3D_SHADER_TYPE_PIXEL, 1, 0, 0, 0, false},
|
{"ps.1.0", VKD3D_SHADER_TYPE_PIXEL, 1, 0, 0, 0, false},
|
||||||
{"ps.1.1", VKD3D_SHADER_TYPE_PIXEL, 1, 1, 0, 0, false},
|
{"ps.1.1", VKD3D_SHADER_TYPE_PIXEL, 1, 1, 0, 0, false},
|
||||||
{"ps.1.2", VKD3D_SHADER_TYPE_PIXEL, 1, 2, 0, 0, false},
|
{"ps.1.2", VKD3D_SHADER_TYPE_PIXEL, 1, 2, 0, 0, false},
|
||||||
@ -3325,6 +3329,7 @@ const struct hlsl_profile_info *hlsl_get_target_info(const char *target)
|
|||||||
{"ps_4_0_level_9_3", VKD3D_SHADER_TYPE_PIXEL, 4, 0, 9, 3, false},
|
{"ps_4_0_level_9_3", VKD3D_SHADER_TYPE_PIXEL, 4, 0, 9, 3, false},
|
||||||
{"ps_4_1", VKD3D_SHADER_TYPE_PIXEL, 4, 1, 0, 0, false},
|
{"ps_4_1", VKD3D_SHADER_TYPE_PIXEL, 4, 1, 0, 0, false},
|
||||||
{"ps_5_0", VKD3D_SHADER_TYPE_PIXEL, 5, 0, 0, 0, false},
|
{"ps_5_0", VKD3D_SHADER_TYPE_PIXEL, 5, 0, 0, 0, false},
|
||||||
|
{"ps_5_1", VKD3D_SHADER_TYPE_PIXEL, 5, 1, 0, 0, false},
|
||||||
{"tx_1_0", VKD3D_SHADER_TYPE_TEXTURE, 1, 0, 0, 0, false},
|
{"tx_1_0", VKD3D_SHADER_TYPE_TEXTURE, 1, 0, 0, 0, false},
|
||||||
{"vs.1.0", VKD3D_SHADER_TYPE_VERTEX, 1, 0, 0, 0, false},
|
{"vs.1.0", VKD3D_SHADER_TYPE_VERTEX, 1, 0, 0, 0, false},
|
||||||
{"vs.1.1", VKD3D_SHADER_TYPE_VERTEX, 1, 1, 0, 0, false},
|
{"vs.1.1", VKD3D_SHADER_TYPE_VERTEX, 1, 1, 0, 0, false},
|
||||||
@ -3346,6 +3351,7 @@ const struct hlsl_profile_info *hlsl_get_target_info(const char *target)
|
|||||||
{"vs_4_0_level_9_3", VKD3D_SHADER_TYPE_VERTEX, 4, 0, 9, 3, false},
|
{"vs_4_0_level_9_3", VKD3D_SHADER_TYPE_VERTEX, 4, 0, 9, 3, false},
|
||||||
{"vs_4_1", VKD3D_SHADER_TYPE_VERTEX, 4, 1, 0, 0, false},
|
{"vs_4_1", VKD3D_SHADER_TYPE_VERTEX, 4, 1, 0, 0, false},
|
||||||
{"vs_5_0", VKD3D_SHADER_TYPE_VERTEX, 5, 0, 0, 0, false},
|
{"vs_5_0", VKD3D_SHADER_TYPE_VERTEX, 5, 0, 0, 0, false},
|
||||||
|
{"vs_5_1", VKD3D_SHADER_TYPE_VERTEX, 5, 1, 0, 0, false},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(profiles); ++i)
|
for (i = 0; i < ARRAY_SIZE(profiles); ++i)
|
||||||
|
@ -3385,10 +3385,10 @@ static void write_sm4_rdef(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc)
|
|||||||
|
|
||||||
if (profile->major_version >= 5)
|
if (profile->major_version >= 5)
|
||||||
{
|
{
|
||||||
put_u32(&buffer, TAG_RD11);
|
put_u32(&buffer, hlsl_version_ge(ctx, 5, 1) ? TAG_RD11_REVERSE : TAG_RD11);
|
||||||
put_u32(&buffer, 15 * sizeof(uint32_t)); /* size of RDEF header including this header */
|
put_u32(&buffer, 15 * sizeof(uint32_t)); /* size of RDEF header including this header */
|
||||||
put_u32(&buffer, 6 * sizeof(uint32_t)); /* size of buffer desc */
|
put_u32(&buffer, 6 * sizeof(uint32_t)); /* size of buffer desc */
|
||||||
put_u32(&buffer, 8 * sizeof(uint32_t)); /* size of binding desc */
|
put_u32(&buffer, (hlsl_version_ge(ctx, 5, 1) ? 10 : 8) * sizeof(uint32_t)); /* size of binding desc */
|
||||||
put_u32(&buffer, 10 * sizeof(uint32_t)); /* size of variable desc */
|
put_u32(&buffer, 10 * sizeof(uint32_t)); /* size of variable desc */
|
||||||
put_u32(&buffer, 9 * sizeof(uint32_t)); /* size of type desc */
|
put_u32(&buffer, 9 * sizeof(uint32_t)); /* size of type desc */
|
||||||
put_u32(&buffer, 3 * sizeof(uint32_t)); /* size of member desc */
|
put_u32(&buffer, 3 * sizeof(uint32_t)); /* size of member desc */
|
||||||
@ -3405,6 +3405,9 @@ static void write_sm4_rdef(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc)
|
|||||||
const struct extern_resource *resource = &extern_resources[i];
|
const struct extern_resource *resource = &extern_resources[i];
|
||||||
uint32_t flags = 0;
|
uint32_t flags = 0;
|
||||||
|
|
||||||
|
if (hlsl_version_ge(ctx, 5, 1))
|
||||||
|
hlsl_fixme(ctx, &resource->var->loc, "Shader model 5.1 resource reflection.");
|
||||||
|
|
||||||
if (resource->is_user_packed)
|
if (resource->is_user_packed)
|
||||||
flags |= D3D_SIF_USERPACKED;
|
flags |= D3D_SIF_USERPACKED;
|
||||||
|
|
||||||
@ -3437,6 +3440,9 @@ static void write_sm4_rdef(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc)
|
|||||||
if (!cbuffer->reg.allocated)
|
if (!cbuffer->reg.allocated)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (hlsl_version_ge(ctx, 5, 1))
|
||||||
|
hlsl_fixme(ctx, &cbuffer->loc, "Shader model 5.1 resource reflection.");
|
||||||
|
|
||||||
if (cbuffer->reservation.reg_type)
|
if (cbuffer->reservation.reg_type)
|
||||||
flags |= D3D_SIF_USERPACKED;
|
flags |= D3D_SIF_USERPACKED;
|
||||||
|
|
||||||
@ -5809,13 +5815,21 @@ static void write_sm4_shdr(struct hlsl_ctx *ctx,
|
|||||||
LIST_FOR_EACH_ENTRY(cbuffer, &ctx->buffers, struct hlsl_buffer, entry)
|
LIST_FOR_EACH_ENTRY(cbuffer, &ctx->buffers, struct hlsl_buffer, entry)
|
||||||
{
|
{
|
||||||
if (cbuffer->reg.allocated)
|
if (cbuffer->reg.allocated)
|
||||||
|
{
|
||||||
|
if (hlsl_version_ge(ctx, 5, 1))
|
||||||
|
hlsl_fixme(ctx, &cbuffer->loc, "Shader model 5.1 resource definition.");
|
||||||
|
|
||||||
write_sm4_dcl_constant_buffer(&tpf, cbuffer);
|
write_sm4_dcl_constant_buffer(&tpf, cbuffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < extern_resources_count; ++i)
|
for (i = 0; i < extern_resources_count; ++i)
|
||||||
{
|
{
|
||||||
const struct extern_resource *resource = &extern_resources[i];
|
const struct extern_resource *resource = &extern_resources[i];
|
||||||
|
|
||||||
|
if (hlsl_version_ge(ctx, 5, 1))
|
||||||
|
hlsl_fixme(ctx, &resource->var->loc, "Shader model 5.1 resource declaration.");
|
||||||
|
|
||||||
if (resource->regset == HLSL_REGSET_SAMPLERS)
|
if (resource->regset == HLSL_REGSET_SAMPLERS)
|
||||||
write_sm4_dcl_samplers(&tpf, resource);
|
write_sm4_dcl_samplers(&tpf, resource);
|
||||||
else if (resource->regset == HLSL_REGSET_TEXTURES)
|
else if (resource->regset == HLSL_REGSET_TEXTURES)
|
||||||
|
Loading…
Reference in New Issue
Block a user