mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-02-26 11:44:52 +01:00
mac disable d3d11
This commit is contained in:
parent
043bc5eba9
commit
edc0cc17a2
3 changed files with 42 additions and 36 deletions
|
@ -12,6 +12,7 @@
|
||||||
///
|
///
|
||||||
/// @return {String} The last error message.
|
/// @return {String} The last error message.
|
||||||
function d3d11_get_error_string() {
|
function d3d11_get_error_string() {
|
||||||
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(GMD3D11_PATH, "d3d11_get_error_string", dll_cdecl, ty_string, 0);
|
static _fn = external_define(GMD3D11_PATH, "d3d11_get_error_string", dll_cdecl, ty_string, 0);
|
||||||
return external_call(_fn);
|
return external_call(_fn);
|
||||||
|
@ -27,6 +28,7 @@ function d3d11_get_error_string() {
|
||||||
///
|
///
|
||||||
/// @return {Real} Returns 1 on success or 0 on fail.
|
/// @return {Real} Returns 1 on success or 0 on fail.
|
||||||
function d3d11_texture_set_stage_vs(_slot, _texture) {
|
function d3d11_texture_set_stage_vs(_slot, _texture) {
|
||||||
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(GMD3D11_PATH, "d3d11_texture_set_stage_vs", dll_cdecl, ty_real, 1, ty_real);
|
static _fn = external_define(GMD3D11_PATH, "d3d11_texture_set_stage_vs", dll_cdecl, ty_real, 1, ty_real);
|
||||||
texture_set_stage(0, _texture);
|
texture_set_stage(0, _texture);
|
||||||
|
@ -62,6 +64,7 @@ function texture_set_stage_vs(_slot, _texture) {
|
||||||
///
|
///
|
||||||
/// @return {Real} Returns 1 on success or 0 on fail.
|
/// @return {Real} Returns 1 on success or 0 on fail.
|
||||||
function d3d11_texture_set_stage_ps(_slot, _texture) {
|
function d3d11_texture_set_stage_ps(_slot, _texture) {
|
||||||
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(GMD3D11_PATH, "d3d11_texture_set_stage_ps", dll_cdecl, ty_real, 1, ty_real);
|
static _fn = external_define(GMD3D11_PATH, "d3d11_texture_set_stage_ps", dll_cdecl, ty_real, 1, ty_real);
|
||||||
texture_set_stage(0, _texture);
|
texture_set_stage(0, _texture);
|
||||||
|
@ -75,6 +78,7 @@ function d3d11_texture_set_stage_ps(_slot, _texture) {
|
||||||
///
|
///
|
||||||
/// @param {Real} _count Number of instances to draw. Use 0 to disable instanced rendering.
|
/// @param {Real} _count Number of instances to draw. Use 0 to disable instanced rendering.
|
||||||
function d3d11_draw_instanced(_count) {
|
function d3d11_draw_instanced(_count) {
|
||||||
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(GMD3D11_PATH, "d3d11_draw_instanced", dll_cdecl, ty_real, 1, ty_real);
|
static _fn = external_define(GMD3D11_PATH, "d3d11_draw_instanced", dll_cdecl, ty_real, 1, ty_real);
|
||||||
return external_call(_fn, _count);
|
return external_call(_fn, _count);
|
||||||
|
@ -89,6 +93,7 @@ function d3d11_draw_instanced(_count) {
|
||||||
/// @param {Pointer.Texture} _texture The texture to use.
|
/// @param {Pointer.Texture} _texture The texture to use.
|
||||||
/// @param {Real} _count The number of instances to draw.
|
/// @param {Real} _count The number of instances to draw.
|
||||||
function vertex_submit_instanced(_vbuff, _prim, _texture, _count) {
|
function vertex_submit_instanced(_vbuff, _prim, _texture, _count) {
|
||||||
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
if (!d3d11_draw_instanced(_count))
|
if (!d3d11_draw_instanced(_count))
|
||||||
return false;
|
return false;
|
||||||
|
@ -98,6 +103,7 @@ function vertex_submit_instanced(_vbuff, _prim, _texture, _count) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function vertex_buffer_load(_filename, _vformat) {
|
function vertex_buffer_load(_filename, _vformat) {
|
||||||
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
var _buffer = buffer_load(_filename);
|
var _buffer = buffer_load(_filename);
|
||||||
var _vbuffer = vertex_create_buffer_from_buffer(_buffer, _vformat);
|
var _vbuffer = vertex_create_buffer_from_buffer(_buffer, _vformat);
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
/// @desc Starts building a constant buffer.
|
/// @desc Starts building a constant buffer.
|
||||||
///
|
///
|
||||||
/// @see d3d11_cbuffer_end
|
/// @see d3d11_cbuffer_end
|
||||||
function d3d11_cbuffer_begin()
|
function d3d11_cbuffer_begin() {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_cbuffer_begin", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_cbuffer_begin", dll_cdecl, ty_real,
|
||||||
|
@ -20,8 +20,8 @@ function d3d11_cbuffer_begin()
|
||||||
///
|
///
|
||||||
/// @see d3d11_cbuffer_exists
|
/// @see d3d11_cbuffer_exists
|
||||||
/// @see d3d11_cbuffer_update
|
/// @see d3d11_cbuffer_update
|
||||||
function d3d11_cbuffer_end()
|
function d3d11_cbuffer_end() {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_cbuffer_end", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_cbuffer_end", dll_cdecl, ty_real,
|
||||||
|
@ -36,8 +36,8 @@ function d3d11_cbuffer_end()
|
||||||
/// @param {Real} _count Number of bools to add into the constant buffer.
|
/// @param {Real} _count Number of bools to add into the constant buffer.
|
||||||
///
|
///
|
||||||
/// @see d3d11_cbuffer_begin
|
/// @see d3d11_cbuffer_begin
|
||||||
function d3d11_cbuffer_add_bool(_count)
|
function d3d11_cbuffer_add_bool(_count) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_cbuffer_add_bool", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_cbuffer_add_bool", dll_cdecl, ty_real,
|
||||||
|
@ -52,8 +52,8 @@ function d3d11_cbuffer_add_bool(_count)
|
||||||
/// @param {Real} _count Number of ints to add into the constant buffer.
|
/// @param {Real} _count Number of ints to add into the constant buffer.
|
||||||
///
|
///
|
||||||
/// @see d3d11_cbuffer_begin
|
/// @see d3d11_cbuffer_begin
|
||||||
function d3d11_cbuffer_add_int(_count)
|
function d3d11_cbuffer_add_int(_count) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_cbuffer_add_int", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_cbuffer_add_int", dll_cdecl, ty_real,
|
||||||
|
@ -68,8 +68,8 @@ function d3d11_cbuffer_add_int(_count)
|
||||||
/// @param {Real} _count Number of uints to add into the constant buffer.
|
/// @param {Real} _count Number of uints to add into the constant buffer.
|
||||||
///
|
///
|
||||||
/// @see d3d11_cbuffer_begin
|
/// @see d3d11_cbuffer_begin
|
||||||
function d3d11_cbuffer_add_uint(_count)
|
function d3d11_cbuffer_add_uint(_count) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_cbuffer_add_uint", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_cbuffer_add_uint", dll_cdecl, ty_real,
|
||||||
|
@ -84,8 +84,8 @@ function d3d11_cbuffer_add_uint(_count)
|
||||||
/// @param {Real} _count Number of floats to add into the constant buffer.
|
/// @param {Real} _count Number of floats to add into the constant buffer.
|
||||||
///
|
///
|
||||||
/// @see d3d11_cbuffer_begin
|
/// @see d3d11_cbuffer_begin
|
||||||
function d3d11_cbuffer_add_float(_count)
|
function d3d11_cbuffer_add_float(_count) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_cbuffer_add_float", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_cbuffer_add_float", dll_cdecl, ty_real,
|
||||||
|
@ -98,8 +98,8 @@ function d3d11_cbuffer_add_float(_count)
|
||||||
/// @desc Retrieves size of a constant buffer in bytes.
|
/// @desc Retrieves size of a constant buffer in bytes.
|
||||||
///
|
///
|
||||||
/// @param {Real} The size of the constant buffer in bytes.
|
/// @param {Real} The size of the constant buffer in bytes.
|
||||||
function d3d11_cbuffer_get_size(_cbuffer)
|
function d3d11_cbuffer_get_size(_cbuffer) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_cbuffer_get_size", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_cbuffer_get_size", dll_cdecl, ty_real,
|
||||||
|
@ -113,8 +113,8 @@ function d3d11_cbuffer_get_size(_cbuffer)
|
||||||
///
|
///
|
||||||
/// @param {Real} _cbuffer The ID of the constant buffer.
|
/// @param {Real} _cbuffer The ID of the constant buffer.
|
||||||
/// @param {Id.Buffer} _buffer A buffer with new data.
|
/// @param {Id.Buffer} _buffer A buffer with new data.
|
||||||
function d3d11_cbuffer_update(_cbuffer, _buffer)
|
function d3d11_cbuffer_update(_cbuffer, _buffer) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_cbuffer_update", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_cbuffer_update", dll_cdecl, ty_real,
|
||||||
|
@ -128,8 +128,8 @@ function d3d11_cbuffer_update(_cbuffer, _buffer)
|
||||||
///
|
///
|
||||||
/// @param {Real} _slot The slot to bind the constant buffer to.
|
/// @param {Real} _slot The slot to bind the constant buffer to.
|
||||||
/// @param {Real} _cbuffer The ID of the constant buffer or -1 to ubind the slot.
|
/// @param {Real} _cbuffer The ID of the constant buffer or -1 to ubind the slot.
|
||||||
function d3d11_shader_set_cbuffer_ps(_slot, _cbuffer)
|
function d3d11_shader_set_cbuffer_ps(_slot, _cbuffer) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_shader_set_cbuffer_ps", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_shader_set_cbuffer_ps", dll_cdecl, ty_real,
|
||||||
|
@ -143,8 +143,8 @@ function d3d11_shader_set_cbuffer_ps(_slot, _cbuffer)
|
||||||
///
|
///
|
||||||
/// @param {Real} _slot The slot to bind the constant buffer to.
|
/// @param {Real} _slot The slot to bind the constant buffer to.
|
||||||
/// @param {Real} _cbuffer The ID of the constant buffer or -1 to ubind the slot.
|
/// @param {Real} _cbuffer The ID of the constant buffer or -1 to ubind the slot.
|
||||||
function d3d11_shader_set_cbuffer_vs(_slot, _cbuffer)
|
function d3d11_shader_set_cbuffer_vs(_slot, _cbuffer) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_shader_set_cbuffer_vs", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_shader_set_cbuffer_vs", dll_cdecl, ty_real,
|
||||||
|
@ -159,8 +159,8 @@ function d3d11_shader_set_cbuffer_vs(_slot, _cbuffer)
|
||||||
/// @param {Real} _cbuffer The ID of the comand buffer.
|
/// @param {Real} _cbuffer The ID of the comand buffer.
|
||||||
///
|
///
|
||||||
/// @return {Bool} Returns true if the constant buffer exists.
|
/// @return {Bool} Returns true if the constant buffer exists.
|
||||||
function d3d11_cbuffer_exists(_cbuffer)
|
function d3d11_cbuffer_exists(_cbuffer) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_cbuffer_exists", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_cbuffer_exists", dll_cdecl, ty_real,
|
||||||
|
@ -173,8 +173,8 @@ function d3d11_cbuffer_exists(_cbuffer)
|
||||||
/// @desc Destroys a constant buffer.
|
/// @desc Destroys a constant buffer.
|
||||||
///
|
///
|
||||||
/// @param {Real} _cbuffer The ID of the constant buffer to destroy.
|
/// @param {Real} _cbuffer The ID of the constant buffer to destroy.
|
||||||
function d3d11_cbuffer_destroy(_cbuffer)
|
function d3d11_cbuffer_destroy(_cbuffer) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_cbuffer_destroy", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_cbuffer_destroy", dll_cdecl, ty_real,
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
/// @return {Real} The ID of the pixel shader or -1 on fail.
|
/// @return {Real} The ID of the pixel shader or -1 on fail.
|
||||||
///
|
///
|
||||||
/// @see d3d11_get_error_string
|
/// @see d3d11_get_error_string
|
||||||
function d3d11_shader_compile_ps(_file, _entryPoint, _profile)
|
function d3d11_shader_compile_ps(_file, _entryPoint, _profile) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_shader_compile_ps", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_shader_compile_ps", dll_cdecl, ty_real,
|
||||||
|
@ -32,8 +32,8 @@ function d3d11_shader_compile_ps(_file, _entryPoint, _profile)
|
||||||
/// @return {Real} The ID of the vertex shader or -1 on fail.
|
/// @return {Real} The ID of the vertex shader or -1 on fail.
|
||||||
///
|
///
|
||||||
/// @see d3d11_get_error_string
|
/// @see d3d11_get_error_string
|
||||||
function d3d11_shader_compile_vs(_file, _entryPoint, _profile)
|
function d3d11_shader_compile_vs(_file, _entryPoint, _profile) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_shader_compile_vs", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_shader_compile_vs", dll_cdecl, ty_real,
|
||||||
|
@ -47,8 +47,8 @@ function d3d11_shader_compile_vs(_file, _entryPoint, _profile)
|
||||||
/// shader with a custom one.
|
/// shader with a custom one.
|
||||||
///
|
///
|
||||||
/// @param {Real} _ps The ID of the shader or -1 to disable the override.
|
/// @param {Real} _ps The ID of the shader or -1 to disable the override.
|
||||||
function d3d11_shader_override_ps(_ps)
|
function d3d11_shader_override_ps(_ps) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_shader_override_ps", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_shader_override_ps", dll_cdecl, ty_real,
|
||||||
|
@ -64,8 +64,8 @@ function d3d11_shader_override_ps(_ps)
|
||||||
/// @param {Real} _vs The ID of the shader or -1 to disable the override. The
|
/// @param {Real} _vs The ID of the shader or -1 to disable the override. The
|
||||||
/// vertex format expected by the shader must be compatible with the overriden
|
/// vertex format expected by the shader must be compatible with the overriden
|
||||||
/// shader!
|
/// shader!
|
||||||
function d3d11_shader_override_vs(_vs)
|
function d3d11_shader_override_vs(_vs) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_shader_override_vs", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_shader_override_vs", dll_cdecl, ty_real,
|
||||||
|
@ -80,8 +80,8 @@ function d3d11_shader_override_vs(_vs)
|
||||||
/// @param {Real} _ps The ID of the shader.
|
/// @param {Real} _ps The ID of the shader.
|
||||||
///
|
///
|
||||||
/// @return {Bool} Returns true if the shader exists.
|
/// @return {Bool} Returns true if the shader exists.
|
||||||
function d3d11_shader_exists(_shader)
|
function d3d11_shader_exists(_shader) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_shader_exists", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_shader_exists", dll_cdecl, ty_real,
|
||||||
|
@ -94,8 +94,8 @@ function d3d11_shader_exists(_shader)
|
||||||
/// @desc Destroys a shader.
|
/// @desc Destroys a shader.
|
||||||
///
|
///
|
||||||
/// @param {Real} _shader The ID of the shader to destroy.
|
/// @param {Real} _shader The ID of the shader to destroy.
|
||||||
function d3d11_shader_destroy(_shader)
|
function d3d11_shader_destroy(_shader) {
|
||||||
{
|
if(!GMD3D11_IS_SUPPORTED) return;
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
static _fn = external_define(
|
static _fn = external_define(
|
||||||
GMD3D11_PATH, "d3d11_shader_destroy", dll_cdecl, ty_real,
|
GMD3D11_PATH, "d3d11_shader_destroy", dll_cdecl, ty_real,
|
||||||
|
|
Loading…
Add table
Reference in a new issue